Linux下变化的主机名gpdb
步骤1、执行vi /etc/sysconfig/network命令
NETWORKING=yes
HOSTNAME=gpdb
第二步、执行hostname gpdb令
步骤三、执行vi /etc/hosts命令
192.168.1.121 gpdb # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost
::1 gpdb localhost6.localdomain6 localhost6
步骤四、执行reboot命令又一次启动电脑后或者使用service network restart命令又一次启动网络服务后生效
改动前的/etc/sysconfig/network文件默认内容为
NETWORKING=yes
HOSTNAME=bogon
改动前下的/etc/hosts文件默认内容为
192.168.1.121 bogon # Added by NetworkManager
127.0.0.1 localhost.localdomain localhost
::1 bogon localhost6.localdomain6 localhost6
时间: 2024-12-21 11:23:38