在多台服务器上部署GoQuorum
一、解决服务器基础环境
本次实验操作系统为centos7.9。
以下步骤为大致思路和命令,在执行过程中可能会产生不同的依赖问题,需要逐一进行解决。
1.python
升级python2至python3
[root@localhost soft]# yum install gcc gcc-c++ -y
[root@localhost soft]# wget https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz
[root@localhost soft]# yum install libffi-devel -y
[root@localhost soft]# tar xvf python-3.9.9.tar.xz
[root@localhost soft]# cd python-3.9.9/
[root@localhost python-3.9.9]# ./configure
[root@localhost python-3.9.9]# make
[root@localhost python-3.9.9]#make install
[root@localhost soft]# python -V #一个是旧版本,一个是新版本
Python 2.7.5
[root@localhost soft]# python3 -V
python 3.9.9
#设置默认版本
[root@localhost ~]# ls -al /usr/bin | grep python
lrwxrwxrwx. 1 root root 7 May 26 2017 python -> python2
lrwxrwxrwx. 1 root root 9 May 26 2017 python2 -> python2.7
-rwxr-xr-x. 1 root root 7136 Nov 6 2016 python2.7
[root@localhost ~]# rm -f /usr/bin/python2 /usr/bin/python
[root@localhost ~]# ln -s /usr/local/bin/python3 /usr/bin/python3
[root@localhost ~]# ln -s /usr/bin/python3 /usr/bin/python
修改以下常用命令的解释器为原python2.7,否则命令不能正常使用,其他可以在使用到的时候在进行修改。
/usr/bin/yum,/usr/sbin/firewalld,/usr/bin/firewall-cmd,/usr/libexec/urlgrabber-ext-down
2.GCC
#下载最新版GCC
[root@localhost soft]# wget https://mirrors.aliyun.com/gnu/gcc/gcc-12.2.0/gcc-12.2.0.tar.gz
[root@localhost soft]# tar -zxvf gcc-12.2.0.tar.gz
[root@localhost soft]# cd gcc-12.2.0/
#检查并安装依赖
[root@localhost gcc-12.2.0]# yum -y install bzip2
[root@localhost gcc-12.2.0]# ./contrib/download_prerequisites
#注意:download_prerequisites需要连接互联网下载依赖包,没有互联网权限的服务器可以在互联网服务器执行该脚本下载依赖包,并拷贝到无互联网权限的服务器的相应路径下,重新执行该脚本即可。
#准备编译
[root@localhost gcc-12.2.0]# mkdir build
[root@localhost gcc-12.2.0]# cd build/
[root@localhost build]# ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
#make会很慢
[root@localhost build]# make -j16
[root@localhost build]# make install
[root@localhost build]# gcc -v
使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
目标:x86_64-pc-linux-gnu
配置为:../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
线程模型:posix
Supported LTO compression algorithms: zlib
gcc 版本 12.2.0 (GCC)
注意:升级完成后,需要对原相关包做软连接
ln -s /usr/local/lib64/libgcc_s.so.1 /lib64/libgcc_s.so.1
ln -s /usr/local/lib64/libstdc++.so.6.0.30 /lib64/libstdc++.so.6.0.30
ln -s /lib64/libstdc++.so.6.0.30 /lib64/libstdc++.so.6
3.MAKE
[root@localhost soft]# wget https://mirrors.aliyun.com/gnu/make/make-4.3.tar.gz
[root@localhost soft]# tar -xzvf make-4.3.tar.gz
[root@localhost soft]# cd make-4.3
[root@localhost soft]# ./configure
[root@localhost soft]# make && make install
[root@localhost soft]# mv /usr/bin/make /usr/bin/make.bak
[root@localhost soft]# ln -s /usr/local/bin/make /usr/bin/make
[root@localhost soft]# make -v
GNU Make 4.3
为 x86_64-pc-linux-gnu 编译
Copyright (C) 1988-2020 Free Software Foundation, Inc.
许可证:GPLv3+:GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/gpl.html>。
本软件是自由软件:您可以自由修改和重新发布它。
在法律允许的范围内没有其他保证
4.GLIBC
本次实验基于centos7.9环境,glibc版本从2.36重复验证至2.33。2.34、2.35、2.36均升级失败。
#查看当前版本状况,另外版本需要谨慎选择。有条件的情况下,必须进行实验室验证。否则风险很大。</