准备工作就是需要将mysql-connector-java-5.1.24.JAR包拷贝到 hive/lib目录下
这里我将10.0.20.178作为主节点,同时也把MYSQL装在了这个节点上,其配置文件内容为:
hive.metastore.local false connect to remove metastore server or open a new metastore server in Hive Client JVM javax.jdo.option.ConnectionURL javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver Driver class name for a JDBC metastore javax.jdo.option.ConnectionUserName hive username to use against metastore database javax.jdo.option.ConnectionPassword 123456 password to use against metastore database hive.metastore.warehouse.dir /user/hive/warehouse location of default database for the warehouse hbase.zookeeper.quorum hadoop20-178,hadoop-134 hive.aux.jars.path file:///usr/lib/hbase/lib/hive-hbase-handler-0.9.0-cdh4.1.2.jar,file:///usr/lib/hbase/hbase.jar,file:///usr/lib/hbase/lib/zookeeper-3.4.3-cdh4.1.2.jar
然后启动服务:
hive --service metastore >/dev/null 2>/dev/null &在其他节点,不管你有多少节点都可以把配置文件内容改为:
hive.metastore.local false controls whether to connect to remove metastore server or open a new metastore server in Hive ClientJVM hive.metastore.uris thrift://10.0.20.178:9083
一切搞定。关于常见的错误,我会在其他博客中列举。