Rocky9安装php
使用remi:https://rpms.remirepo.net
安装posix扩展:dnf install php84-php-process
安装event扩展:dnf install php84-php-pecl-event libevent

Ubuntu安装php
sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt update
apt install php8.4
apt install php8.4-xxx

Ubuntu 24.04
火山引擎访问地址:https://mirrors.ivolces.com/ubuntu/
公网访问地址:https://mirrors.volces.com/ubuntu/

cat /etc/apt/sources.list

deb http://mirrors.ivolces.com/ubuntu/ noble main restricted universe multiverse
deb-src http://mirrors.ivolces.com/ubuntu/ noble main restricted universe multiverse

deb http://mirrors.ivolces.com/ubuntu/ noble-security main restricted universe multiverse
deb-src http://mirrors.ivolces.com/ubuntu/ noble-security main restricted universe multiverse

deb http://mirrors.ivolces.com/ubuntu/ noble-updates main restricted universe multiverse
deb-src http://mirrors.ivolces.com/ubuntu/ noble-updates main restricted universe multiverse

deb http://mirrors.ivolces.com/ubuntu/ noble-proposed main restricted universe multiverse
deb-src http://mirrors.ivolces.com/ubuntu/ noble-proposed main restricted universe multiverse

deb http://mirrors.ivolces.com/ubuntu/ noble-backports main restricted universe multiverse
deb-src http://mirrors.ivolces.com/ubuntu/ noble-backports main restricted universe multiverse

1)禁用systemd-resolved服务

systemctl stop systemd-resolved
systemctl disable systemd-resolved

2)默认的/etc/resolv.conf是软链接,删除重建为普通文件。

rm -rf /etc/resolv.conf

3)vim /etc/resolv.conf

nameserver 10.1.1.1
nameserver 10.1.2.1

4)将/etc/resolv.conf文件加锁

chattr +i /etc/resolv.conf

sudo dnf update
sudo dnf install python3.11
sudo dnf install python3.11-pip

编译安装
sudo dnf update
sudo dnf groupinstall "Development Tools" -y
sudo dnf install openssl-devel bzip2-devel libffi-devel -y
cd Python-3.11.0
./configure --enable-optimizations
make -j $(nproc)
sudo make altinstall

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.10
python3.10 --version

安装pip
apt install python3-pip

将Python 3.10设置为默认的Python 3版本
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
sudo update-alternatives --config python3

编译安装
sudo apt install wget build-essential checkinstall
sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev
cd Python-3.10.0
sudo ./configure --enable-optimizations
sudo make -j $(nproc)
sudo make altinstall

创建软链接
sudo ln -s /usr/local/bin/python3.10 /usr/bin/python3

配置 pip3
sudo ln -s /usr/local/bin/pip3.10 /usr/bin/pip3

ETCD数据目录

ETCD_DATA_DIR="/var/lib/etcd/data"

备份ETCD数据

1)使用cp命令进行备份

cp -R /var/lib/etcd/ /opt/backup/etcd/

2)创建ETCD快照备份

etcdctl snapshot save /opt/snapshot.db

恢复etcd快照文件

1)停止etcd服务

systemctl stop etcd

2)恢复数据

实例1恢复

etcdctl snapshot restore /opt/snapshot.db \
--name etcd1 \
--initial-cluster etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380 \
--initial-cluster-token mro \
--initial-advertise-peer-urls http://etcd1:2380 \
--data-dir /var/lib/etcd/data

实例2恢复

etcdctl snapshot restore /opt/snapshot.db \
--name etcd2 \
--initial-cluster etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380 \
--initial-cluster-token mro \
--initial-advertise-peer-urls http://etcd2:2380 \
--data-dir /var/lib/etcd/data

实例3恢复

etcdctl snapshot restore /opt/snapshot.db \
--name etcd3 \
--initial-cluster etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380 \
--initial-cluster-token mro \
--initial-advertise-peer-urls http://etcd3:2380 \
--data-dir /var/lib/etcd/data

3)启动服务

systemctl daemon-reload
systemctl start etcd

4)查看集群

etcdctl --endpoints="http://etcd1:2379,http://etcd2:2379,http://etcd3:2379" endpoint status --write-out=table