Hive远程模式启动
1、配置远程服务器MYSQL,并保证远程可以访问
2、$HIVE_HOME/conf/hive-site.xml 关键配置如下
<property>
<name>hive.metastore.local</name>
<value>false</value>
<description>controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM</description>
</property>
<name>hive.metastore.local</name>
<value>false</value>
<description>controls whether to connect to remove metastore server or open a new metastore server in Hive Client JVM</description>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.17.133:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://192.168.17.133:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
<description>Driver class name for a JDBC metastore</description>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>chenbo</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://127.0.0.1:9083</value>
</property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>chenbo</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.metastore.uris</name>
<value>thrift://127.0.0.1:9083</value>
</property>
3、mysql-connector-java-5.1.12.jar复制到$HIVE_HOME/lib下
4、$HIVE_HOME/bin/hive --service metastore --开启metastore服务 默认端口用的是9083
5、$HIVE_HOME/bin/hive --service hiveserver --开启hiveserver服务 JDBC端口是10000 JAVA可以连接
6、在本地启动$HIVE_HOME/bin/hive hive>show tables;
7、登录远程hive数据库,如果有元数据,说明完全启动成功