Hive Metastore 启动成功又失败

hive 在正常使用中 metastore 忽然停掉,查看日志,报一下错误:

2017-06-19 12:11:15,134 ERROR [main]: metastore.HiveMetaStore (HiveMetaStore.java:startMetaStore(6080)) - org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9083.
        at org.apache.thrift.transport.TServerSocket.(TServerSocket.java:109)
        at org.apache.thrift.transport.TServerSocket.(TServerSocket.java:91)
        at org.apache.thrift.transport.TServerSocket.(TServerSocket.java:83)
        at org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.(TServerSocketKeepAlive.java:34)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.startMetaStore(HiveMetaStore.java:6004)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.main(HiveMetaStore.java:5945)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

2017-06-19 12:11:15,135 ERROR [main]: metastore.HiveMetaStore (HiveMetaStore.java:main(5949)) - Metastore Thrift Server threw an exception...
org.apache.thrift.transport.TTransportException: Could not create ServerSocket on address 0.0.0.0/0.0.0.0:9083.
        at org.apache.thrift.transport.TServerSocket.(TServerSocket.java:109)
        at org.apache.thrift.transport.TServerSocket.(TServerSocket.java:91)
        at org.apache.thrift.transport.TServerSocket.(TServerSocket.java:83)
        at org.apache.hadoop.hive.metastore.TServerSocketKeepAlive.(TServerSocketKeepAlive.java:34)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.startMetaStore(HiveMetaStore.java:6004)
        at org.apache.hadoop.hive.metastore.HiveMetaStore.main(HiveMetaStore.java:5945)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

这个端口被占的错误,已经存在一个metastore服务,需要停掉再重启。

查看metastore 服务端口:

ps -ef |grep HiveMetaStore


root     177779 152404  0 15:18 pts/2    00:00:00 grep HiveMetaStore
hive     679107      1  0 Apr24 ?        02:34:20 /usr/jdk64/jdk1.8.0_60/bin/java -Xmx1024m -Dhdp.version=2.4.2.0-258 -Djava.net.preferIPv4Stack=true -Dhdp.version=2.4.2.0-258 -Dhadoop.log.dir=/var/log/hadoop/hive -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/usr/hdp/2.4.2.0-258/hadoop -Dhadoop.id.str=hive -Dhadoop.root.logger=INFO,console -Djava.library.path=:/usr/hdp/current/hadoop-client/lib/native/Linux-amd64-64:/usr/hdp/2.4.2.0-258/hadoop/lib/native -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true -Xmx1024m -Xmx16118m -Dhadoop.security.logger=INFO,NullAppender org.apache.hadoop.util.RunJar /usr/hdp/2.4.2.0-258/hive/lib/hive-service-1.2.1000.2.4.2.0-258.jar org.apache.hadoop.hive.metastore.HiveMetaStore -hiveconf hive.log.file=hivemetastore.log -hiveconf hive.log.dir=/var/log/hive

根据找到的pid 杀死该进程:
kill -9 “pid”

最后重启metastore 就可以了

本文出自“筱Mary”博客,转载请务必保留本文连接

你可能感兴趣的:(Hive,大数据入门)