jenkins部署-centos-系统配置

54 篇文章 0 订阅
44 篇文章 0 订阅

jenkins部署-centos

一:系统基础配置

cat > /etc/sysctl.conf

net.bridge.bridge-nf-call-iptables=1

net.bridge.bridge-nf-call-ip6tables=1

net.ipv4.ip_forward=1

vm.swappiness=0

vm.overcommit_memory=1

vm.max_map_count=655360

fs.file-max=655360

net.core.somaxconn=1024

vm.panic_on_oom=0

fs.inotify.max_user_instances=8192

fs.inotify.max_user_watches=1048576

fs.nr_open=52706963

net.ipv6.conf.all.disable_ipv6=1

net.netfilter.nf_conntrack_max=2310720

EOF

cat > /etc/security/limits.conf

* soft nofile 65536

* hard nofile 65535

* soft nproc 65536

* hard nproc 65536

EOF

#更新系统仓库

yum install -y wget

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup_date +%Y%m%d%H%M%S

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all

yum makecache

#关闭swap

swapoff -a

sed -i /^[^#]swap/s/^/#/g /etc/fstab

sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

#升级内核

rpm -ivh https://rainbond-pkg.oss-cn-shanghai.aliyuncs.com/offline/yum/kernel-ml-5.12.12-1.el7.elrepo.x86_64.rpm

awk -F' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

grub2-set-default 0

#配置时间

timedatectl set-timezone Asia/Shanghai

timedatectl status

yum install -y chrony

systemctl enable chronyd

sed -i '/server 0.centos.pool.ntp.org/a \server ntp1.aliyun.com' /etc/chrony.conf

sed -i '/centos.pool.ntp.org/d' /etc/chrony.conf

systemctl restart chronyd

systemctl status chronyd

timedatectl status

systemctl disable firewalld

systemctl stop firewalld

systemctl status firewalld

#必要重启机器

reboot

#安装部署docker

yum install -y yum-utils

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

yum install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin

systemctl start docker

systemctl enable docker

#配置docker启动配置

mkdir -p /etc/docker

cat /etc/docker/daemon.json

{

"exec-opts": ["native.cgroupdriver=systemd"],

"log-driver": "json-file",

"log-opts": {

"max-size": "50m",

"max-file": "3"

},

"storage-driver": "overlay2",

"storage-opts": [

"overlay2.override_kernel_check=true"

],

"metrics-addr" : "0.0.0.0:9323",

"experimental" : true,

"insecure-registries" : ["harbor.petroglory.com"]

}

EOF

systemctl restart docker

docker ps

timedatectl status

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lisanmengmeng

蚊子腿也是肉

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值