First, the preparatory work:1, create three virtual machines: (in NODE1 configuration environment, and then shut down the clone Node2, Node3, and modify the network card, host name can be)Linux-node1.example.com 192.168.43.21linux-node2.example.com 192.168.43.22linux-node3.example.com 192.168.43.23 setting hostname: [[email protected] ~]# Hostnamectl set-hostname linux-node1.example.com2. Configure IP:[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-ens32type=ethernetbootproto=staticname=ens32device =ens32onboot=yesipaddr=192.168.43.21netmask=255.255.255.0gateway=192.168.43.2dns1=192.168.43.23. Close NetworkManager, FIREWALLD, SELinux, etc.[Email protected] ~]# systemctl disable networkmanager[[email protected] ~]# systemctl disable Firewalld[[email protecte D] ~]# vim/etc/selinux/config---->selinux=enforcing4. Set hostname Resolution:[Email protected] ~]# cat/etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.43.21 linux-node1 linux-node1.example.com192.168.43.22 Linux-node2 linux-node2.example.com192.168.43.23 Linux-node3 Linux-node3.example.com5. Install Epel extension source and common commands[Email protected] ~]# RPM-IVHhttp://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm[email protected] ~]# Yum install-y net-tools vim lrzsz tree screenlsof tcpdumpnc mtr nmap6. Installing Docker[Email protected] ~]# cd/etc/yum.repos.d/[[email protected] yum.repos.d]# wgetHttps://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo[[email protected] yum.repos.d]# yum install-y docker-ce[[email protected] yum.repos.d]# systemctl start Docker[[email PR Otected] yum.repos.d]# Systemctl enabled Docker7. Create a deployment directory[[email protected] ~]# mkdir-p/opt/kubernetes/{cfg,bin,ssl,log} #cfg存放配置文件; bin holds binaries; SSL holds certificate files; log files are stored.8, Shutdown---Clone two linux-node2, linux-node3 and modify the hostname, network cardLinux-node2:[[email protected] ~]# shutdown-h now[[email protected] ~]# hostnamectl set-hostname Linux-node2.example.com #修改主机名 [[email protected] ~]# su-[[email protected] ~]# hostnamectlstatic hostname: Linux-node2.example.comicon name:computer-vmchassis:vmmachine id:09bb654cb3f7445e9a9abd9dd32b9e2cboot ID: 939c901cfa7246dda1e90946ac6f3b08virtualization:vmwareoperating System:centos Linux 7 (Core) CPE OS Name:cpe:/o:centos : Centos:7kernel:linux 3.10.0-693.el7.x86_64architecture:x86-64[[email protected] ~]# cat/etc/sysconfig/ Network-scripts/ifcfg-ens32type=ethernetbootproto=staticname=ens32device=ens32onboot=yesipaddr= 192.168.43.22netmask=255.255.255.0gateway=192.168.43.2dns1=192.168.43.2 linux-node3:[[email Protected] ~]# hostnamectl set-hostname linux-node3.example.com #修改主机名 [[email protected] ~]# su-[[email Protected] ~]# hostnamectlstatic hostname:linux-node3.example.comicon name:computer-vmchassis:vmmachine ID: 09bb654cb3f7445e9a9abd9dd32b9e2cboot id:939c901cfa7246dda1e90946ac6f3b08virtualization:vmwareoperating System:centos Linux 7 ( Core) CPE OS name:cpe:/o:centos:centos:7kernel:linux 3.10.0-693.el7.x86_64architecture:x86-64[[email Protected] ~]# cat/etc/sysconfig/network-scripts/ifcfg-ens32type=ethernetbootproto=staticname=ens32device= ens32onboot=yesipaddr=192.168.43.23netmask=255.255.255.0gateway=192.168.43.2dns1=192.168.43.2
Centos7 Deployment Kubernetes Preparation (i)