hive配置mysql单机模式
将hive安装在opt目录下
cd /opt/hive-2.3.4/conf
mv hive-default.xml.template hive-site.xml(必须改成这个名字)
vi hive-site.xml 删除原来的配置信息写入如下配置:
hive.metastore.warehouse.dir
/user/hive_remote/warehouse
hive.metastore.local
true
javax.jdo.option.ConnectionURL
jdbc:mysql://node01/hive_remote?createDatabaseIfNotExist=true
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
root
javax.jdo.option.ConnectionPassword
123123
将mysql的jar包复制到hive的lib目录下cp mysql-connector-java-5.1.32-bin.jar /opt/hive-2.3.4/lib/
执行schematool -dbType mysql -initSchema初始化hive
hive配置mysql远程服务器模式
在另外两台主机安装hive分别配置/opt/hive-2.3.4/conf/hive-site.xml
服务器端配置
hive.metastore.warehouse.dir
/user/hive/warehouse
javax.jdo.option.ConnectionURL
jdbc:mysql://node01/hivecreateDatabaseIfNotExist=true
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName
root
javax.jdo.option.ConnectionPassword
123123
客户端配置
hive.metastore.warehouse.dir
/user/hive/warehouse
hive.metastore.uris
thrift://node03:9083
服务端执行schematool -dbType mysql -initSchema初始化hive
再执行hive --service metastore开启元数据接口服务
客户端进入hive命令行