1.remote Integrated
This type of storage requires running a MySQL server on the remote server , and the meta service needs to be started on the Hive server . here with mysql test server,IP bit 192.168.1.214, new hive_ Remote database, character set bit latine1;
$ vim Hive-site.xml
<Configuration> < Property> <name>Hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionURL</name> <value>Jdbc:mysql://192.168.57.6:3306/hive?createdatabaseifnotexist=true</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionDriverName</name> <value>Com.mysql.jdbc.Driver</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionUserName</name> <value>Hive</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionPassword</name> <value>Password</value> </ Property> < Property> <name>Hive.metastore.local</name> <value>False</value> </ Property> < Property> <name>Hive.metastore.uris</name> <value>thrift://192.168.1.188:9083</value> </ Property> </Configuration>
Note: The server and client of hive are placed on the same servers here. Server and client can be disassembled
2.Remoteseparate
Split the hive-site.xml configuration file into the following two parts
1), server-side configuration file
<Configuration> < Property> <name>Hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionURL</name> <value>Jdbc:mysql://192.168.57.6:3306/hive?createdatabaseifnotexist=true</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionDriverName</name> <value>Com.mysql.jdbc.Driver</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionUserName</name> <value>Root</value> </ Property> < Property> <name>Javax.jdo.option.ConnectionPassword</name> <value>123456</value> </ Property> </Configuration>
2), client configuration file
<Configuration> < Property> <name>Hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> </ Property> < Property> <name>Hive.metastore.local</name> <value>False</value> </ Property> < Property> <name>Hive.metastore.uris</name> <value>thrift://192.168.57.5:9083</value> </ Property> </Configuration>
# Start hive Service-side program $ hive-service metastore # client directly using hive command to hive hive history File =/tmp/root/hive_job_log_root_201301301416_955801255.txt hive> show Tables; OK test_hive time Taken: 0.736 seconds hive>
Hive 4, Hive installation configuration (remote MYMQL mode)