GreatSQL社区

搜索

[已解决] MySQL Shell for GreatSQL 8.0.32 在openEuler2203 下的编译及el9 的部署

709 2 2024-3-1 09:23
参考社区已发布的信息,在openEuler 2203环境中编译MySQL Shell for GreatSQL 8.0.32 ,将编译及测试情况整理如下。

一、编译

1、准备编译环境
## 最小化安装openEuler 2203sp3,更新环境至最新
yum install -y patch cmake gcc make gcc-c++ openssl-devel ncurses-static libtirpc-devel rpcgen uuid util-linux-devel python3-devel curl-devel python3-pyyaml libssh-devel
yum update -y

2、准备源码
2.1 在/opt 目录下载并解压所有软件包
https://cdn.mysql.com/archives/mysql-8.0/mysql-8.0.32.tar.gz
https://cdn.mysql.com/archives/m ... l-8.0.32-src.tar.gz
https://boostorg.jfrog.io/artifa ... boost_1_77_0.tar.gz

https://gitee.com/GreatSQL/Great ... /antlr4-4.10.tar.xz
https://gitee.com/GreatSQL/Great ... tobuf-3.19.4.tar.xz
https://gitee.com/GreatSQL/Great ... eatsql-8.0.32.patch

2.2 应用greatsql-shell 补丁
# cd /opt/mysql-shell-8.0.32-src
# patch -p1 -f < /opt/mysqlsh-for-greatsql-8.0.32.patch

3、编译、安装依赖包
3.1 编译、安装 antlr4:
# cd /opt/antlr4-4.10/runtime/Cpp/
# mkdir bld && cd bld
# cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/antlr4 && make -j16 && make -j16 install

3.2 编译、安装 protobuf
# cd /opt/protobuf-3.19.4
# ./configure && make -j16 && make -j16 install

3.3 安装 patchelf、rpcsvc-proto
yum install patchelf rpcsvc-proto-devel

4、编译、安装 greatsql-shell
4.1 编译 mysqlclient、mysqlxclient
# cd /opt/mysql-8.0.32
# mkdir bld && cd bld
# cmake .. -DBOOST_INCLUDE_DIR=/opt/boost_1_77_0 \
-DLOCAL_BOOST_DIR=/opt/boost_1_77_0 \
-DWITH_SSL=system && \
cmake --build . --target mysqlclient -- -j16; \
cmake --build . --target mysqlxclient -- -j16

4.2 编译 greatsql-shell
# cd /opt/mysql-shell-8.0.32-src/
# mkdir bld && cd bld
# cmake .. \
-DCMAKE_INSTALL_PREFIX=/u01/greatsql-shell-8.0.32-oe2203-glibc2.34-py3.9-x86_64 \
-DMYSQL_SOURCE_DIR=/opt/mysql-8.0.32 \
-DMYSQL_BUILD_DIR=/opt/mysql-8.0.32/bld/ \
-DHAVE_PYTHON=1 \
-DWITH_PROTOBUF=bundled \
-DBUILD_SOURCE_PACKAGE=0 \
-DPYTHON_LIBRARIES=/usr/lib64/python3.9 -DPYTHON_INCLUDE_DIRS=/usr/include/python3.9/ \
-DBUNDLED_ANTLR_DIR=/usr/local/antlr4 \
&& make -j16 && make -j16 install

## 复制必要的库,分发打包/u01/greatsql-shell-8.0.32-oe2203-glibc2.34-py3.9-x86_64
# cp /usr/local/lib/libprotobuf.so.30 /u01/greatsql-shell-8.0.32-oe2203-glibc2.34-py3.9-x86_64/lib/mysqlsh/
## el9 的openssl 版本为3.0.x
# cp /usr/lib64/libcrypto.so.1.1 /u01/greatsql-shell-8.0.32-oe2203-glibc2.34-py3.9-x86_64/lib/mysqlsh/libcrypto.so.1.1
# cp /usr/lib64/libssl.so.1.1 /u01/greatsql-shell-8.0.32-oe2203-glibc2.34-py3.9-x86_64/lib/mysqlsh/libssl.so.1.1


二、测试
1、openEuler 2203环境中可正常运行mysqlsh,不再报核心转储错误,可正常接管旧版本的集群(升级元数据版本),或重新创建集群;
2、el9(RockyLinux 9)环境中复制openssl 1.1相关的库后mysqlsh可正常运行,但未进行功能测试;

全部回复(2)
yejr 2024-3-1 14:03:42
赞,谢谢分享
KAiTO 2024-3-1 16:10:21
感谢分享
xiongyu---

2

主题

0

博客

14

贡献

新手上路

Rank: 1

积分
22

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-11-23 20:26 , Processed in 0.020922 second(s), 17 queries , Redis On.
快速回复 返回顶部 返回列表