《educoder平台Hive的安装与配置.doc》由会员分享,可在线阅读,更多相关《educoder平台Hive的安装与配置.doc(6页珍藏版)》请在金锄头文库上搜索。
1、第一关Hive的安装与配置cd /opt回车tar -zxvf apache-hive-3.1.0-bin.tar.gz回车mv apache-hive-3.1.0-bin hive回车vi /etc/profile按i在末尾添加以下两行代码; export HIVE_HOME=/opt/hive export PATH=$HIVE_HOME/bin:$PATH退出wqsource /etc/profile回车hive -version回车rm /opt/hive/lib/log4j-slf4j-impl-2.10.0.jar回车hive -version回车tar -zxvf mysql-c
2、onnector-java-5.1.45.tar.gz回车cd mysql-connector-java-5.1.45回车cp mysql-connector-java-5.1.45-bin.jar /opt/hive/lib/回车mysql -uroot -p123123 -h127.0.0.1回车create database hiveDB;回车create user bee% identified by 123123;回车grant all privileges on hiveDB.* to bee% identified by 123123;回车flush privileges;回车e
3、xit回车cd /opt回车cd /opt/hive/conf回车vi hive-site.xml回车将以下内容复制到其中(按i进入编辑模式后再进行粘贴) hive.metastore.warehouse.dir /opt/hive/warehouse hive.exec.scratchdir /opt/hive/tmp hive.querylog.location /opt/hive/logs hive.server2.thrift.port 10000 hive.server2.thrift.bind.host localhost hive.server2.enable.doAs true
4、 hive.session.id false hive.session.silent false javax.jdo.option.ConnectionURL jdbc:mysql:/localhost:3306/hiveDB?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName bee javax.jdo.option.ConnectionPassword 123123 完成后,在命令行模式(按 Esc),输入:wq保存退出。cp hive-env.sh.template hive-env.sh回车vi hive-env.sh回车在最后一行按i粘贴下列代码HADOOP_HOME=/usr/local/hadoop退出wqschematool -dbType mysql -initSchema回车start-dfs.sh(启动Hadoop)测评第2关:Hive Shell入门基础命令hive;回车create table student(id int,回车name string,回车age int);测评