Failed to obtain address information for hostname mynode1: Name or service not known

2083人阅读 评论(0) 收藏 举报
分类:
启动mongodb的时候报以下错,意思是获取不到地址对应的主机名,这一般与HOSTS有关

Failed to obtain address information for hostname mynode1: Name or service not known

2016-05-19T15:18:53.339+0800 I CONTROL  [initandlisten] MongoDB starting : pid=16871 port=27017 dbpath=/data/db 64-bit host=mdb
2016-05-19T15:18:53.340+0800 I CONTROL  [initandlisten] db version v3.2.3
2016-05-19T15:18:53.340+0800 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-05-19T15:18:53.340+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-05-19T15:18:53.340+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2016-05-19T15:18:53.340+0800 I CONTROL  [initandlisten] modules: none
2016-05-19T15:18:53.856+0800 I CONTROL  [initandlisten] 2016-05-19T15:18:53.856+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-05-19T15:18:53.856+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-05-19T15:18:53.856+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-05-19T15:18:53.856+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-05-19T15:18:53.856+0800 I CONTROL  [initandlisten] 
2016-05-19T15:18:53.859+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-05-19T15:18:53.860+0800 I NETWORK  [initandlisten] waiting for connections on port 27017
2016-05-19T15:18:53.860+0800 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-05-19T15:18:53.918+0800 W NETWORK  [HostnameCanonicalizationWorker] Failed to obtain address information for hostname mynode1: Name or service not known

首先检查hosts文件,看是否有服务器IP地址对应的主机名

[root@w ~]# more /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

发现没有地址对应的主机名,手动添加以下条目

192.168.10.10  mdb

再次重新启动mongodb,错误消失,看来mongodb启动需要解析hosts,这点与oracle RAC 有点类似,Mark一下
# nohup ./mongod > mongo.out &
# tail -50 mongo.out
2016-05-19T16:56:24.685+0800 I CONTROL  [initandlisten] MongoDB starting : pid=22471 port=27017 dbpath=/data/db 64-bit host=mdb
2016-05-19T16:56:24.686+0800 I CONTROL  [initandlisten] db version v3.2.3
2016-05-19T16:56:24.686+0800 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
2016-05-19T16:56:24.686+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
2016-05-19T16:56:24.686+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2016-05-19T16:56:24.686+0800 I CONTROL  [initandlisten] modules: none
2016-05-19T16:56:25.176+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2016-05-19T16:56:25.176+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-05-19T16:56:25.176+0800 I CONTROL  [initandlisten] 
2016-05-19T16:56:25.176+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2016-05-19T16:56:25.176+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2016-05-19T16:56:25.176+0800 I CONTROL  [initandlisten] 
2016-05-19T16:56:25.179+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-05-19T16:56:25.180+0800 I NETWORK  [initandlisten] waiting for connections on port 27017
2016-05-19T16:56:25.180+0800 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker

查看评论

Could not resolve hostname 。。。。。。: Name or service not known

这个是ssh基本操作的连接,当你配置完ssh之后,然后明明是正确的,然后你使用命令: ssh  localhost然后出现了 Could not resolve hostname github...
  • u012965373
  • u012965373
  • 2015年04月29日 10:16
  • 8922

Could not resolve hostname hadoop.master: Name or service not known

[root@localhost ~]# start-dfs.sh 16/08/15 00:19:20 WARN util.NativeCodeLoader: Unable to load native...
  • lglglgl
  • lglglgl
  • 2016年08月15日 12:25
  • 2727

(新手)解决Hadoop安装完毕后的启动报错 ssh: Could not resolve hostname Java: Name or service not known

环境: CentOS 6.5(64bit) JDK1.7.0_79(64bit) Hadoop-2.4.1 问题描述: 安装时无异常,cd到sbin目录下启动start-dfs.sh时控制台...
  • trackal
  • trackal
  • 2016年07月08日 17:12
  • 2338

dubbo启动报错 java.net.UnknownHostException: bogon: bogon: Name or service not known

客户端启动报UnknownHostException异常: 复制代码 Caused by: java.lang.RuntimeException: get localhost fail      ...
  • a304507016
  • a304507016
  • 2016年07月04日 15:08
  • 7213

Linux-SSH报错:Could not resolve hostname node1: Name or service not know

Could not resolve hostname node1: Name or service not know搭建集群的时候,使用ssh + 主机名 报错。 这个时候我已经修改了错误前配置:/...
  • qq_16018407
  • qq_16018407
  • 2016年10月31日 14:05
  • 11716

ssh: Could not resolve hostname devsrv: Name or service not known

ubuntu下 scp时出错:ssh: Could not resolve hostname devsrv: Name or service not known解决方法:需要将devsrv对应的ip加...
  • heihuifeng
  • heihuifeng
  • 2011年07月06日 16:22
  • 90892

MongoDB:[HostnameCanonicalizationWorker] Failed to obtain address information for hostname

MongoDB一直用的好好的,突然报错[HostnameCanonicalizationWorker] Failed to obtain address information for hostnam...
  • suzhi921
  • suzhi921
  • 2016年06月04日 14:27
  • 1446

git错误--ssh: Could not resolve hostname ssh.github.com: Name or service not known--解决方式

错误如下: git push origin ssh: Could not resolve hostname ssh.github.com: Name or service not known f...
  • piaotiejun
  • piaotiejun
  • 2015年09月25日 15:52
  • 34743

ssh: Could not resolve hostname问题终于解决了。

1、如果系统为64位,无法启动启动hdfs: ./sbin/start-dfs.sh。并有以下错误: [html] view plaincopy ...
  • u011617131
  • u011617131
  • 2014年04月29日 22:59
  • 18870

启动hadoop时:Name or service not knownstname

今天在启动hadoop时遇到Name or service not knownstname这样的错误 [root@poseidon01 hadoop]# start-dfs.sh 16/10/26 ...
  • gua___gua
  • gua___gua
  • 2016年10月26日 19:50
  • 1845
    个人资料
    持之以恒
    等级:
    访问量: 85万+
    积分: 9306
    排名: 2483
    简介
    此博客为笔者的DT工作记录,欢迎一起交流学习工作中的点滴,若博客文章观点存在原理的错误、纰漏,笔者非常欢迎各位不保留地指出
    最新评论