rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo yum install golang
Redis 3.2 主从模式配置
启动三台虚拟机,节点名称与 IP 分别如下:
node1: 192.168.56.101 node2: 192.168.56.102 node3: 192.168.56.103
在三台机器上分别安装 Redis 服务
yum install -y epel-release yum install -y redis
修改各个节点 Redis 的配置文件,使其监听在外部网络上
vi /etc/redis.conf
bind 0.0.0.0
启动各个节点上的 Redis 服务
systemctl restart redis
登录 node2 与 node3 设置他们为 node1 的 slave
redis-cli 127.0.0.1:6379> SLAVEOF 192.168.56.101 6379 OK Already connected to specified master
这样一主两从的 Redis 主从就配置好了,在主节点上设置值后,从节点也可以看到值
使用 OpenSSL 验证 HTTPS 证书配置
使用 xrdp 远程桌面访问 Ubuntu
sudo apt install -y xrdp sudo systemctl enable xrdp sudo systemctl start xrdp
然后使用远程桌面客户端工具就可以链接上 Ubuntu 机器了
Ubuntu 将用户添加至 dialout 组
sudo usermod -aG dialout wwx
用户在 dialout 组之后,就可以直接使用串口,不用 sudo 了。
Anolis OS 8.4 GA 安装截图
openEuler 22.03 LTS 安装截图
修改 Linux 用户默认 shell
usermod --shell /bin/bash username
将 K3s 中 Ingress 组件从 Traefik 替换为 Nginx
我们当前开发环境 K3s 使用的是 Traefik 作为 Ingress,生产环境的 K8s 使用的是 Nginx 作为 Ingress,要将 Traefik 替换为 Nginx,并不是因为 Traefix 不如 Nginx,只是想把我们开发环境里的 Ingress 和生产环境的 Ingress 统一下,简化 chart 包的写法。
我们先更新下 K3s,排除掉 Traefik 的安装,这里官方文档就有提到:
curl -sfL https://get.k3s.io | sh -s - --disable traefik
这样安装完的 K3s 是不带 Ingress 的,我们需要额外再安装一下 Nginx Ingress:
helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx --create-namespace
执行完这两个核心动作之后,Nginx 就变成 K3s 中的 Ingress 组件了,更完整的操作命令如下:
curl -sfL https://get.k3s.io | sh -s - --disable traefik crictl pull registry.cn-hangzhou.aliyuncs.com/google_containers/kube-webhook-certgen:v1.1.1 ctr image tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-webhook-certgen:v1.1.1 k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1 ctr image tag registry.cn-hangzhou.aliyuncs.com/google_containers/kube-webhook-certgen:v1.1.1 k8s.gcr.io/ingress-nginx/[email protected]:64d8c73dca984af206adf9d6d7e46aa550362b1d7a01f3a0a91b20cc67868660 crictl pull registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v1.2.0 ctr image tag registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v1.2.0 k8s.gcr.io/ingress-nginx/controller:v1.2.0 ctr image tag registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:v1.2.0 k8s.gcr.io/ingress-nginx/[email protected]:d8196e3bc1e72547c5dec66d6556c0ff92a23f6d0919b206be170bc90d5f9185 curl -O https://get.helm.sh/helm-v3.9.0-linux-amd64.tar.gz helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx --create-namespace