您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

hive的安装

2025/10/1 8:50:32发布17次查看
在此强调:
hadoop,zookpeer,spark,kafka已经正常启动
开始安装部署hive
基础依赖环境:
1,jdk 1.6+ 2, hadoop 2.x 3,hive 0.13-0.19 4,mysql (mysql-connector-jar)
安装详细如下:
#java export java_home=/soft/jdk1.7.0_79/ export classpath=.:$java_home/lib/dt.jar:$java_home/lib/tools.jar #bin export path=$path:/$java_home/bin:$hadoop_home/bin:$scala_home/bin:$spark_home/bin:/usr/local/hadoop/hive/bin #hadoop export hadoop_home=/usr/local/hadoop/hadoop #scala export scala_home=/usr/local/hadoop/scala #spark export spark_home=/usr/local/hadoop/spark #hive export hive_home=/usr/local/hadoop/hive
一、开始安装:
1,下载:
https://hive.apache.org/downloads.html
解压:
tar xvf apache-hive-2.1.0-bin.tar.gz -c /usr/local/hadoop/ cd /usr/local/hadoop/ mv apache-hive-2.1.0 hive
2,修改配置
修改启动环境 cd /usr/local/hadoop/hive vim bin/hive-config.sh #java export java_home=/soft/jdk1.7.0_79/ #hadoop export hadoop_home=/usr/local/hadoop/hadoop #hive export hive_home=/usr/local/hadoop/hive
修改默认配置文件
cd /usr/local/hadoop/hive vim conf/hive-site.xml <configuration> <property> <name>javax.jdo.option.connectionurl</name> <value>jdbc:mysql://master:3306/hive?createdatabaseinfonotexist=true</value> <description>jdbc connect string for a jdbc metastore</description> </property> <property> <name>javax.jdo.option.connectiondrivername</name> <value>com.mysql.jdbc.driver</value> <description>driver class name for a jdbc metastore</description> </property> <property> <name>javax.jdo.option.connectionusername</name> <value>hive</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.connectionpassword</name> <value>xujun</value> <description>password to use against metastore database</description> </property> </configuration>
3,修改tmp dir
修改 将含有"system:java.io.tmpdir"的配置项的值修改为如上地址
/tmp/hive
二、安装好mysql,并且启动
1.创建数据库
create database hive grant all on *.* to hive@'%' identified by 'hive'; flush privileges;
三,初始化hive
cd /usr/local/hadoop/hive bin/schematool -initschema -dbtype mysql slf4j: see http://www.slf4j.org/codes.html#multiple_bindings for an explanation. slf4j: actual binding is of type [org.apache.logging.slf4j.log4jloggerfactory] metastore connection url: jdbc:mysql://hadoop3:3306/hive?createdatabaseinfonotexist=true metastore connection driver : com.mysql.jdbc.driver metastore connection user: hive starting metastore schema initialization to 2.1.0 initialization script hive-schema-2.1.0.mysql.sql initialization script completed schematool completed
四、启动
[hadoop@hadoop1 hadoop]$ hive/bin/hive which: no hbase in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin://soft/jdk1.7.0_79//bin:/bin:/bin:/bin:/usr/local/hadoop/hive/bin:/home/hadoop/bin) slf4j: class path contains multiple slf4j bindings. slf4j: found binding in [jar:file:/usr/local/hadoop/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: found binding in [jar:file:/usr/local/hadoop/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: see http://www.slf4j.org/codes.html#multiple_bindings for an explanation. slf4j: actual binding is of type [org.apache.logging.slf4j.log4jloggerfactory] logging initialized using configuration in jar:file:/usr/local/hadoop/hive/lib/hive-common-2.1.0.jar!/hive-log4j2.properties async: true hive-on-mr is deprecated in hive 2 and may not be available in the future versions. consider using a different execution engine (i.e. tez, spark) or using hive 1.x releases. hive> show databases; ok default time taken: 1.184 seconds, fetched: 1 row(s) hive>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product