我想在两台笔记本电脑之间建立一个MPI集群。所以我需要通过ssh连接它。我关注这个链接:https://help.ubuntu.com/community/MpichCluster来完成它。但在此之前,我需要将另一台笔记本电脑的IP地址添加到我已知的主机中。当我用谷歌搜索它时,我知道我需要使用超级用户权限手动编辑/etc/hosts文件(就像在文本编辑器中所做的那样)。但我担心手动更改它。谁能告诉我如何添加主机,以便我可以继续我的项目。
以下是我的/etc/hosts文件的内容:
127.0.0.1 localhost
127.0.1.1 shabhri-HP-Pavilion-15-Notebook-PC
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters发布于 2014-02-06 10:57:17
您只需在第一部分的末尾添加新主机及其IP地址。所以它看起来像这样:
127.0.0.1 localhost
127.0.1.1 shabhri-HP-Pavilion-15-Notebook-PC
192.168.0.2 otherlaptop
192.168.0.3 laptopnumber3
...etc...
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters发布于 2014-02-06 22:13:22
只需使用您喜欢的文本编辑器打开host文件,并将host文件中连接的主机(Host IP空间hostname)条目添加到文件的末尾。
无需担心主机问题
https://stackoverflow.com/questions/21592680
复制相似问题