java.net.UnknownHostException: master

1:如果你报这个错误,第一反应应该是本地的host文件没有配置服务器名称和对应的ip地址,这个反应就对了。贴一下错误和解决方法:

 1 java.net.UnknownHostException: master
 2     at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
 3     at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
 4     at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
 5     at java.net.InetAddress.getAllByName0(Unknown Source)
 6     at java.net.InetAddress.getAllByName(Unknown Source)
 7     at java.net.InetAddress.getAllByName(Unknown Source)
 8     at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:60)
 9     at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
10     at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
11     at com.bie.lesson01.ZookeeperClient.init(ZookeeperClient.java:35)
12     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
14     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
15     at java.lang.reflect.Method.invoke(Unknown Source)
16     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
17     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
18     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
19     at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
20     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
21     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
22     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
23     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
24     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
25     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
26     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
27     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
28     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
29     at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
30     at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
31     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
32     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
33     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
34     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

windows下开发大数据相关的应用程序,HBase部署在linux环境中,在运行调试时可能会出现无法找到主机,类似异常信息如上所贴:
解决办法如下:
在C:\WINDOWS\system32\drivers\etc\hosts文件末尾添加如下信息:

192.168.199.130 master
192.168.199.131 slaver1
192.168.199.132 slaver2
192.168.199.133 slaver3
192.168.199.134 slaver4
192.168.199.135 slaver5
192.168.199.136 slaver6

停更......

2017-11-18 17:08:50

时间: 2024-11-03 09:47:40

java.net.UnknownHostException: master的相关文章

一脸懵逼加从入门到绝望学习hadoop之Caused by: java.net.UnknownHostException: master报错

windows下开发hadoop应用程序,hadoop部署在linux环境中, 在运行调试时可能会出现无法找到主机,类似异常信息如下: java.net.UnknownHostException: unknown host: master 解决办法如下: 在C:\WINDOWS\system32\drivers\etc\hosts文件中添加如下信息: 192.168.0.55 master 即把自己的虚拟机的ip地址和对应的虚拟机主机名添加一下,解决java.net.UnknownHostExc

微信企业号调用接口时java.net.UnknownHostException: qyapi.weixin.qq.com

问题描述 微信企业号调用接口时java.net.UnknownHostException: qyapi.weixin.qq.com 企业号开发时,偶尔出现这种异常,过一段时间又好使了,不知道是代码问题?网络问题? 解决方案 网络不行,dns解析失败.建议你改hosts文件,绑定域名,而不通过dns解析.

android程序连接网络错误:java.net.unknownhostexception:unable to resolve host

从网上拿了一个android的天气预报程序来学习,最后run的时候发现提示下面的错误: 按我的调试过程分2步,都是有关网络访问方面的问题. 第一个错误: android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099) ...... 原因:是涉及到url操作的时候,访问网络不能在主程序中运行 解决:参考[http://ge

javaweb-HttpURLConnection出现 java.net.UnknownHostException

问题描述 HttpURLConnection出现 java.net.UnknownHostException HttpURLConnection偶尔会出现 java.net.UnknownHostException,这是为什么呢,怎么解决这个问题? 解决方案 我也喷到过 如果是linux 系统下 vi /etc/hosts 解决方案二: http://blog.csdn.net/zhufuing/article/details/8146667 解决方案三: http://omyyal.iteye

H2数据库在linux:Java.net.UnknownHostException: nfsserver: nfsserver: unknown er

问题描述 最近需要部署一个项目到linux上,用的H2数据库,好坑爹的说.....配置完后,执行sh./h2.sh启动:出错:Exceptioninthread"main"org.h2.jdbc.JdbcSQLException:IOException:"java.net.UnknownHostException:nfsserver:nfsserver:unknownerror"[90028-186]atorg.h2.message.DbException.getJ

java.net.UnknownHostException: xxxxxx.com

问题描述 我用httpclient服务器写了个程序抓取网站数据,没十分钟抓取一次,但是刚开始好好的,后面就出现了java.net.UnknownHostException:xxxxxx.com这个错误,连接不上网络了,我在其他机子上运行没问题的

java.net.UnknownHostException: XXX.XXX Android

android开发   OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());   这步的时候抛出异常: java.net.UnknownHostException: api.kaixin001.com   解决方法: http://eliasbland.wordpress.com/2011/02/22/java-net-unknownhostexception-on-android-a-list-of-po

java.net.UnknownHostException和javax.mail.MessagingException的问题

问题描述 javax.mail.MessagingException:UnknownSMTPhost:mail02.secpg.com;nestedexceptionis:java.net.UnknownHostException:mail02.secpg.comatcom.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1225)atcom.sun.mail.smtp.SMTPTransport.protocolConnect

eclipse开发Hbase的一个小程序,但是出现下面一些问题,请求大神赐教

问题描述 eclipse开发Hbase的一个小程序,但是出现下面一些问题,请求大神赐教 代码: import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import