- 远程模式需要单独启动一个metastore服务 然后每个客户端都在配置文件里配置连接到该metastore服务
- 远程模式下metastore服务和hive运行在不同的进程中
- 远程模式下需要指定本地模式为false并且配置hive.metastore.uris参数来指定metastore服务运行的ip和端口
- 并且需要手动启动metastore服务
前提准备:
01选择某台机器提前安装mysql,确保hive集群服务器可以连通
02启动hadoop集群 集群正常健康
操作步骤:
01修改hive配置文件
vim conf/hive-env.sh export HADOOP_HOME=/export/servers/hadoop-2.6.0-cdh5.14.0
02修改hive-site.xml
服务端主要配置:
hive.metastore.warehouse.dir /user/hive/warehouse javax.jdo.option.ConnectionURL jdbc:mysql://xxx.xxx.xxx.xxx:3306/hive_remote?createDatabaseIfNotExist=true javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName root javax.jdo.option.ConnectionPassword false hive.metastore.uris thrift://hadoop01:9083
启动方式:
nohup /export/servers/hive/bin/hive --service metastore & nohup /export/servers/hive/bin/hive --service hiveserver2 &



