1.安裝mariadb 10.2
1.1 添加yum源
[root@oldboy ~]# cat /etc/yum.repos.d/mariadb.repo
# MariaDB 10.2 CentOS repository list - created 2020-12-01 01:57 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
1.2 安裝命令
yum install MariaDB-server MariaDB-client -y
1.3 登錄
mysql
MariaDB [(none)]> show engines;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | Stores tables as CSV files | NO | NO | NO |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
| MyISAM | YES | Non-transactional engine with good performance and small data footprint | NO | NO | NO |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
# 可以看到是沒有TokuDB的
2. 安裝TokuDB 引擎(需要關(guān)閉mariadb)
systemctl stop mariadb
yum install MariaDB-tokudb-engine
2.2 在Linux上檢查對(duì)透明HugePage的支持
如果該路徑不存在,則不會(huì)啟用“透明大頁(yè)面”,可以繼續(xù)。
cat /sys/kernel/mm/transparent_hugepage/enabled
如果返回的是下邊這樣 則表示沒有啟用 可以繼續(xù)
always madvise [never]
如果返回的是下邊這樣 透明大頁(yè)面已啟用薄榛,您將需要禁用它們
[always] madvise never
禁用: 在Centos或RedHat上幸缕,您可以執(zhí)行以下操作:
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag
# 更新grub(引導(dǎo)加載程序):
grub2-mkconfig -o /boot/grub2/grub.cfg "$@"
2.3 重新啟動(dòng)mariadb
systemctl start mariadb
mysql
MariaDB [(none)]> show engines;
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| Engine | Support | Comment | Transactions | XA | Savepoints |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
| MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
| CSV | YES | Stores tables as CSV files | NO | NO | NO |
| SEQUENCE | YES | Generated tables filled with sequential values | YES | NO | YES |
| MyISAM | YES | Non-transactional engine with good performance and small data footprint | NO | NO | NO |
| TokuDB | YES | Percona TokuDB Storage Engine with Fractal Tree(tm) Technology | YES | YES | YES |
| MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
| InnoDB | DEFAULT | Supports transactions, row-level locking, foreign keys and encryption for tables | YES | YES | YES |
| Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
| PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
+--------------------+---------+----------------------------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)