HIVE安装过程

举报
shs 发表于 2018/12/17 11:31:34 2018/12/17
【摘要】 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

######解决上面问题



【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。