继续上面的文章,安装hive

一、

1、解压 tar -zvxf apache-hive-1.2.1-bin.tar.gz

2、添加环境变量

3、修改 hive-site.xml


hive.exec.scratchdir
/tmp/hive
HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/ is created, with ${hive.scratch.dir.permission}.


hive.exec.local.scratchdir
/usr/apache-hive-1.2.2-bin/iotmp
Local scratch space for Hive jobs


hive.downloaded.resources.dir
/usr/apache-hive-1.2.2-bin/iotmp
Temporary local directory for added resources in the remote file system.


javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
Driver class name for a JDBC metastore


hive.conf.hidden.list
javax.jdo.option.ConnectionPassword,hive.server2.keystore.password
Comma separated list of configuration options which should not be read by normal user like passwords

javax.jdo.option.ConnectionUserName
hive
Username to use against metastore database

4、增加用户验证

5、启动服务

nohup ./hive --service metastore 2>&1 >> /usr/hive/metastore.log

nohup ./hive --service hiveserver2 2>&1 >> /usr/hive/metastore.log