重启虚拟机后,Hive无法启动,如何解决?

Posted watermarks

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了重启虚拟机后,Hive无法启动,如何解决?相关的知识,希望对你有一定的参考价值。

报错:

Exception in thread "main" java.lang.RuntimeException: java.net.SocketException: Call From bigdata/192.168.0.108 to bigdata:9000 failed on socket exception: java.net.SocketException: Network is unreachable; For more details see:  http://wiki.apache.org/hadoop/SocketException
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:610)
    at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:553)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:750)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
    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:498)
    at org.apache.hadoop.util.RunJar.run(RunJar.java:244)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:158)
Caused by: java.net.SocketException: Call From bigdata/192.168.0.108 to bigdata:9000 failed on socket exception: java.net.SocketException: Network is unreachable; For more details see:  http://wiki.apache.org/hadoop/SocketException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:824)
    at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:797)
    at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1544)
    at org.apache.hadoop.ipc.Client.call(Client.java:1486)
    at org.apache.hadoop.ipc.Client.call(Client.java:1385)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232)
    at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:118)
    at com.sun.proxy.$Proxy29.getFileInfo(Unknown Source)
    at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:800)
    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:498)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:422)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeMethod(RetryInvocationHandler.java:165)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invoke(RetryInvocationHandler.java:157)
    at org.apache.hadoop.io.retry.RetryInvocationHandler$Call.invokeOnce(RetryInvocationHandler.java:95)
    at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:359)
    at com.sun.proxy.$Proxy30.getFileInfo(Unknown Source)
    at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1652)
    at org.apache.hadoop.hdfs.DistributedFileSystem$29.doCall(DistributedFileSystem.java:1523)
    at org.apache.hadoop.hdfs.DistributedFileSystem$29.doCall(DistributedFileSystem.java:1520)
    at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
    at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1520)
    at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1627)
    at org.apache.hadoop.hive.ql.session.SessionState.createRootHDFSDir(SessionState.java:708)
    at org.apache.hadoop.hive.ql.session.SessionState.createSessionDirs(SessionState.java:654)
    at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:586)
    ... 9 more
Caused by: java.net.SocketException: Network is unreachable
    at sun.nio.ch.Net.connect0(Native Method)
    at sun.nio.ch.Net.connect(Net.java:454)
    at sun.nio.ch.Net.connect(Net.java:446)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
    at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:192)
    at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:531)
    at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:701)
    at org.apache.hadoop.ipc.Client$Connection.setupiostreams(Client.java:805)
    at org.apache.hadoop.ipc.Client$Connection.access$3700(Client.java:423)
    at org.apache.hadoop.ipc.Client.getConnection(Client.java:1601)
    at org.apache.hadoop.ipc.Client.call(Client.java:1432)
    ... 33 more

 解决方案:重启NetworkManager

[root@bigdata tmp]# systemctl restart NetworkManager
[root@bigdata tmp]# ping www.baidu.com
PING www.a.shifen.com (180.101.49.12) 56(84) bytes of data.
64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=1 ttl=52 time=11.1 ms

以上是关于重启虚拟机后,Hive无法启动,如何解决?的主要内容,如果未能解决你的问题,请参考以下文章

virtualbox安装虚拟机后,关机或重启出现重新安装

VMware克隆虚拟机后无法启动网卡

Virtual Box 复制虚拟机后网络冲突或者无法启动 问题解决方法

启动虚拟机后,不能为虚拟电脑打开一个新任务

克隆虚拟机后网卡无法启动(centOS),报以下错误,解决如下

VirtualBox复制虚拟机后丢失eth0网卡的解决办法