Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of Percona Server and installation notes of tokudb engine

2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Installation of Percona Server and installation notes of tokudb engine

July 7, 2017

Install percona server:

Yum localinstall Percona-Server-client-57-5.7.18-15.1.el6.x86_64.rpm Percona-Server-shared-57-5.7.18-15.1.el6.x86_64.rpm Percona-Server-server-57-5.7.18-15.1.el6.x86_64.rpm Percona-Server-tokudb-57-5.7.18-15.1.el6.x86_64.rpm

The jmelloc component is installed automatically during the installation process.

/ etc/my.cnf is as follows:

[client]

Port = 3306

Socket = / tmp/mysql.sock

[mysqld]

Port = 3306

Socket = / tmp/mysql.sock

Datadir = / var/lib/mysql

Innodb_file_per_table=ON

Character-set-server = utf8

Server_id=1000

Join_buffer_size = 256K

Thread_stack = 256K

Default_storage_engine = InnoDB

Max_connections = 2000

# slave-skip-errors = 1032 and 1062

# performance-related tuning

# Skip external locking, which is used to lock MyISAM data tables under multi-process conditions

Skip-external-locking

Sort_buffer_size = 4m

Read_buffer_size = 4m

Read_rnd_buffer_size = 4m

Myisam_sort_buffer_size = 64m

# Adaptive hash index, which may lead to insufficient system resources and wait for a large number of spin waits and lock waits locks in high concurrency and complex sql scenarios, resulting in crash

Skip-innodb_adaptive_hash_index

# number of open tables for all threads

Table_open_cache = 2048

# buffer size of index block

Key_buffer_size = 128m

# size of MySQL query result buffer

Query_cache_type = OFF

Query_cache_size = 0

# handle a large number of packets

Max_allowed_packet = 16m

# 1G = > 8 2G = > 16 3G = > 32 > 3G = > 64

# number of reusable threads in the cache

Thread_cache_size = 64

Event_scheduler = 1

Long_query_time = 1

Slow_query_log=1

Slow_query_log_file = / var/lib/mysql/log-slow-queries.log

Log-error = / var/lib/mysql/error.log

Max_binlog_size = 256m

Transaction_isolation = READ-COMMITTED

# innodb_io_capacity=1000

Master_info_repository = TABLE

Relay_log_info_repository = TABLE

Relay_log_recovery = 1 # crash safe

Log-bin=mysql-bin

Binlog_format=row

Sync_binlog = 1

Log-slave-updates

Log_bin_trust_function_creators = 1

Binlog_rows_query_log_events=ON

Expire_logs_days = 5

Auto_increment_increment=1

Auto_increment_offset=1

Skip-slave-start

Skip-name-resolve

Binlog_cache_size = 16m

Binlog_stmt_cache_size=16M

# innodb settings#

Innodb_buffer_pool_instances = 4 # is less than the number of logical CPU. Make it as large as possible.

Innodb_log_buffer_size = 16777216

Innodb_read_io_threads = 4 # less than the number of logical CPU / 2, make it as large as possible

Innodb_write_io_threads=4 # set password=PASSWORD ('Abcd@1234')

> flush privileges

> exit

Then, start installing the tokudb engine:

Official detailed installation steps: https://www.percona.com/doc/percona-server/5.7/tokudb/tokudb_installation.html

1 disable Transparent huge pages

Cat / sys/kernel/mm/transparent_hugepage/enabled

[always] madvise never

Always represents enabled

Echo never > / sys/kernel/mm/transparent_hugepage/enabled

Echo never > / sys/kernel/mm/transparent_hugepage/defrag

# write settings to a file to prevent loss of restart configuration

Echo 'echo never > / sys/kernel/mm/transparent_hugepage/enabled' > > / etc/rc.local

Echo 'echo never > / sys/kernel/mm/transparent_hugepage/defrag' > > / etc/rc.local

2. Install and enable the tokudb engine:

# # you can install it using the INSTALL PLUGIN method, or you can configure it using the tool ps_tokudb_admin (ps_tokudb_admin is recommended)

Execute ps_tokudb_admin-uroot-pAbcd@1234-- enable

Will automatically be configured in / etc/my.cnf by adding the following line 1

[mysqld_safe]

Thp-setting=never

Then execute ps_tokudb_admin-uroot-pAbcd@1234-- enable-backup

Will automatically be configured in / etc/my.cnf by adding the following line 1

[mysqld_safe]

Preload-hotbackup

This completes the installation of the TokuDB engine plugin and TokuBackup plugin plug-ins.

Restart the mysqld process.

/ etc/init.d/mysql restart

Mysql-uroot-pAbcd@1234

> show engines

> show plugins

> SELECT @ @ tokudb_version

You can see that tokudb is enabled.

In this case, if we restart mysqld or the entire server, the tokudb engine can automatically load again when mysql restarts.

After installing the tokudb engine, we can also customize the parameters of tokudb in / etc/my.cnf. For example, the following 2 lines:

# tokudb settings #

Tokudb_cache_size = 5G # this parameter is set according to the number of tables that may be used by the tokudb engine in your service

Tokudb_row_format=tokudb_zlib # sets the default tokudb line format, with tokudb_zlib and tokudb_lzma

In addition, there are some tokudb-specific configuration parameters that can be added to / etc/my.cnf, such as the following partial configuration:

For the line mode of # TokuDB, it is recommended to use FAST. If disk space is tight, SMALL is recommended.

# tokudb_default: sets the default compression behavior. In TokuDB version 7.1.0, the zlib library is used by default for compression, and future versions may change.

# tokudb_fast: use the compression mode of the quicklz library.

# tokudb_small: use the compression mode of the lzma library.

# tokudb_zlib: uses the compression mode of the zlib library to provide a medium compression ratio and medium CPU consumption.

# tokudb_quicklz: uses the compression mode of the quicklz library to provide a lightweight compression ratio and low basic CPU consumption.

# tokudb_lzma: use lzma library compression mode to provide high compression ratio and high CPU consumption.

# tokudb_uncompressed: no compression mode is used.

# tokudb_row_format = tokudb_small

Tokudb_row_format = tokudb_fast

Tokudb_cache_size = 1G # half of the recommended memory

Tokudb_commit_sync = 0

Tokudb_directio = 1

Tokudb_read_block_size = 128K

Tokudb_read_buf_size = 128K

Optimizer_switch = 'mrr=on,mrr_cost_based=off'

Tokudb-data-dir = / mydata/3306/tokudbData

Tokudb-log-dir = / mydata/3306/tokudbLog

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 224

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report