基于Hadoop2.6.5(HA)的Hive1.2.1的MySQL方式配置

1.Hive配置MySQL

Hive只是一个工具,无需配置多台机器,我在CentOS7One机器上配置Hive

/usr/local/hive/apache-hive-1.2.1-bin/conf

cp hive-default.xml.template hive-site.xml

编辑hive-site.xml

配置MySQL连接地址

  
    javax.jdo.option.ConnectionURL
    jdbc:mysql://192.168.1.161:3306/hive?createDatabaseIfNotExist=true
    JDBC connect string for a JDBC metastore
  

配置MySQL驱动包

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

配置数据库用户名

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

配置数据库密码

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

在CentOS7One上启动hive

sh /usr/local/hive/apache-hive-1.2.1-bin/bin/hive

2.注意事项

MySQL驱动包要加入到hive的lib目录下(/usr/local/hive/apache-hive-1.2.1-bin/lib),mysql-connector-java-5.1.28.jar

你可能感兴趣的:(基于Hadoop2.6.5(HA)的Hive1.2.1的MySQL方式配置)