K8s deployment environment to build a cluster of single-node installation and etcd

And a single-node environment to build installation etcd

Prior to the installation environment to build

Before performing the installation k8s first virtual machine ready, ready here is three virtual machines

CPU name ip address Character
master 172.16.163.131 master
node1 172.16.163.130 node
node2 172.16.163.129 node

Followed by the deployment environment

The first step: Turn off the firewall

//在master虚拟机上执行以下命令
systemctl stop firewalld
systemctl disable firewalld
//在另外node1,node2虚拟机上也执行以上命令

Step two: Turn off selinux

//执行命令
vi /etc/selinux/config

The third step: Turn off the postfix service

//执行命令
systemctl stop postfix.service
systemctl disable postfix.service

Step four: be host to resolve

//执行命令
vi /etc/hosts

That is, the node node and the master node for resolution. This parsing files, each node needs one. So it is necessary to use scp to copy the past hosts file.

scp -rp /etc/hosts 172.16.163.130:/etc/hosts
scp -rp /etc/hosts 172.16.163.129:/etc/hosts

It took more than four steps to build a good environment, now start the installation etcd service.

ETCD service is only installed on the master node, the service performed ETCD mounted on the master node, ETCD for maintaining data consistency, it is a key-value storage system.

//执行命令
yum install etcd -y
//成功过后,执行命令
vi /etc/etcd/etcd.conf

Etcd.conf modify profile information, the main change listen address.

2379 is the port number etcd external services used.

2380 is the port number synchronize data between the use of cluster etcd

= Above figure etcd_advertise_client_urls " http://172.16.163.131" ip address is a master

Start etcd Service

//执行命令,让etcd服务开机自启动
systemctl start etcd.service
systemctl enable etcd.service
//执行命令,查看版本号,如果出现etcd版本号即表示安装成功
etcdctl -version

//执行命令查看端口
netstat -lntup

etcd node installation.

Guess you like

Origin www.cnblogs.com/jasonboren/p/11483433.html