系统配置 - Linux配置
Linux: Debian 9.11 系统配置: 4G RAM, 20G Storage
# ⚙️ 配置静态地址
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug ens33
auto ens33
iface ens33 inet static
address 192.168.88.100
netmask 255.255.255.0
gateway 192.168.88.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 💿 配置apt镜像源
# 使用 https://mirrors.xxx.com 替换 http://deb.debian.org
sed -i "s@http://deb.debian.org@https://mirrors.xxx.com@g" /etc/apt/sources.list
# 若要使用https源,则需要安装apt-transport-https
apt-get install apt-transport-https
# 再更新索引
apt-get update
1
2
3
4
5
6
7
2
3
4
5
6
7
# 🎹 安装Docker
参考15.自动运维 - 自动化脚本中的Docker安装
执行sh脚本时出现权限不够,可执行该命令进行授权
chmod +x *.sh
1
# 将普通用户加入docker组
将普通用户加入docker group,是该用户拥有执行docker命令的权限
# 添加对应用户到docker group
$ usermod -G docker ocean
# 重启 docker 服务
$ systemctl restart docker
# 或
$ service docker restart
1
2
3
4
5
6
7
2
3
4
5
6
7
然后退出当前session(会话),重新连接ssh
# 搭建mysql
[TODO] 待输出为文档
- 搭建Mysql:https://www.cnblogs.com/hu308830232/p/15211720.html
docker run -p 3306:3306 --restart=always --privileged=true --name mysql -v $PWD/0-data/1-DockerContainer/mysql/conf:/etc/mysql/conf.d -v $PWD/2-cache/0-DockerContainer/logs/mysql:/logs -v $PWD/0-data/1-DockerContainer/mysql/conf:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=XZsa21@! -d mysql:latest
1
# 🌳 卸载Apache2
# 卸载命令
$ apt-get --purge remove apache2
$ apt-get --purge remove apache2-doc
$ apt-get --purge remove apache2-utils
# 检测是否卸载干净
dpkg -l | grep apache2
# 删除多余的文件
$ find /etc -name "*apache*" |xargs rm -rf
$ rm -rf /var/www
$ rm -rf /etc/libapache2-mod-jk
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# 🇯🇪 配置Jenkins
日志路径: /var/log/jenkins/jenkins.log
# 卸载 Jenkins
# 完全卸载Jenkins
apt --purge remove jenkins
# 删除配置文件(可选)
rm /etc/default/jenkins
1
2
3
4
2
3
4
# 🐸 部署artifactory
docker run \
--name artifactory \
-d \
-p 8080:8080 -p 8081:8081 -p 8082:8082 \
releases-docker.jfrog.io/jfrog/artifactory-jcr:latest
docker pull releases-docker.jfrog.io/jfrog/artifactory-jcr:latest
docker run \
--name artifactory \
-d \
-p 8081:8081 -p 8082:8082 \
goodrainapps/artifactory-oss:latest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ꅹ 部署 nexus
$ docker run -d --name nexus3 --privileged=true --restart=always -v $PWD/nexus/data:/nexus-data sonatype/nexus3:latest
$ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=/some-other-dir" sonatype/nexus3
1
2
3
4
2
3
4
# 🙋♂️ Issues
上次更新: 2022/03/08, 06:03:00