社群生態 | openEuler、龍蜥Anolis、統信UOS三大主流作業系統下編譯GreatSQL二進位制包
為了更好地支援更多作業系統及相關生態,
GreatSQL社群決定釋出
openEuler、龍蜥Anolis、統信UOS三個作業系統下的GreatSQL二進位制包。
相應的二進位制包可以訪問gitee.com上的 GreatSQL專案
下載。
-
1. 編譯環境
-
2. 編譯前準備工作
-
3. 編譯GreatSQL
-
4. 初始化並啟動GreatSQL資料庫
-
5. 執行sysbench測試
-
附錄: 編譯sysbench
1. 編譯環境
$ lscpu
Architecture: aarch64
Byte Order: Little Endian
CPU(s): 64
On-line CPU(s) list: 0-63
Thread(s) per core: 1
Core(s) per socket: 32
Socket(s): 2
NUMA node(s): 4
Model: 2
BogoMIPS: 100.00
L1d cache: 32K
L1i cache: 48K
L2 cache: 1024K
L3 cache: 16384K
NUMA node0 CPU(s): 0-15
NUMA node1 CPU(s): 16-31
NUMA node2 CPU(s): 32-47
NUMA node3 CPU(s): 48-63
Flags: fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
lscpu
是在物理機上執行的,實際編譯環境則是在這個物理機上執行的虛機中,分配了8個CPU、16G記憶體。$ cat /etc/os-release
NAME= "openEuler"
VERSION= "22.03 LTS"
ID= "openEuler"
VERSION_ID= "22.03"
PRETTY_NAME= "openEuler 22.03 LTS"
ANSI_COLOR= "0;31"
$ cat /etc/os-release
NAME= "Anolis OS"
VERSION= "8.6"
ID= "anolis"
ID_LIKE= "rhel fedora centos"
VERSION_ID= "8.6"
PLATFORM_ID= "platform:an8"
PRETTY_NAME= "Anolis OS 8.6"
ANSI_COLOR= "0;31"
HOME_URL= "
$ cat /etc/os-release
PRETTY_NAME= "UnionTech OS Server 20"
NAME= "UnionTech OS Server 20"
VERSION_ID= "20"
VERSION= "20"
ID= "uos"
HOME_URL= "
BUG_REPORT_URL= "
VERSION_CODENAME= "kongzi"
PLATFORM_ID= "platform:uelc20"
[root@yejr-uos-aarch64 ~] #
[root@yejr-uos-aarch64 ~] #
$ cat /etc/uos-release
UnionTech OS Server release 20 (kongzi)
$ cat openEuler.repo
#generic-repos is licensed under the Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
#
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v2 for more details.
[OS]
name=OS
baseurl= $basearch/
enabled=1
gpgcheck=1
gpgkey= $basearch/RPM-GPG-KEY-openEuler
[everything]
name=everything
baseurl= $basearch/
enabled=1
gpgcheck=1
gpgkey= $basearch/RPM-GPG-KEY-openEuler
...
$ cat AnolisOS-AppStream.repo
[AppStream]
name=AnolisOS- $releasever - AppStream
baseurl= $releasever/AppStream/ $basearch/os
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ANOLIS
gpgcheck=1
$ cat UniontechOS.repo
[UniontechOS- $releasever-AppStream]
name = UniontechOS $releasever AppStream
baseurl = $basearch
enabled = 1
username= $auth_u
password= $auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS- $releasever-BaseOS]
name = UniontechOS $releasever BaseOS
baseurl = $basearch
enabled = 1
username= $auth_u
password= $auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
...
2. 編譯前準備工作
$ dnf makecache
$ dnf install --skip-broken -y automake bison bison-devel boost-devel bzip2 bzip2-devel clang \
cmake cmake3 diffutils expat-devel file flex gcc gcc-c++ git jemalloc jemalloc-devel \
graphviz libaio-devel libarchive libcurl-devel libevent libevent-devel libverto-libevent libevent-doc libffi-devel libicu-devel libssh \
libtirpc libtirpc-devel libtool libxml2-devel libzstd libzstd-devel lz4-devel \
lz4-static make ncurses-devel ncurses-libs net-tools numactl numactl-devel numactl-libs openldap-clients \
openldap-devel openssl openssl-devel pam pam-devel perl perl-Env perl-JSON perl-Memoize \
perl-Time-HiRes pkg-config psmisc re2-devel readline-devel \
snappy-devel tar time unzip vim wget zlib-devel
-
-
https://fedora.pkgs.org/36/fedora-aarch64/jemalloc-devel-5.2.1-7.fc36.aarch64.rpm.html
-
原始碼包
$ tar zxf jemalloc-5.2.1.tar.gz
$ mv jemalloc-jemalloc-886e40b/
$ ./autogen.sh
$ ./configure --prefix=/usr && make && make install
-
boost,
-
patchelf,
-
rpcsvc-proto,
$ cd /opt && tar zxvf patchelf-0.14.tar.gz && cd patchelf-0.14 && ./bootstrap.sh && ./configure && make && make install
$ cd /opt && tar zxvf rpcsvc-proto-1.4.tar.gz && cd rpcsvc-proto-1.4/ && ./configure && make && make install
[root@ky10 ~] # cd /opt && tar zxvf rpcsvc-proto-1.4.tar.gz && cd rpcsvc-proto-1.4/ && ./configure && make && make install
$ ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 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.
Written by Roland McGrath and Ulrich Drepper.
3. 編譯GreatSQL
$ cat /opt/greatsql-build-tarball.sh
#!/bin/bash
MAJOR_VERSION=8
MINOR_VERSION=0
PATCH_VERSION=25
RELEASE=17
REVISION= "4733775f703"
GLIBC=`ldd --version | grep ldd | tail -n 1 | awk '{print $NF}'`
ARCH=aarch64
OS=openEuler
PKG_NAME=GreatSQL- ${MAJOR_VERSION}. ${MINOR_VERSION}. ${PATCH_VERSION}- ${RELEASE}- ${OS}-glibc ${GLIBC}- ${ARCH}BASE_DIR=/usr/ local/ ${PKG_NAME}
SRC_DIR=/opt
BOOST_SOURCE_DIR=boost_1_73_0
GREATSQL_SOURCE_DIR=greatsql-8.0.25-17
JOBS=`nproc`
# 如果你的OS環境下已安裝jemalloc,建議也啟用jemalloc編譯選項
# 如果沒有安裝jemalloc,則將本行引數註釋掉
CMAKE_EXE_LINKER_FLAGS= " -ljemalloc "
cd ${SRC_DIR}/ ${GREATSQL_SOURCE_DIR} && \
rm -fr bld && \
mkdir bld && \
cd bld && \
cmake .. -DBOOST_INCLUDE_DIR= ${SRC_DIR}/ ${BOOST_SOURCE_DIR} \
-DLOCAL_BOOST_DIR= ${SRC_DIR}/ ${BOOST_SOURCE_DIR} \
-DCMAKE_INSTALL_PREFIX= ${BASE_DIR} -DWITH_ZLIB=bundled \
-DWITH_NUMA=ON -DCMAKE_EXE_LINKER_FLAGS= " ${CMAKE_EXE_LINKER_FLAGS}" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release \
-DWITH_TOKUDB=OFF -DWITH_ROCKSDB=OFF \
-DCOMPILATION_COMMENT= "GreatSQL (GPL), Release ${RELEASE}, Revision ${REVISION}" \
-DMAJOR_VERSION= ${MAJOR_VERSION} -DMINOR_VERSION= ${MINOR_VERSION} -DPATCH_VERSION= ${PATCH_VERSION} \
-DWITH_UNIT_TESTS=OFF -DWITH_NDBCLUSTER=OFF -DWITH_SSL=system -DWITH_SYSTEMD=ON \
-DWITH_LIBEVENT=system \
&& make -j ${JOBS} && make -j ${JOBS} install
4. 初始化並啟動GreatSQL資料庫
$ groupadd mysql && useradd -g mysql mysql -s /sbin/nologin -d /dev/null
$ echo '/usr/local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/lib/' > /etc/ld.so.conf.d/greatsql.conf
$ ldconfig -p | grep -i percona
libperconaserverclient.so.21 (libc6,AArch64) => /usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/lib/libperconaserverclient.so.21
libperconaserverclient.so (libc6,AArch64) => /usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/lib/libperconaserverclient.so
# 確保沒有找不到的動態庫
$ ldd /usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/bin/mysqld | grep -i not
$ ./bin/mysqld --defaults-file=/etc/my.cnf --initialize-insecure
$ ./bin/mysqld --defaults-file=/etc/my.cnf &
$ lsof -p `pidof mysqld` | grep -i jemalloc
mysqld 85204 mysql mem REG 8,3 471696 3329101 /usr/lib64/libjemalloc.so.2
5. 執行sysbench測試
#先設定PATH
$ export PATH= $PATH:/usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/bin
$ mysqladmin create sbtest
$ cd /usr/ local/share/sysbench/
$ sysbench /usr/ local/share/sysbench/oltp_read_write.lua --mysql-host=localhost --mysql-user=root --mysql-password= "" --mysql-socket=/usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/data/mysql.sock --mysql-db=sbtest --db-driver=mysql --tables=10 --table_size=10000 prepare
$ for i in $(seq 1 3); do sysbench /usr/ local/share/sysbench/oltp_read_write.lua --mysql-host=localhost --mysql-user=root --mysql-password= "" --mysql-socket=/usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/data/mysql.sock --mysql-db=sbtest --db-driver=mysql --tables=10 --table_size=10000 --report-interval=1 --threads=8 --rand-type=uniform --db-ps-mode= disable --time=900 run > greatsql-802517- $i. log; sleep 300; done
附錄:編譯sysbench
#先做個動態庫軟連結
$ cd /usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/lib/
$ ln -s libperconaserverclient.so libmysqlclient.so
$ cd /tmp/sysbench/
$ ./autogen.sh
$ ./configure --with-mysql-includes=/usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/include/ --with-mysql-libs=/usr/ local/GreatSQL-8.0.25-17-openEuler-glibc2.34-aarch64/lib/ && make && make install
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69997641/viewspace-2947421/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 面向多樣性計算的作業系統:openEuler的開源進展與社群生態作業系統
- 【Redis】原始碼編譯二進位制包Redis原始碼編譯
- 龍蜥副理事長張東:潮蜥共引,繁榮系統軟體生態 | 2023龍蜥作業系統大會作業系統
- 浪潮資訊正式釋出基於龍蜥 Anolis OS 的伺服器作業系統 Inspur KOS伺服器作業系統
- 中興新支點加入龍蜥社群,共建作業系統開源新生態作業系統
- 龍芯+UOS系統下java環境安裝Java
- 中興通訊攜手龍蜥社群,共創繁榮生態 | 2023龍蜥作業系統大會作業系統
- Linux中國對話龍蜥社群4位理事:龍蜥作業系統捐贈的背後,是誰在推動?Linux作業系統
- 龍蜥作業系統上玩轉銅鎖密碼庫作業系統密碼
- 統信作業系統下資料庫管理利器作業系統資料庫
- 通用 GPU 領先企業登臨科技加入龍蜥社群,完成與龍蜥作業系統的相容適配GPU作業系統
- openEuler生態成長迅速,國產作業系統走出生態繁榮之路作業系統
- InfoQ專訪龍蜥社群陳緒:從CentOS 停服說起,龍蜥作業系統的開源觀CentOS作業系統
- SSD 儲存領域廠商大普微加入龍蜥社群,完成與龍蜥作業系統適配作業系統
- 去除UOS、KYLIN作業系統啟用提示作業系統
- 作業系統(二):作業系統結構作業系統
- centos7環境下二進位制編譯安裝ffmpegCentOS編譯
- 編譯好的arm版的phantomjs2.1.1二進位制包編譯JS
- 資料中心廠商超雲加入龍蜥社群,多款伺服器完成與龍蜥作業系統適配伺服器作業系統
- win10 64位系統下openssl編譯Win10編譯
- 面向雲時代的龍蜥作業系統 是 CentOS 替代的最佳選擇作業系統CentOS
- 統信UOS系統常見故障及處理方法
- 為新基建按下加速鍵:從openEuler看中國作業系統的產業生態未來作業系統產業
- 二進位制發行包還是編譯安裝編譯
- Swap, RAM, and OS Version ---主流作業系統作業系統
- 喜報!龍蜥作業系統&龍蜥社群雙雙榮登2021“科創中國”開源創新榜!作業系統
- 作業系統2—作業系統概論(下)作業系統
- 作業系統: Unix作業系統演進簡史作業系統
- 議題徵集!2023 龍蜥作業系統大會硬核啟動作業系統
- 龍蜥社群釋出首個 Anolis OS 安全指南 為使用者業務系統保駕護航
- Mysql二進位制包安裝MySql
- iOS系統分析(二)Mach-O二進位制檔案解析iOSMac
- 主流嵌入式作業系統有哪些?作業系統
- 首次!龍蜥社群生態使用者實踐精選集釋出在即
- 浪潮資訊加入,已完成與龍蜥作業系統產品相容性驗證作業系統
- hadoop64位系統編譯Hadoop編譯
- 第二章 作業系統的執行機制作業系統
- Linux作業系統核心編譯詳解(2)(轉)Linux作業系統編譯