Captain's Geek-Island Captain's Geek-Island
首页
生活如斯乎
架构师的路
  • 分类
  • 标签
  • 归档
沉洋官网 (opens new window)

SleepyOcean

走,找新大陆去
首页
生活如斯乎
架构师的路
  • 分类
  • 标签
  • 归档
沉洋官网 (opens new window)
  • 计算机基础

  • 并发专题

  • 性能调优专题

  • 工具专题

  • 源码框架专题

  • 设计模式

  • 分布式专题

  • 实战专题

  • 技术杂文

  • 云原生专题

  • 大数据分析专题

  • 前端专题

  • 运维专题

    • Linux基础 - 基础知识
    • Linux基础 - 命令手册
    • Windows 命令行配置代理
    • 自动运维 - 自动化脚本
    • 自动运维 - 配置自动化
    • 系统安装 - Win10安装教程
    • 系统配置 - MacOS配置
    • 系统配置 - Linux配置
      • ⚙️ 配置静态地址
      • 💿 配置apt镜像源
      • 🎹 安装Docker
        • 将普通用户加入docker组
        • 搭建mysql
      • 🌳 卸载Apache2
      • 🇯🇪 配置Jenkins
        • 卸载 Jenkins
      • 🐸 部署artifactory
      • ꅹ 部署 nexus
      • 🙋‍♂️ Issues
    • 系统配置 - Android TV配置
    • 独门秘技 - 激活手册
  • 经验专题

  • 面试专题

  • 软实力专题

  • 架构师的路
  • 运维专题
SleepyOcean
2021-12-31

系统配置 - 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

# 💿 配置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

# 🎹 安装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

然后退出当前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

# 🇯🇪 配置Jenkins

日志路径: /var/log/jenkins/jenkins.log

# 卸载 Jenkins

# 完全卸载Jenkins
apt --purge remove jenkins
# 删除配置文件(可选)
rm /etc/default/jenkins
1
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

# ꅹ 部署 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

# 🙋‍♂️ Issues

#Linux #系统安装
上次更新: 2022/03/08, 06:03:00

← 系统配置 - MacOS配置 系统配置 - Android TV配置 →

新鲜出炉
01
记录 - 快速搭建自动化部署平台
04-13
02
Docker搭建各类Paas服务
03-01
03
系统配置 - Android TV配置
02-12
更多文章>
Copyright © 2019-2022 SleepyOcean | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式