标签:
Hive只需要在使用节点上安装即可。
1.上传tar包,
1.1解压
tar -zxvf apache-hive-0.13.0-bin.tar.gz -C /hadoop/
1.2配置HIVE_HOME环境变量
/etc/profile
2.安装mysql
rpm -qa | grep mysql
rpm -e mysql-libs-5.1.66-2.el6_3.i686 --nodeps
rpm -ivh MySQL-server-5.1.73-1.glibc23.i386.rpm
rpm -ivh MySQL-client-5.1.73-1.glibc23.i386.rpm
修改mysql的密码
/usr/bin/mysql_secure_installation
(注意:删除匿名用户,允许用户远程连接)
登陆mysql
mysql -u root -p
3.配置hive
新建一个hive.site.xml文件,添加如下内容:
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://hadoop03: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>root</value> <description>username to use against metastore database</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>123</value> <description>password to use against metastore database</description> </property> </configuration>
4.安装完hive和mysq后,将mysql的连接jar包"mysql-connector-java-5.1.10.jar"拷贝到 $HIVE_HOME/lib 目录下
如果出现没有权限的问题,在mysql授权(在安装mysql的机器上执行)
4.1登录mysql:mysql -uroot -p
4.2#(执行下面的语句 *.*:所有库下的所有表 %:任何IP地址或主机都可以连接)
GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘%‘ IDENTIFIED BY ‘123‘ WITH GRANT OPTION;
FLUSH PRIVILEGES;
5.启动hive
使用命令:$HIVE_HOME/bin/hive
标签:
原文地址:http://www.cnblogs.com/skyl/p/4736042.html