标签:word temp control 基于 base encoding 环境变量 tor mapr
hive是基于hadoop的一个数据仓库工具,可以将结构化的数据文件映射成一张数据库表,并提供简单的SQL查询功能,可以将SQL语句转换为Mapreduce任务进行运行
mkdir -p /data/hive1
cd /data/hive1
wget http://192.168.1.100:60000/allfiles/hive1/hive-1.1.0-cdh5.4.5.tar.gz
wget http://192.168.1.100:60000/allfiles/hive1/mysql-connector-java-5.1.26-bin.jar
tar -xzvf hive-1.1.0-cdh5.4.5.tar.gz -C /apps/
cd /apps
mv /apps/hive-1.1.0-cdh5.4.5/ /apps/hive
sudo vim ~/.bashrc
#hive config
export HIVE_HOME=/apps/hive
export PATH=$HIVE_HOME/bin:$PATH
source ~/.bashrc
cp /data/hive1/mysql-connector-java-5.1.26-bin.jar /apps/hive/lib/
cd /apps/hive/conf
touch hive-site.xml
vim hive-site.xml
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name> //数据库连接字符串
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExsit=true;characterEncoding=latin1</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>strongs</value>
</property>
</configuration>
mv /apps/hive/conf/hive-env.sh.template /apps/hive/conf/hive-env.sh
vim hive-env.sh
# Set HADOOP_HOME to point to a specific hadoop install directory
# HADOOP_HOME=${bin}/../../hadoop
HADOOP_HOME=/apps/hadoop
# Hive Configuration Directory can be controlled by:
# export HIVE_CONF_DIR=
export HIVE_CONF_DIR=/apps/hive/conf
sudo service mysql status
sudo apt-get install mysql-server
sudo service mysql start
mysql -u root -p //开启mysql数据库
create database hive CHARACTER SET latin1;
show databases;
exit
/apps/hadoop/sbin/start-all.sh
hive
show databases;
标签:word temp control 基于 base encoding 环境变量 tor mapr
原文地址:https://www.cnblogs.com/hannahzhao/p/11761414.html