@zhangyy
2018-04-11T13:46:22.000000Z
字数 2240
阅读 140
hive的部分
- 系统初始化
- mysql5.6 的安装配置
- hive 的安装配置处理
CentOS6.4x64
安装好的hadoop伪分布环境
所需软件包:
apache-hive-0.3.1.tar.gz
mysql-connector-java-5.1.27.tar.gz
mysql-server-5.6.24-1.el6x86_64
mysql-client-5.6.24-1.el6x86_64
上传到/home/hadoop/yangyang/
rpm -qa |grep mysql
rpm -e --nodeps mysql-libs
rpm -ivh /home/hadoop/mysql-*
service mysql start
mysql -uroot -p
mysql> set password = password("123456");
mysql> flush privileges;
mysql> grant all privileges on *.* to root@'namenode01.hadoop.com' identified by '123456';
mysql> flush privileges
bin/hdfs dfs -mkdir /tmp
bin/hdfs dfs -mkdir -p /user/hive/warehouse
bin/hdfs dfs -chmod g+w /user/hive/warehouse
bin/hdfs dfs -chmod g+w /tmp
tar -zxvf apache-hive-0.13.1-bin.tar.gz
mv apache-hive-0.13.1-bin yangyang/hive
cd yangyang/hive/conf
cp -p hive-env.sh.template hive-env.sh
vim hive-env.sh
export HADOOP_HOME=/home/hadoop/yangyang/hadoop
# Hive Configuration Directory can be controlled by:
export HIVE_CONF_DIR=/home/hadoop/yangyang/hive/conf
cp -p hive-default.xml.template hive-site.xml
vim hive-site.xml
<property>
<name>hive.cli.print.header</name>
<value>true</value> <!-- false 改为true -->
<description>Whether to print the names of the columns in query output.</description>
</property>
<property>
<name>hive.cli.print.current.db</name>
<value>true</value> <!-- false 改为true -->
<description>Whether to include the current database in the Hive prompt.</description>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://namenode01.hadoop.com:3306/metastore?createDatabaseIfNotExist=true</value>
</property>
<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>
cp -p hive-log4j.properties.template hive-log4j.properties
vim hive-log4j.properties
hive.log.dir=/home/hadoop/yangyang/hive
hive.log.file=hive.log
tar -zxvf mysql-connector-java-5.1.27.tar.gz
cd mysql-connector-java-5.1.27/
cp -p mysql-connector-java-5.1.27-bin.jar yangyang/hive/lib/
运行hive
bin/hive