一、主机名
# hostname # vim /etc/hosts ip xxx.xxx.xx # cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=xxx.xxx.xx
二、ip地址固定
# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE="eth0" BOOTPROTO="static" DHCP_HOSTNAME="xx.xxx.xx" HOSTNAME="xxx.xx.xx" HWADDR="xx:xx:xx:xx:xx:xx" IPV6INIT="no" MTU="1500" NM_CONTROLLED="yes" ONBOOT="yes" TYPE="Ethernet" UUID="xxxx-xxx-xxx-xxx-xxxx" IPADDR=xx.xx.xx.xx GATEWAY=xx.xx.x.x NETMASK=255.255.255.0
三、时区、时间同步
# date -R Fri, 10 Feb 2017 04:37:15 -0500 # cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime # date -R Fri, 10 Feb 2017 17:41:17 +0800 # yum install ntpdate --nogpgcheck -y # crontab -l 10 * * * * /usr/sbin/ntpdate xx.xxx.xx.xxx # reboot 重启生效
四、磁盘和目录规划
时间: 2024-10-17 15:37:03