Hive安装与配置(需搭建好hadoop集群)

hive的安装
1:上传解压hive    tar -zxvf   *****   /usr/local/
2:安装mysql,添加开机自启        chkconfig   mysql on
3:配置hive-site.xml     在安装目录/conf下新建,粘贴下面这段代码(高版本mysql需要ssl)


javax.jdo.option.ConnectionURL
jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true
JDBC connect string for a JDBC metastore


javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
Driver class name for a JDBC metastore


javax.jdo.option.ConnectionUserName
root
username to use against metastore database


javax.jdo.option.ConnectionPassword
root
password to use against metastore database


4:添加mysql*.jar   添加到$HIVE_HOME/lib    一个Mysql的驱动包,版本不限
5:添加到path环境变量里面

6:source /etc/profile

7:nohup hiveserver2     //hadoop集群必须开启,其他节点hive必须配置好

//配置好一台机器, scp命令发送省时省力

8.beeline连接  

   !connect jdbc:hive2://jiqun01:10000

   输入用户密码

你可能感兴趣的:(应届生,一年后毕业,找工作,Java,HaDoop学习历程)