HIVE安装过程
环境:
1、操作系统:CentOS-6.5-x86_64
2、JDK:jdk-8u40-linux-x64
3、HADOOP:hadoop-2.6.0
4、HBASE:hbase-0.98.11-hadoop2
5、MySQL-server-5.5.28-1.linux2.6.x86_64
6、HIVE1.1.0
共3台虚拟机,每台虚拟机500M内存足矣,一台作namenode,两台作datanode
192.168.120.10 nn1
192.168.120.11 dn1
192.168.120.12 dn2
前提:安装好HADOOP2.6.0
***********************************************************************************************************
安装配置mysql
***********************************************************************************************************
1、rpm -ihv MySQL-server-5.5.28-1.linux2.6.x86_64.rpm
2、rpm -ihv MySQL-client-5.5.28-1.linux2.6.x86_64.rpm
安装前,检查一下是否存在已有的mysql组件
rpm -aq | grep mysql
rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64
启动mysql
/etc/init.d/mysql start
mysql -uroot -proot 或者:mysql -hnn1 -uroot
create user hive identified by 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'localhost' IDENTIFIED BY 'hive' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'nn1' IDENTIFIED BY 'hive' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'192.168.120.1' IDENTIFIED BY 'hive' WITH GRANT OPTION;
FLUSH PRIVILEGES;
mysql -hnn1 -uhive -phive
create database hive;
***********************************************************************************************************
hive安装配置过程:
***********************************************************************************************************
1、.bash_profile参数:
export HIVE_HOME=/home/hadoop/hive110
export PATH=$HIVE_HOME/bin:$PATH
export HIVE_CONF_DIR=$HIVE_HOME/conf
export HIVE_LIB=$HIVE_HOME/lib
2、hive110/conf/hive-site.xml参数:
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://nn1:3306/hive?createDatabaseIfNOtExist=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>hive</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.security.authorization.createtable.owner.grants</name>
<value>ALL</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>mapreduce.jobtracker.address</name>
<value>nn1:8082</value>
<description>password to use against metastore database</description>
</property>
</configuration>
3、进入hive脚本模式:
hive
set hive.exec.dynamic.partition=true;
set hive.exec.dynamic.partition.mode=nostrick;
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
at jline.console.ConsoleReader.<init>(ConsoleReader.java:230)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
at org.apache.hadoop.hive.cli.CliDriver.getConsoleReader(CliDriver.java:773)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:715)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
[hadoop2@nn1 ~]$ mv hadoop260/share/hadoop/yarn/lib/jline-0.9.94.jar hadoop260/share/hadoop/yarn/lib/jline-0.9.94.jar.bak
######解决上面问题
- 点赞
- 收藏
- 关注作者
评论(0)