建立Centos7虚拟机一台,设置hostname 为 hadoop100。
Windows10 设置 C:\Windows\System32\drivers\etc 中的hosts文件 ,
开始看到这个文件夹中没有这个文件,
百度用命令(for /f %P in ('dir %windir%\WinSxS\hosts /b /s') do copy %P %windir%\System32\drivers\etc & echo %P & Notepad %P),
生成了一个hosts文件。
然后修改其中配置如下 :
Copyright (c) 1993-2009 Microsoft Corp.
This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
This file contains the mappings of IP addreses to host names. Each
entry should be kept on an individual line. The IP addres should
be placed in the first column followed by the corresponding host name.
The IP addres and the host name should be separated by at least one
space.
Additionally, comments (such as these) may be inserted on individual
lines or following the machine name denoted by a '#' symbol.
For example:
102.54.94.97 rhino.acme.com # source server
38.25.63.10 x.acme.com # x client host
localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
192.168.10.100 hadoop100 【此行为我添加的,其他都是文件自带的,100和 hadoop100中间是空格】
用Xshell 连接此IP虚拟机,用 192.168.10.100 作为IP 可正常连接。改为hadoop100缺无法连接 ,报错【Unable to resolve host 'hadoop100'】
然后启动CMD,输入命令 ping hadoop100 ,报错【Ping 请求找不到主机 hadoop100。请检查该名称,然后重试。】
百度尝试过
1)刷新本地的DNS缓存数据 ipconfig /flushdns
2)清空缓存 netsh winsock reset ,重启机器。
均无法解决此问题。
请道友襄助,到底如何才能让windows解析hadoop成功 。抱拳了~!!