标签 centos 下的文章

docker就不多说了,按照贴出的代码一步一步就可以安装成功

# 删除
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

# 安装依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

# 开启ce
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

# 使用阿里的加速
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 安装
sudo yum install -y docker-ce docker-ce-cli containerd.io

# 开启服务
sudo systemctl enable docker
sudo systemctl start docker

# 添加组
sudo groupadd docker
sudo usermod -aG docker ${USER}

# 重新登录
logout

安装完docker,最好改为国内镜像,https://registry.docker-cn.com是docker公司专门为国内用户准备的!

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF

sudo systemctl daemon-reload
sudo systemctl restart docker

docker-compose就不多说了,赶紧装起来

方法1:

sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

方法2:

sudo yum install -y epel-release
sudo yum install -y python-pip
pip install -i https://pypi.doubanio.com/simple/ --upgrade pip docker-compose

一些常用的加速资源

docker run -it --rm=true --name=test alpine:3.9 ash

sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/alpine/g' /etc/apk/repositories

npm config set registry https://registry.npm.taobao.org/
composer config -g repo.packagist composer https://packagist.phpcomposer.com
pip install -i https://mirrors.aliyun.com/pypi/simple --upgrade pip docker-compose
pip install -i https://pypi.doubanio.com/simple/ --upgrade pip docker-compose
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

k8s

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubelet kubeadm kubectl
systemctl enable kubelet && systemctl start kubelet

LDAP是轻量目录访问协议,这个服务从老高进入360就一直在用,LDAP带来的好处真的是很多,你可以把它想象成为一个内网版的单点登录服务,可以让你使用同一组账户密码访问所有支持LDAP验证的系统,为企业的内部运维带来了极大的便利。

不过想要自己独立搭建一个LDAP服务还是挺麻烦的!不过一旦搭建好了LDAP服务器,剩下的管理和运维就简单多了。

- 阅读剩余部分 -

新安装的centos7系统可以使用下面的安装脚本一键安装$$,如果嫌复制粘贴麻烦,可以到脚本地址下载

安装命令

sh -c "$(curl -fsSL https://raw.githubusercontent.com/phpgao/my_scripts/master/code/ss_for_centos.sh)"

# 或者

sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/phpgao/my_scripts/master/code/ss_for_centos.sh)"

安装完毕后查看ss配置

cat /etc/ss-config.json

查看kcptun配置

/etc/kcp-config.json

如果想要修改,使用vi命令即可。修改完记得重启服务才能生效!

# 重启ss服务
systemctl restart shadowsocks-server

# 重启kcptun服务
systemctl restart kcp-server

- 阅读剩余部分 -