参考社区已发布的信息,在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可正常运行,但未进行功能测试; |
合作电话:010-64087828
社区邮箱:greatsql@greatdb.com