/images/avatar.jpeg

_浅行

Maven 多仓库配置

maven 多仓库配置需要在 profile 节点进行配置,配置方法如下: 编辑 maven 配置文件 settings.xml 添加如下配置 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

Docker Compose 网络配置

Docker Compose 提供了一种方便的方式来配置网络,本文档将介绍 Docker Compose 的网络相关配置 Docker 官方文档: https://docs.docker.com/compose/compose-file/05-services/#network_mode https://docs.docker.com/compose/compose-file/06-networks 默认网络Docker Compose 默认会创建一个以 项目名_defaul

使用 Nexus3 部署 maven 私服

部署 nexus3使用容器方式部署 nexus3, docker 镜像站点 准备 docker-compose.yaml 文件 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 mkdir /opt/nexus3 cd /opt/nexus3 cat >docker-compose.yaml<<EOF version: '2.10.2' services: nexus3: image: sonatype/nexus3:3.42.0 container_name: nexus3 restart: always volumes: - ./data:/nexus-data ports: - 8081:8081 EOF 启动 nexus3 容器

Consul 单机部署

安装 consul 1 2 3 yum install -y yum-utils yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo yum -y install consul 配置 consul修改 /etc/consul.d/consul.hcl 文件,配置如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 log_level = "INFO" log_file = "/var/log/consul/" log_rotate_bytes = 10485760 log_rotate_max_files = 3 connect = { enabled = true }

Firewall 防火墙

firewalld 端口转发 打开内核转发功能 1 2 echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf sysctl -p 开启防火墙伪装(开启后才能转发端口) 1 firewall-cmd --permanent --add-masquerade 配置端口转发 将访问本机 tcp/222 端口的流量转发到 172.16.174.101 的 tcp/22 端口