Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Page Tree
expandCollapseAlltrue
root安全节点+超级节点搭建教程


Panel
borderColorgrey
bgColorwhite
titleColorblack
borderWidth1
titleBGColorwhite
borderStylesolid
titleLanguages


这是一个可选步骤,详细说明了如何指定节点主机名



描述指令
1

更新/ etc / hosts文件

    • 用您想要的主机名替换默认主机名
      • 默认主机名通常遵循“127.0.1.1”,不要替换“localhost”
      • 请参见粗体示例
      • 您可能需要像示例中那样禁用“manage_etc_hosts”
    • 使用CTRL + x保存并退出,然后键入y并按Enter键。


注意:在示例中,我使用“node01”作为主机名。 我使用与我的示例FQDN相同的主机名:

node01.zentest.win


Code Block
sudo nano /etc/hosts



Panel
borderColorgrey
bgColorblack
titleColorwhite
borderWidth2
titleBGColorblack
borderStylesolid
titleExample Output

# 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 文件

  • 用您想要的主机名替换现有的主机名


Code Block
sudo nano /etc/hostname



Panel
borderColorgrey
bgColorblack
titleColorwhite
borderWidth2
titleBGColorblack
borderStylesolid
titleExample Output

node01


3使用systemd服务设置主机名,将<HOSTNAME>替换为所需的主机名


Code Block
sudo hostnamectl set-hostname <HOSTNAME>



Panel
borderColorgrey
bgColorblack
titleColorwhite
borderWidth2
titleBGColorblack
borderStylesolid
titleExample Output

zenops@vps421337:~$ sudo hostnamectl set-hostname node01


4

重新引导节点并以非root用户身份重新登录,以测试主机名是否已更改

  • 您将在终端提示符下看到新的主机名


Code Block
sudo reboot



Panel
borderColorgrey
bgColorblack
titleColorwhite
borderWidth2
titleBGColorblack
borderStylesolid
titleExample Output

zenops@node01:~$



Insert excerpt
友情链接
友情链接
nopaneltrue