(6)二进制文件方式部署Kubernetes高可用集群----------安装Docker Engine

5 二进制文件安装Docker Engine

Doecker:统一的资源操作入口。这里,我们没有使用粗暴式的yum install docker安装而是使用二进制文件方式安装docker组件,虽然过程较复杂,但是有利于做定制化需求开发和故障排查。

 

5.1 下载tar包

下载tar包:

# wget https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz

tar解压,docker的二进制文件如下:

#tar xzvf docker-18.03.1-ce.tgz

(6)二进制文件方式部署Kubernetes高可用集群----------安装Docker Engine_第1张图片

二进制方式安装docker,需要将上述二进制文件放入/usr/bin目录下,这个时候我们需要配置一个服务启动文件才能够启动docker engine。

5.2 创建Docker服务启动文件

路径:/usr/lib/systemd/system

创建docker.service服务启动文件

[Unit]

Description=Docker Application Container Engine

Documentation=https://docs.docker.com

After=network.target firewalld.service

 

[Service]

Type=notify

# the default is not to use systemd for cgroups because the delegate issues still

# exists and systemd currently does not support the cgroup feature set required

# for containers run by docker

ExecStart=/usr/bin/dockerd

ExecReload=/bin/kill -s HUP $MAINPID

# Having non-zero Limit*s causes performance problems due to accounting overhead

# in the kernel. We recommend using cgroups to do container-local accounting.

LimitNOFILE=infinity

LimitNPROC=infinity

LimitCORE=infinity

# Uncomment TasksMax if your systemd version supports it.

# Only systemd 226 and above support this version.

#TasksMax=infinity

TimeoutStartSec=0

# set delegate yes so that systemd does not reset the cgroups of docker containers

Delegate=yes

# kill only the docker process, not all processes in the cgroup

KillMode=process

 

[Install]

WantedBy=multi-user.target

5.2 启动Docker

#systemctl daemon-reload

#systemctl enable docker

#systemctl start docker

#systemctl status docker

 

你可能感兴趣的:((6)二进制文件方式部署Kubernetes高可用集群----------安装Docker Engine)