Hive环境配置
解压安装:
$ tar -zxvf hive-1.1.0-cdh5.7.6.tar.gz /opt/cdh-5.7.6/
编辑hive-env.sh文件:
$ cd /opt/cdh-5.7.6/hive-1.1.0-cdh5.7.6/conf
$ vim hive-env.sh
编辑hive-site.xml文件(拷贝一个hive-site.xml):
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://ecloud01/metastore?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>123456</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value>
<description>Whether to include the current database in the Hive prompt.</description>
</property>
<property>
<name>hive.cli.print.header</name>
<value>true</value>
<description>Whether to print the names of the columns in query output.</description>
</property>
</configuration>
创建目录:
分发:
$ scp -r /opt/cdh-5.7.6/hive-1.1.0-cdh5.7.6/ ecloud02:/opt/cdh-5.7.6/
$ scp -r /opt/cdh-5.7.6/hive-1.1.0-cdh5.7.6/ ecloud03:/opt/cdh-5.7.6/
$ scp -r /opt/cdh-5.7.6/hive-1.1.0-cdh5.7.6/ ecloud04:/opt/cdh-5.7.6/
导包:
导入mysqljar包到lib目录
MySQL环境配置
查看mysql是否安装:
$ sudo rpm -qa|grep mysql
卸载:
$ sudo rpm -e --nodeps xxx
安装mysql(yum安装):
$ yum install mysql
启动mysql:
$ sudo service mysqld start
第一次启动初始化:
$ /usr/bin/mysqladmin - u root password '123456'
$ /usr/bin/mysqladmin - u root -h ecloud01 password '123456'
修改mysql库的user表: