linux下HIVE/beeline客户端的安装和启动
1.首先安装mysql;(推荐远程安装)
#安装mysql
yum install mysql mysql-server mysql-devel
/etc/init.d/mysqld start 首次启动
mysql 启动mysql进入控制台
mysql>; USE mysql;
mysql>; UPDATE user SET Password=PASSWORD(‘hadoop’) WHERE user=‘root’;
mysql>GRANT ALL PRIVILEGES ON . TO ‘root’@’%’ IDENTIFIED BY ‘hadoop’ WITH GRANT OPTION;
mysql>; FLUSH PRIVILEGES;
把mysql设置为开机自启动
chkconfig mysqld on
2.单独配置启动metastore服务 全局唯一
具体搭建:
vim $hive_home/conf/hive-env.sh
export HADOOP_HOME=/export/servers/hadoop-2.6.0-cdh5.14.0
vim $hive_home/conf/hive-site.xml
javax.jdo.option.ConnectionURL
jdbc:mysql://bigdata01:3306/hive?createDatabaseIfNotExist=true
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>123456</value>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>bigdata01</value>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://bigdata01:9083</value>
</property>
把mysql的驱动包拷贝到lib($hive_home/lib)路径下
mysql-connector-java-5.1.32.jar
然后后台启动hive metastore服务
nohup /export/servers/hive/bin/hive --service metatsore &
客户端client配置:$hive_home/conf/hive-sitexml
hive.metastore.uris
thrift://bigdata01:9083
按照mysql---->metastore---->hiveserver2的顺序,最后启动hive和beeline:
启动hiveserver2服务:
nohup /export/servers/hive/bin/hive --service metastore &
nohup /export/servers/hive/bin/hive --service hiveserver2 &
启动beeline客户端连接
bin/beeline
beeline> ! connect jdbc:hive2://bigdata01:10000
scan complete in 3ms
Connecting to jdbc:hive2://bigdata01:10000
Enter username for jdbc:hive2://bigdata01:10000: root ##hiveserver2所在服务器root用户名
Enter password for jdbc:hive2://bigdata01:10000: ****** 密码
本文详细介绍了在Linux系统中如何安装和配置Hive的beeline客户端,包括安装MySQL,设置MySQL的root用户权限,配置Hive的metastore服务,拷贝mysql驱动到Hive的lib目录,启动Hive metastore和hiveserver2服务,最后通过Beeline客户端进行连接。
604

被折叠的 条评论
为什么被折叠?



