Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the hive environment configuration in the Hadoop environment configuration?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces what the Hadoop environment configuration is like in the hive environment configuration, the content is very detailed, interested friends can refer to, hope to be helpful to you.

1. Pull the downloaded hive package to the / opt/software/ folder

Installation package version: apache-hive-3.1.2-bin.tar.gz

2. Extract the installation package to the / opt/module/ folder, and command:

Cd / opt/software/tar-zxvf compressed package name-C / opt/module/

3. Modify the system environment variable, command:

Vi / etc/profile

Add the following code to the editing panel:

Export HIVE_HOME=/opt/module/apache-hive-3.1.2-binexport PATH=$PATH:$HADOOP_HOME/sbin:$HIVE_HOME/bin

4. Restart the environment configuration, command:

Source / etc/profile

5. Modify the hive environment variable

Cd / opt/module/apache-hive-3.1.2-bin/bin/

① configuration hive-config.sh file

Vi hive-config.sh

Add the following code to the editing panel:

Export JAVA_HOME=/opt/module/jdk1.8.0_212export HIVE_HOME=/opt/module/apache-hive-3.1.2-binexport HADOOP_HOME=/opt/module/hadoop-3.2.0export HIVE_CONF_DIR=/opt/module/apache-hive-3.1.2-bin/conf

6. Copy the hive configuration file, and command:

Cd / opt/module/apache-hive-3.1.2-bin/conf/cp hive-default.xml.template hive-site.xml

7. Modify the hive configuration file, find the corresponding location, and click the code to modify it:

Vi hive-site.xml javax.jdo.option.ConnectionDriverName com.mysql.cj.jdbc.Driver Driver class name for a JDBC metastore javax.jdo.option.ConnectionUserName root Username to use against metastore database javax.jdo.option.ConnectionPassword 12345 custom password password to use against metastore database javax.jdo.option.ConnectionURLjdbc:mysql://192.168.1.100:3306/hive?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT JDBC connect string for a JDBC metastore. To use SSL to encrypt/authenticate the connection, provide database-specific SSL flag in the connection URL. For example, jdbc:postgresql://myhost/db?ssl=true for postgres database. Datanucleus.schema.autoCreateAll true Auto creates necessary schema on a startup if one doesn't exist. Set this to false, after creating it once.To enable auto create also set hive.metastore.schema.verification=false. Auto creation is not recommended for production use cases, run schematool command instead. Hive.metastore.schema.verification false Enforce metastore schema version consistency. True: Verify that version information stored in is compatible with one from Hive jars. Also disable automatic schema migration attempt. Users are required to manually migrate schema after Hive upgrade which ensures proper metastore schema migration. (Default) False: Warn if the version information stored in metastore doesn't match with one from in Hive jars. Hive.exec.local.scratchdir / opt/module/apache-hive-3.1.2-bin/tmp/$ {user.name} Local scratch space for Hive jobs system:java.io.tmpdir/opt/module/apache-hive-3.1.2-bin/iotmp hive.downloaded.resources.dir/opt/module/apache-hive-3.1.2-bin/tmp/$ {hive.session.id} _ resources Temporary local directory for added resources in the remote file system. Hive.querylog.location / opt/module/apache-hive-3.1.2-bin/tmp/$ {system:user.name} Location of Hive run time structured log file hive.server2.logging.operation.log.location/opt/module/apache-hive-3.1.2-bin/tmp/$ {system:user.name} / operation_logs Top level directory where operation logs are stored if logging functionality is enabled hive.metastore.db.type mysql Expects one of [derby, oracle, mysql, mssql Postgres]. Type of database used by the metastore. Information schema & JDBCStorageHandler depend on it. Hive.cli.print.current.db true Whether to include the current database in the Hive prompt. Hive.cli.print.header true Whether to print the names of the columns in query output. Hive.metastore.warehouse.dir / opt/hive/warehouse location of default database for the warehouse

8. Upload the mysql driver package to the / opt/module/apache-hive-3.1.2-bin/lib/ folder

Driver package: mysql-connector-java-8.0.15.zip. Get the jar package from it after decompression.

9. Enter the database, create a new database named hive in the database, and make sure that there is a database named hive in the mysql database.

Mysql > create database hive

10. Initialize the Metabase, command:

Schematool-dbType mysql-initSchema

11. Get together and order:

On start-all.sh Hadoop100, on start-yarn.sh Hadoop101

12. Start hive with the command:

Hive

13. Check whether the startup is successful or not. Command:

Show databases

If there are all kinds of databases, the startup is successful.

On the Hadoop environment configuration of the hive environment configuration is how to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report