hive2.2.1安装

1下载hive 安装包

2hive_home/conf
cp hive-default.xml.template hive-site.xml

把所有模板都改成去掉template的配置文件

3修改hive-env.sh
export HIVE_CONF_DIR=/app/apache-hive-2.1.1-bin/conf
export HADOOP_HOME=/app/hadoop-2.7.3
export JAVA_HOME=/app/jdk1.8.0_131

修改hive-site.xml
   hive.metastore.uris 属性设置为 thrift://localhost:9083

修改javax.jdo.option.ConnectionURL属性为:
jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true


修改javax.jdo.option.ConnectionDriverName为:
com.mysql.jdbc.Driver

修改mysql 用户名密码
    javax.jdo.option.ConnectionUserName
    root
    Username to use against metastore database
 


    javax.jdo.option.ConnectionPassword
    123456
    password to use against metastore database
 

jdmysql://bigdata-senior03.chybinmy.com:3306/remote_db?createDatabaseIfNotExist=true


    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}/<username> is created, with ${hive.scratch.dir.permission}.
 

 
    hive.exec.local.scratchdir
    /tmp/hive/local
    Local scratch space for Hive jobs
 

 
    hive.downloaded.resources.dir
    /tmp/hive/resources
    Temporary local directory for added resources in the remote file system.
 
注意:上面配置的路径都要有写权限


网上下载mysql 驱动jar包mysql-connector-java-5.1.18-bin.jart拷贝到hive_home/lib下面(版本不一定)
可以在hive-site.xml中关闭验证功能


  hive.metastore.schema.verification

  false

   
 
    hive.server2.thrift.bind.host
    10.202.43.135
    Bind host on which to run the HiveServer2 Thrift service.
 


下载mysql的连接jar包,放到hive_home/lib目录下




进入mysql 

create database hive


初始化hive,在hive_home/bin目录下执行命令:
./schematool -dbType mysql -initSchema


如果出现连接数据库失败,可参考http://blog.csdn.net/cottonduke/article/details/52917214


启动hive metadata
nohup   hive --service metastore &

你可能感兴趣的:(hive)