/images/avatar.jpeg

_浅行

使用 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 端口

Redis 5.x 分片集群部署

Redis 5.x 及以上版本配置分片集群不需要在使用 redis-trib.rb 脚本,默认 redis-cli 已集成集群配置指令 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 33 34 35

Redis 4.x 分片集群部署

简单介绍高可用 在搭建集群时,会为每一个分片的主节点,对应一个从节点,实现 slaveof 的功能,同时当主节点 down,实现类似于 sentinel 的自动 failover 的功能。 redi

ACME v2 证书自动化申请

如果你没有域名的解析控制权,此方法就非常适合; 如果你有域名的控制权可以使用 acme.sh + dns_api 的方式自动申请 安装 acme.sh 1 curl https://get.acme.sh | sh -s email=my@example.com 如果上面官方下载地址 失败 或