环境部署:VMware10.0+CentOS6.9(64位)+MySQL5.7.19(64位)
一、操作系统调整

# 更改时区
1、先查看时区
[root@localhost ~]# date -R
Tue, 29 Aug 2017 20:13:00 -0700
2、将Asia/shanghai-上海时区写入当前时区
[root@localhost ~]# cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
cp: overwrite '/etc/localtime'? y
3、再次查看时区
[root@localhost ~]# date -R
Wed, 30 Aug 2017 11:14:24 +0800

# 更改主机名
1、原主机名
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-696.el6.x86_64 #1 SMP Tue Mar 21 19:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# hostname
localhost.localdomain
2、先备份原文件再修改
[root@localhost ~]# cp /etc/sysconfig/network /etc/sysconfig/network.`date +%Y%m%d.%H%M%S`
[root@localhost ~]# ll /etc/sysconfig |grep network
-rw-r--r--. 1 root root   46 Aug 30  2017 network
-rw-r--r--. 1 root root   46 Aug 30 11:21 network.20170830.112114
drwxr-xr-x. 4 root root 4096 May 11  2016 networking
drwxr-xr-x. 2 root root 4096 Aug 30  2017 network-scripts
[root@localhost ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=ZST1
[root@localhost ~]#
[root@localhost ~]# cp /etc/hosts /etc/hosts.`date +%Y%m%d.%H%M%S`
[root@localhost ~]# vim /etc/hosts
#添加记录,不要修改默认的127.0.0.1跟::1的记录,其他的系统服务会使用到的
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.85.132 ZST1
192.168.85.133 ZST2
192.168.85.134 ZST3
[root@localhost ~]#

# 设定linux运行级别为3(文本模式)
1、查看当前运行的模式
[root@localhost ~]# runlevel
N 5
2、设定linux运行级别为3
[root@localhost ~]# vim /etc/inittab
id:3:initdefault:
3、重启服务器
[root@localhost ~]# reboot
View Code

相关文章:

  • 2021-12-22
  • 2021-11-29
  • 2021-09-12
  • 2021-06-30
  • 2022-02-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2022-02-20
  • 2021-08-16
  • 2021-08-19
相关资源
相似解决方案