(1)主机名配置
hostnamectl set-hostname gitlab-server
hostnamectl set-hostname jenkins-server
hostnamectl set-hostname harbor-server
hostnamectl set-hostname web-server
(2)ip地址配置(静态)
查看ip
ip a
vim /etc/sysconfig/network-scripts/ifcfg-ens33
cat /etc/sysconfig/network-scripts/ifcfg-ens33
BOOTPROTO="static" 配置为静态IP
IPADDR=192.168.19.128
PREFIX=24
GATEWAY=192.168.19.2
DNS1=8.8.8.8
DNS2=114.114.114.114
重启网络
systemctl restart network.service
BOOTPROTO="static" 配置为静态IP
IPADDR=192.168.19.129
PREFIX=24
GATEWAY=192.168.19.2
DNS1=8.8.8.8
DNS2=114.114.114.114
重启网络
systemctl restart network.service
BOOTPROTO="static" 配置为静态IP
IPADDR=192.168.19.130
PREFIX=24
GATEWAY=192.168.19.2
DNS1=8.8.8.8
DNS2=114.114.114.114
重启网络
systemctl restart network.service
BOOTPROTO="static" 配置为静态IP
IPADDR=192.168.19.131
PREFIX=24
GATEWAY=192.168.19.2
DNS1=8.8.8.8
DNS2=114.114.114.114
重启网络
systemctl restart network.service
多个ip问题解决:
解决:将配置文件中的BOOTPROTO的值改成static,重启网卡就可以了
systemctl restart network
(3)主机名和ip地址解析配置
vim /etc/hosts
cat /etc/hosts
192.168.19.128 gitlab-server
192.168.19.129 jenkins-server
192.168.19.130 harbor-server
192.168.19.131 web-server
(4)防火墙禁用
systemctl stop firewalld;systemctl disable firewalld
firewall-cmd --state
(5)SELinux禁用
vim /etc/sysconfig/selinux
将SELINUX=enforcing指令更改为SELINUX=disabled
sestatus
(6)时间同步
crontab -l
crontab -e
0 */1 * * * ntpdate time1.aliyun.com
说明:分时日月周