1.普通装机项

[root@localhost ~]# yum -y install sshpass vim gcc gcc-c++ make lsof autoconf tree openssh-clients createrepo lrzsz net-tools ncurses ncurses-devel unzip zlib-devel zlib openssl-devel openssl dos2unix libselinux-python lrzsz kernel-devel

2.内核优化

2.1 open file 调整
[root@localhost bin]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 3802
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 3802
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


[root@localhost bin]# echo -e "* soft nofile 10240\n* hard nofile 10240" >> /etc/security/limits.conf


redis内核优化
[root@localhost bin]# echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf
[root@localhost bin]# sysctl -p
[root@localhost bin]# echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@localhost bin]# echo never > /sys/kernel/mm/transparent_hugepage/defrag
调整系统tcp连接数
[root@localhost ~]# echo "net.core.somaxconn = 10240" >> /etc/sysctl.conf
[root@localhost ~]# sysctl -p
vm.overcommit_memory = 1
net.core.somaxconn = 10240

3.安装python3

[root@localhost ~]# tar xf Python-3.5.2.tgz -C /usr/src/
[root@localhost ~]# cd /usr/src/Python-3.5.2/
[root@localhost Python-3.5.2]# ./configure --prefix=/usr/local/python/
[root@localhost Python-3.5.2]# make && make install
[root@localhost Python-3.5.2]# ln -s /usr/local/python/bin/python3 /usr/bin/python3
[root@localhost Python-3.5.2]# python3 -V
Python 3.5.2

4.安装docker

4.1安装依赖包
[root@localhost ~]# yum -y install yum-utils device-mapper-persistent-data lvm2

4.2添加docker的CE版本的yum源配置文件
[root@localhost ~]# curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2424 100 2424 0 0 2594 0 --:--:-- --:--:-- --:--:-- 2592

[root@localhost ~]# ll /etc/yum.repos.d/docker-ce.repo
-rw-r--r--. 1 root root 2424 Sep 7 20:18 /etc/yum.repos.d/docker-ce.repo

4.3安装CE版本
[root@localhost ~]# yum -y install docker-ce
[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:23:03 2018
OS/Arch: linux/amd64
Experimental: false

Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:25:29 2018
OS/Arch: linux/amd64
Experimental: false