Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 2
Next »
| 描述 | 指令 |
---|
1 | 更新/ etc / hosts文件 - 用您想要的主机名替换默认主机名
- 默认主机名通常遵循“127.0.1.1”,不要替换“localhost”
- 请参见粗体示例
- 您可能需要像示例中那样禁用“manage_etc_hosts”
- 使用CTRL + x保存并退出,然后键入y并按Enter键。
注意:在示例中,我使用“node01”作为主机名。 我使用与我的示例FQDN相同的主机名: node01.zentest.win |
# Your system has configured 'manage_etc_hosts' as True. # As a result, if you wish for changes to this file to persist # then you will need to either # a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl # b.) change or remove the value of 'manage_etc_hosts' in #......./etc/cloud/cloud.cfg or cloud-config from user-data 127.0.1.1 node01 127.0.0.1 localhost # 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 ff02::3 ip6-allhosts
|
2 | 升级/etc/hostname 文件 | |
3 | 使用systemd服务设置主机名,将<HOSTNAME>替换为所需的主机名 |
sudo hostnamectl set-hostname <HOSTNAME>
zenops@vps421337:~$ sudo hostnamectl set-hostname node01
|
4 | 重新引导节点并以非root用户身份重新登录,以测试主机名是否已更改 | |
© 2019 Horizen. All rights reserved.