TL;DR
之前体验过如何安装 StoneDB,并发文演示了几个新特性。关于什么是 StoneDB,请先参阅前文。
- StoneDB 初体验 | StoneDB-5.7-v1.0.4 安装及新特性速览
本文记录了这几天在 Rocky Linux 9.2 上编译安装 StoneDB 5.7 最新源码的“扎心”经历。
对 StoneDB、MySQL、RocksDB 或 Rocky 9 感兴趣的同学请继续往下阅读。
环境信息
操作系统为 Rocky Linux 9.2,编译过程中没有出现特别消耗资源的情况,这点不错,我的 VM 是 2c4g,可以编译成功。
[shawnyan@rocky9 ~]$ cat /etc/redhat-release
Rocky Linux release 9.2 (Blue Onyx)
[shawnyan@rocky9 ~]$ uname -a
Linux rocky9.shawnyan.cn 5.14.0-284.30.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Sep 16 09:55:41 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
[shawnyan@rocky9 ~]$
[shawnyan@rocky9 ~]$ gcc --version
gcc (GCC) 11.3.1 20221121 (Red Hat 11.3.1-4)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[shawnyan@rocky9 ~]$ cmake --version
cmake version 3.20.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
[shawnyan@rocky9 ~]$ top
top - 15:28:57 up 12 days, 1:23, 2 users, load average: 0.01, 0.03, 0.00
Tasks: 272 total, 1 running, 271 sleeping, 0 stopped, 0 zombie
%Cpu0 : 0.0 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.3 hi, 0.3 si, 0.0 st
%Cpu1 : 0.0 us, 0.3 sy, 0.0 ni, 99.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 3623.0 total, 818.1 free, 947.4 used, 2131.4 buff/cache
MiB Swap: 4020.0 total, 3158.1 free, 861.9 used. 2675.6 avail Mem
查看 StoneDB 的安装路径和版本号
先上成果物,看看编译安装后的 StoneDB 目录下都有哪些文件。
安装路径是默认值,安装在了 /usr/local/mysql
目录下,查看版本号为 StoneDB-5.7.36
。
本地环境的 ntpd 没有同步,所以编译时间有点错乱,快了 8 小时。
创建 Tianmu 测试表
StoneDB 启动后,通过客户端进行连接,s
查看状态,服务器版本看着有点“凌乱”,不用在意这种细节。
查看默认数据库,与前文描述一致。创建一个测试库,并创建引擎为 TIANMU
的测试表,功能使用正常。
编译配置
相对于前文的丝滑安装,这里的编译过程极其痛苦,犹如工兵步步排雷,好在最终扛到军旗。
源码仓库
StoneDB 提供了 GitHub 和 Gitee 两个代码仓,只是并不同步,如果网路条件允许,还是从 GH 下载比较好。
- https://github.com/stoneatom/stonedb
- https://gitee.com/StoneDB/stonedb
官网地址解析
官网只能识别 https,无法识别 http,好在vx群里有好人帮忙确认官网状态正常,感谢。
Rocksdb 下载链接
Tianmu 引擎依赖 Rocksdb,如果配置时没有指定包,则会自动下载,只是下载的版本有些“老舅”,且“门牌号”不对。
RocksDB 6.12.6 发行于 2020-10-13,目前,最新版本为 RocksDB 8.6.7 发行于 09/26/2023。
-- Could not find (the correct version of) rocksdb.
-- MySQL currently requires vrocksdb-6.12.6
CMake Error at cmake/rocksdb.cmake:81 (MESSAGE):
You can download it with -DDOWNLOAD_ROCKSDB=1 -DWITH_ROCKSDB=
This CMake script will look for rocksdb in . If it is not
there, it will download and unpack it (in that directory) for you.
If you are inside a firewall, you may need to use an http proxy:
export http_proxy=http://example.com:80
Call Stack (most recent call first):
cmake/rocksdb.cmake:239 (COULD_NOT_FIND_ROCKSDB)
CMakeLists.txt:315 (INCLUDE)
下载 rocksdb 源码包后,配置正常。
-- Local rocksdb dir /data/stonedb-stonedb-5.7-dev/release/rocksdb-6.12.6
found ROCKSDB_INCLUDE_DIR:/data/stonedb-stonedb-5.7-dev/release/rocksdb-6.12.6
-- Found /data/stonedb-stonedb-5.7-dev/release/rocksdb-6.12.6/include/rocksdb/version.h
-- current ROCKSDB_VERSION_NUMBER is #define ROCKSDB_MAJOR 6.#define ROCKSDB_MINOR 12
-- current ROCKSDB_MAJOR_VERSION is: 6, ROCKSDB_MAJOR_VERSION:12
-- ROCKSDB_INCLUDE_DIR /data/stonedb-stonedb-5.7-dev/release/rocksdb-6.12.6
marisa-trie 下载链接
StoneDB 依赖“玛丽莎”,同上,需要提前下载源码包。
found MARISA_INCLUDE_DIR:MARISA_INCLUDE_DIR-NOTFOUND
-- Looked for include/marisa.h in and
-- MARISA_INCLUDE_DIR MARISA_INCLUDE_DIR-NOTFOUND
-- LOCAL_MARISA_DIR
-- Could not find (the correct version of) marisa.
-- MySQL currently requires marisa-trie
CMake Error at cmake/marisa.cmake:59 (MESSAGE):
You can download it, install it, then specify the marisa path with
-DWITH_MARISA=
This CMake script will look for marisa in .
Call Stack (most recent call first):
cmake/marisa.cmake:123 (COULD_NOT_FIND_MARISA)
CMakeLists.txt:323 (INCLUDE)
也可以编译时自动下载,只是这里还有个小包袱,git变成了gi。
完整地址为:
https://github.com/s-yata/marisa-trie/archive/refs/tags/v0.2.6.tar.gz
boost 版本升级
StoneDB 5.7 依赖 boost 1.66.0,但编译时报错。
[shawnyan@rocky9 boost_1_66_0]$ ./bootstrap.sh
[shawnyan@rocky9 boost_1_66_0]$ ./b2
...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-gnu-11/release/link-static/threadapi-pthread/threading-multi/converter/builtin_converters.o...
...skipped
libboost_python3.a(clean) for lack of
converter/builtin_converters.o...
...skipped
libboost_python3.a for lack of
converter/builtin_converters.o...
...skipped
libboost_python3.a for lack of
libboost_python3.a...
...failed updating 2 targets...
...skipped 6 targets...
所以,我就升级到了 boost 1.77.0,并修改了基础标识。
./cmake/boost.cmake:SET(BOOST_PACKAGE_NAME "boost_1_66_0")
./cmake/boost.cmake:SET(BOOST_PATCHES_DIR "${CMAKE_SOURCE_DIR}/include/boost_1_66_0/patches")
./cmake/boost.cmake:SET(BOOST_SOURCES_DIR "${CMAKE_SOURCE_DIR}/include/boost_1_66_0")
./codecov.yml:- "include/boost_1_66_0"
升级后,可以正常进行编译。
...updated 1745 targets...
The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/data/stonedb-stonedb-5.7-dev/release/boost_1_77_0
The following directory should be added to linker library paths:
/data/stonedb-stonedb-5.7-dev/release/boost_1_77_0/stage/lib
[shawnyan@rocky9 boost_1_77_0]$
openssl 1.1.1
Rocky 9 中通过 dnf 安装的 openssl 为 3.x 版本,版本太新,配置无法识别,而且和 1.1.1 系列代码差异很大,这里下载了 openssl 1.1.1 系列的最新版本 openssl-1.1.1w
。
Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),
CMake Error at cmake/ssl.cmake:63 (MESSAGE):
Please install the appropriate openssl developer package.
Call Stack (most recent call first):
cmake/ssl.cmake:280 (FATAL_SSL_NOT_FOUND_ERROR)
CMakeLists.txt:630 (MYSQL_CHECK_SSL)
下载后,配置安装 openssl。
./config
make
make install
配置参数
到目前未知,配置阶段完成,来看下配置参数和输出结果。
cmake ..
-DWITH_BOOST=.
-DWITH_ROCKSDB=./rocksdb-6.12.6/
-DWITH_SSL=system
-DWITH_EMBEDDED_SERVER=0
-DBOOST_SOURCES_DIR=./release/boost_1_77_0/
-Dimt=OFF
-DWITH_UNIT_TESTS=OFF
-DINSTALL_MYSQLTESTDIR=
-DMYSQL_VERSION_EXTRA=ShawnYan
输出日志:
-- CMAKE_BUILD_TYPE: RelWithDebInfo
-- COMPILE_DEFINITIONS: _GNU_SOURCE;_FILE_OFFSET_BITS=64;HAVE_CONFIG_H;TIANMU;_GLIBCXX_USE_CXX11_ABI=1;HAVE_TLSv13
-- CMAKE_C_FLAGS: -fPIC -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -Wall -Wextra -Wformat-security -Wvla -Wimplicit-fallthrough=2 -Wno-unknown-pragmas -Wwrite-strings -Wdeclaration-after-statement
-- CMAKE_CXX_FLAGS: -fPIC -std=gnu++03 -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -Wall -Wextra -Wformat-security -Wvla -Wimplicit-fallthrough=2 -Wno-unknown-pragmas -Woverloaded-virtual -Wno-unused-paramete
-- CMAKE_CXX_FLAGS_DEBUG: -DENABLED_DEBUG_SYNC -DSAFE_MUTEX -g -gdwarf-2 -std=c++1z -fno-sized-deallocation
-- CMAKE_CXX_FLAGS_RELWITHDEBINFO: -ffunction-sections -fdata-sections -O3 -g -DNDEBUG -gdwarf-2 -std=c++1z -fno-sized-deallocation
-- CMAKE_CXX_FLAGS_RELEASE: -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++1z -fno-sized-deallocation
-- CMAKE_CXX_FLAGS_MINSIZEREL: -ffunction-sections -fdata-sections -Os -DNDEBUG
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_EXE_LINKER_FLAGS
-- CMAKE_MODULE_LINKER_FLAGS -Wl,--build-id
-- CMAKE_SHARED_LINKER_FLAGS -Wl,--build-id
-- Configuring done
-- Generating done
-- Build files have been written to: /data/stonedb-stonedb-5.7-dev/release
[shawnyan@rocky9 release]$
编译过程
配置完成,下面开始真正编译过程。
提示无法找到 stdc++
编译时遇到报错,提示无法找到 stdc++
。
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make[2]: *** [extra/CMakeFiles/comp_err.dir/build.make:107: extra/comp_err] Error 1
make[1]: *** [CMakeFiles/Makefile2:5469: extra/CMakeFiles/comp_err.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
可能是缺少依赖包导致的,安装依赖。
yum install libstdc++-static
查看系统lib,再补充一个软连接。
[root@rocky9 lib64]# sudo ln -s libstdc++.so.6 libstdc++.so
[root@rocky9 lib64]# ll *std*
lrwxrwxrwx. 1 root root 14 Nov 10 22:46 libstdc++.so -> libstdc++.so.6
lrwxrwxrwx. 1 root root 19 Apr 10 2023 libstdc++.so.6 -> libstdc++.so.6.0.29
-rwxr-xr-x. 1 root root 2306520 Apr 10 2023 libstdc++.so.6.0.29
lrwxrwxrwx. 1 root root 16 May 27 2022 libzstd.so -> libzstd.so.1.5.1
lrwxrwxrwx. 1 root root 16 May 27 2022 libzstd.so.1 -> libzstd.so.1.5.1
-rwxr-xr-x. 1 root root 882384 May 27 2022 libzstd.so.1.5.1
[root@rocky9 lib64]#
boost 文件路径变化
编译到 37% 遇到错误退出,提示无法找到文件。
[ 37%] Building CXX object storage/tianmu/CMakeFiles/tianmu.dir/common/data_format.cpp.o
/data/stonedb-stonedb-5.7-dev/storage/tianmu/common/data_format.cpp:23:10: fatal error: boost/algorithm/string.hpp: No such file or directory
23 | #include
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [storage/tianmu/CMakeFiles/tianmu.dir/build.make:90: storage/tianmu/CMakeFiles/tianmu.dir/common/data_format.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3704: storage/tianmu/CMakeFiles/tianmu.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
对比确认是路径有出入,在源码目录的 include
文件夹下,创建一个 boost
的软连接。
[root@rocky9 algorithm]# ll /data/stonedb-stonedb-5.7-dev/boost_1_77_0/boost/algorithm/string.hpp
-rw-r--r--. 1 shawnyan shawnyan 1061 Aug 5 2021 /data/stonedb-stonedb-5.7-dev/boost_1_77_0/boost/algorithm/string.hpp
[root@rocky9 algorithm]#
...
[root@rocky9 include]# pwd
/data/stonedb-stonedb-5.7-dev/include
[root@rocky9 include]# ln -s ../boost_1_77_0/boost .
marisa/rocksdb hard code
准备依赖包时,已将 marisa/rocksdb 放到了编译路径下,这里是 /data/stonedb-stonedb-5.7-dev/release
,但仍然遇到了找不到的问题,
/usr/include/c++/11/bits/unique_ptr.h:211:7: note: candidate expects 1 argument, 0 provided
make[2]: *** [storage/tianmu/CMakeFiles/tianmu.dir/build.make:258: storage/tianmu/CMakeFiles/tianmu.dir/compress/ppm.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3704: storage/tianmu/CMakeFiles/tianmu.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
...
cd /data/stonedb-stonedb-5.7-dev/release/storage/tianmu && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT storage/tianmu/CMakeFiles/tianmu.dir/compress/ppm.cpp.o -MF CMakeFiles/tianmu.dir/compres s/ppm.cpp.o.d -o CMakeFiles/tianmu.dir/compress/ppm.cpp.o -c /data/stonedb-stonedb-5.7-dev/storage/tianmu/compress/ppm.cpp
细看了一眼,发现了两处硬编码,所以简单做了个软连处理。
- hard code
SET(MARISA_ROOT /usr/local/stonedb-marisa)
SET(ROCKSDB_ROOT /usr/local/stonedb-gcc-rocksdb)
- soft link
ln -s /data/stonedb-stonedb-5.7-dev/release/marisa-trie-0.2.6 /usr/local/stonedb-marisa
ln -s /data/stonedb-stonedb-5.7-dev/release/rocksdb-6.12.6 /usr/local/stonedb-gcc-rocksdb
ll /usr/local/stonedb-marisa
ll /usr/local/stonedb-gcc-rocksdb
COMMON_C_FLAGS
编译进度来到了 40%,由于 gcc 版本变化,FLAG 也随之发生了变动,这里修改了两处。
- 报错日志
[ 40%] Building CXX object storage/tianmu/CMakeFiles/tianmu.dir/compress/ppm.cpp.o
In file included from /usr/include/c++/11/memory:76,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/common/common_definitions.h:23,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/common/exception.h:23,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/common/assert.h:23,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/compress/data_stream.h:23,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/compress/arith_coder.h:21,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/compress/ppm.h:23,
from /data/stonedb-stonedb-5.7-dev/storage/tianmu/compress/ppm.cpp:18:
/usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘constexpr std::unique_ptr::unique_ptr() [with _Del = std::default_delete; = void; _Tp = Tianmu::compress::PPMModel; _Dp = std::default_delete]’:
/data/stonedb-stonedb-5.7-dev/storage/tianmu/compress/ppm.cpp:32:80: required from here
/usr/include/c++/11/bits/unique_ptr.h:270:11: error: no matching function for call to ‘std::__uniq_ptr_data::__uniq_ptr_data()’
270 | : _M_t()
| ^~~~~~
- 修改内容
影响文件:cmakebuild_configurationscompiler_options.cmake
- https://github.com/stoneatom/stonedb/blob/stonedb-5.7-dev/cmake/build_configurations/compiler_options.cmake#L46
- https://github.com/stoneatom/stonedb/blob/stonedb-5.7-dev/cmake/build_configurations/compiler_options.cmake#L71
- SET(COMMON_C_FLAGS "-fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing")
+ SET(COMMON_C_FLAGS "-fno-omit-frame-pointer -fno-strict-aliasing")
...
- SET(COMMON_CXX_FLAGS "-fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing")
+ SET(COMMON_CXX_FLAGS "-fno-omit-frame-pointer -fno-strict-aliasing")
STONEDB_xxx
参数未声明
进度跳跃到了 98%,遇到了四个参数没声明的情况。
[ 98%] Building CXX object sql/CMakeFiles/sql.dir/mysqld.cc.o
In file included from /data/stonedb-stonedb-5.7-dev/sql/table.h:37,
from /data/stonedb-stonedb-5.7-dev/sql/field.h:37,
from /data/stonedb-stonedb-5.7-dev/sql/protocol_classic.h:27,
from /data/stonedb-stonedb-5.7-dev/sql/sql_class.h:40,
from /data/stonedb-stonedb-5.7-dev/sql/sql_parse.h:29,
from /data/stonedb-stonedb-5.7-dev/sql/mysqld.cc:57:
/data/stonedb-stonedb-5.7-dev/libbinlogevents/include/table_id.h: In member function ‘Table_id Table_id::operator++(int)’:
...
/data/stonedb-stonedb-5.7-dev/sql/mysqld.cc: In function ‘void print_build_info()’:
/data/stonedb-stonedb-5.7-dev/sql/mysqld.cc:7049:33: error: ‘STONEDB_BRANCH_NAME’ was not declared in this scope
7049 | printf("tBranch name: %sn", STONEDB_BRANCH_NAME);
| ^~~~~~~~~~~~~~~~~~~
/data/stonedb-stonedb-5.7-dev/sql/mysqld.cc:7050:36: error: ‘STONEDB_COMMIT_ID’ was not declared in this scope
7050 | printf("tLast commit ID: %sn", STONEDB_COMMIT_ID);
| ^~~~~~~~~~~~~~~~~
/data/stonedb-stonedb-5.7-dev/sql/mysqld.cc:7051:38: error: ‘STONEDB_COMMIT_TIME’ was not declared in this scope; did you mean ‘STONEDB_BUILD_TIME’?
7051 | printf("tLast commit time: %sn", STONEDB_COMMIT_TIME);
| ^~~~~~~~~~~~~~~~~~~
| STONEDB_BUILD_TIME
/data/stonedb-stonedb-5.7-dev/sql/mysqld.cc: In function ‘void set_server_version()’:
/data/stonedb-stonedb-5.7-dev/sql/mysqld.cc:8134:31: error: ‘STONEDB_TAG_NAME’ was not declared in this scope
8134 | static_cast(sizeof(STONEDB_TAG_NAME)))
| ^~~~~~~~~~~~~~~~
make[2]: *** [sql/CMakeFiles/sql.dir/build.make:3110: sql/CMakeFiles/sql.dir/mysqld.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5823: sql/CMakeFiles/sql.dir/all] Error 2
找到了一个 Issue #1328,只是,并非每个人都用 git 下载代码。
所以,这里找到这四个变量,直接替换掉。
https://github.com/stoneatom/stonedb/blob/stonedb-5.7-dev/sql/mysqld.cc#L7049
STONEDB_BRANCH_NAME
STONEDB_COMMIT_ID
STONEDB_COMMIT_TIME
STONEDB_TAG_NAME
缺少依赖 libubsan
在接近 100% 时,遇到了报错。
/usr/bin/ld: cannot find /usr/lib64/libubsan.so.1.0.0
collect2: error: ld returned 1 exit status
只需安装对应的包即可。
yum install libubsan
完整的编译日志
编译终于通关,来看下完整的日志。
[shawnyan@rocky9 release]$ DISABLE_WARNING_AS_ERROR=1 DEBUG_LEVEL=0 make
[ 0%] Built target abi_check
[ 0%] Built target lz4_lib
[ 0%] Built target INFO_SRC
[ 0%] Built target INFO_BIN
[ 0%] Built target zlib
[ 0%] Built target libedit_emacs
[ 0%] Built target libedit_vi
[ 0%] Built target libedit_common
[ 0%] Built target libedit_fcns
[ 0%] Built target libedit_help
[ 1%] Built target libedit_func
[ 3%] Built target edit
[ 3%] Built target event_pthreads
[ 4%] Built target event_core
[ 4%] Built target event_openssl
[ 4%] Built target event_extra
[ 7%] Built target strings
[ 7%] Built target gen_dtrace_header
[ 11%] Built target mysys
[ 11%] Built target dbug
[ 12%] Built target vio
[ 12%] Built target regex
[ 12%] Built target base64_test
[ 12%] Built target queues
[ 13%] Built target thr_lock
[ 14%] Built target mysys_ssl
[ 14%] Built target comp_err
[ 14%] Built target GenError
[ 15%] Built target clientlib
[ 15%] Built target libmysql
[ 15%] Built target libmysql_api_test
[ 15%] Built target mysqlclient
[ 15%] Built target authentication_ldap_sasl_client
[ 15%] Built target binlogevents_static
[ 15%] Built target binlogstandalone_shared
[ 16%] Built target binlogstandalone_static
[ 16%] Built target archive
[ 16%] Built target blackhole
[ 17%] Built target csv
[ 18%] Built target mysqlservices
[ 18%] Built target example
[ 19%] Built target federated
[ 21%] Built target heap
[ 27%] Built target innobase
[ 29%] Built target myisam
[ 31%] Built target myisam_nopfs
[ 32%] Built target myisam_ftdump
[ 32%] Built target myisampack
[ 32%] Built target myisamlog
[ 33%] Built target myisamchk
[ 34%] Built target myisammrg
[ 34%] Built target partition
[ 40%] Built target perfschema
[ 50%] Built target tianmu
[ 51%] Built target test_prog
[ 51%] Built target test_security_context
[ 51%] Built target audit_null
[ 51%] Built target auth
[ 52%] Built target qa_auth_interface
[ 52%] Built target auth_test_plugin
[ 52%] Built target qa_auth_client
[ 52%] Built target qa_auth_server
[ 52%] Built target mysql_no_login
[ 52%] Built target auth_socket
[ 52%] Built target connection_control
[ 52%] Built target daemon_example
[ 52%] Built target ngram_parser
[ 52%] Built target ftexample
[ 52%] Built target keyring_file
[ 52%] Built target validate_password
[ 52%] Built target replication_observers_example
[ 52%] Built target rewrite_example
[ 52%] Built target rewriter
[ 53%] Built target semisync_slave
[ 53%] Built target semisync_master
[ 53%] Built target test_sql_replication
[ 53%] Built target test_sql_sqlmode
[ 54%] Built target test_sql_lock
[ 54%] Built target test_sql_commit
[ 54%] Built target test_x_sessions_init
[ 54%] Built target test_sql_errors
[ 54%] Built target test_x_sessions_deinit
[ 55%] Built target test_session_detach
[ 55%] Built target test_session_info
[ 55%] Built target test_sql_complex
[ 55%] Built target test_sql_all_col_types
[ 55%] Built target test_sql_2_sessions
[ 55%] Built target test_sql_cmds_1
[ 55%] Built target test_sql_shutdown
[ 55%] Built target test_session_in_thd
[ 55%] Built target test_sql_processlist
[ 55%] Built target test_sql_stored_procedures_functions
[ 55%] Built target test_sql_views_triggers
[ 55%] Built target test_services_thread
[ 55%] Built target test_services
[ 55%] Built target test_framework
[ 55%] Built target test_udf_services
[ 55%] Built target version_token
[ 60%] Built target group_replication
[ 60%] Built target keyring_udf
[ 62%] Built target protobuf
[ 64%] Built target protoclib
[ 64%] Built target protoc
[ 66%] Built target mysqlxtest
[ 66%] Built target protobuf-lite
[ 66%] Built target GenLiteProtos
[ 71%] Built target mysqlx
[ 72%] Built target my_print_defaults
[ 73%] Built target perror
[ 73%] Built target lz4_decompress
[ 74%] Built target resolveip
[ 74%] Built target replace
[ 75%] Built target innochecksum
[ 76%] Built target zlib_decompress
[ 76%] Built target resolve_stack_dump
[ 76%] Built target mysql_ssl_rsa_setup
[ 76%] Built target comp_sql
[ 76%] Built target GenSysSchema
[ 76%] Built target GenBootstrapPriv
[ 76%] Built target mysql_install_db
[ 76%] Built target mysql_secure_installation
[ 76%] Built target mysql
[ 76%] Built target mysqltest
[ 76%] Built target GenFixPrivs
[ 76%] Built target mysqlcheck_core
[ 77%] Built target client_base
[ 78%] Built target mysql_upgrade
[ 78%] Built target mysqlcheck
[ 78%] Built target mysqldump
[ 78%] Built target mysqlimport
[ 78%] Built target mysqlshow
[ 78%] Built target mysql_plugin
[ 78%] Built target mysqlbinlog
[ 78%] Built target mysqladmin
[ 79%] Built target mysql_config_editor
[ 79%] Built target mysqlslap
[ 79%] Built target boost_lib
[ 83%] Built target mysqlpump_lib
[ 84%] Built target mysqlpump
[ 84%] Built target mysql_client_test
[ 84%] Built target locking_service
[ 84%] Built target udf_example
[ 86%] Built target binlog
[ 86%] Built target gen_lex_hash
[ 87%] Built target GenServerSource
[ 87%] Built target gen_lex_token
[ 87%] Built target GenDigestServerSource
[ 99%] Built target sql
[ 99%] Built target rpl
[ 99%] Built target master
[100%] Built target slave
[100%] Built target mysqld
[100%] Built target sqlgunitlib
[100%] Built target mysql_tzinfo_to_sql
[shawnyan@rocky9 release]$
安装日志
编译完成,直接进行安装。日志中,可以看到安装了几个二进制命令,以及一些配置文件和脚本。
[shawnyan@rocky9 release]$ sudo make install
[ 0%] Built target abi_check
[ 0%] Built target lz4_lib
[ 0%] Built target INFO_SRC
[ 0%] Built target INFO_BIN
[ 0%] Built target zlib
...
[100%] Built target mysqld
[100%] Built target sqlgunitlib
[100%] Built target mysql_tzinfo_to_sql
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/mysql/./README
...
-- Installing: /usr/local/mysql/bin/mysql_config
-- Installing: /usr/local/mysql/bin/mysqldumpslow
-- Installing: /usr/local/mysql/bin/mysqld_multi
-- Installing: /usr/local/mysql/bin/mysqld_safe
-- Installing: /usr/local/mysql/my.cnf
-- Installing: /usr/local/mysql/mysql_server
-- Installing: /usr/local/mysql/install.sh
-- Installing: /usr/local/mysql/reinstall.sh
-- Installing: /usr/local/mysql/support-files/mysqld_multi.server
-- Installing: /usr/local/mysql/support-files/mysql-log-rotate
-- Installing: /usr/local/mysql/support-files/magic
-- Installing: /usr/local/mysql/share/aclocal/mysql.m4
-- Installing: /usr/local/mysql/support-files/mysql.server
启动日志
安装完成,对 StoneDB 进行数据初始化,并启动数据库。
[mysql@rocky9 mysql]$ ./bin/mysqld --initialize
2023-11-12T00:29:25.724443Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-11-12T00:29:25.936358Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-11-12T00:29:25.968770Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-11-12T00:29:26.055356Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 88cba90a-80f2-11ee-bdca-000c2919b58f.
2023-11-12T00:29:26.056284Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-11-12T00:29:26.277207Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-11-12T00:29:26.277310Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-11-12T00:29:26.277919Z 0 [Warning] CA certificate ca.pem is self signed.
2023-11-12T00:29:26.291107Z 1 [Note] A temporary password is generated for root@localhost: r6K_oTsETP