• CentOS 下编译安装AliSQL


    CentOS 下编译安装AliSQL

    一、编译安装AliSQL前的准备工作
    1、编译源码所需的工具和库
    yum install gcc gcc-c++ ncurses-devel perl
    2、安装cmake,或从https://cmake.org/download/下载所需版本
    1)、wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
    2)、tar -zxvf cmake-2.8.10.2.tar.gz
    3)、cd cmake-2.8.10.2
    4)、./bootstrap ; make ; make install
    5)、cd ~
    3、安装bison,从http://ftp.gnu.org/gnu/bison/下载所需版本
    1)、tar -zxvf bison-2.7.tar.gz
    2)、sudo yum install bison-2.7
    3)、cd ~
    二、设置AliSQL用户和组
    1、增加AliSQL用户和组
    groupadd mysql
    2、新增AliSQL用户
    useradd -r -g mysql mysql
    三、AliSQL所需目录
    1、新建AliSQL安装目录
    mkdir –p /usr/local/mysql
    2、新建AliSQL数据库数据文件目录
    mkdir -p /data/mysqldb
    四、下载AliSQL源码并解压
    从https://github.com/alibaba/AliSQL下载源码
    1)、解压
    unzip AliSQL-master.zip
    2)、cd AliSQL-master
    五、编译安装AliSQL
    1、设置编译参数
    cmake
    -DCMAKE_INSTALL_PREFIX=/opt/alisql
    -DMYSQL_UNIX_ADDR=/opt/alisql/data30306/tmp/mysql.sock
    -DDEFAULT_CHARSET=utf8mb4
    -DDEFAULT_COLLATION=utf8mb4_general_ci
    -DWITH_INNOBASE_STORAGE_ENGINE=1
    -DWITH_ARCHIVE_STORAGE_ENGINE=1
    -DWITH_BLACKHOLE_STORAGE_ENGINE=1
    -DMYSQL_DATADIR=/opt/alisql/data30306/data
    -DMYSQL_TCP_PORT=30306
    -DENABLE_DOWNLOADS=1
    或者:
    cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8mb4 -DDEFAULT_COLLATION=utf8mb4_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/opt/mysqldata -DMYSQL_TCP_PORT=30306 -DENABLE_DOWNLOADS=1
    注:
    重新运行配置,需要删除CMakeCache.txt文件
    rm CMakeCache.txt
    2、编译源码
    make
    3、安装
    make install
    六、修改AliSQL目录所有者和组
    1、修改AliSQL安装目录
    1)、cd /usr/local/mysql
    2)、chown -R mysql:mysql .
    2、修改AliSQL数据库文件目录
    1)、cd /data/mysqldb
    2)、chown -R mysql:mysql .
    七、初始化AliSQL数据库
    cd /usr/local/mysql
    scripts/mysql_install_db --user=mysql --datadir=/opt/alisql/data30306/data
    注:
    初始化数据库出现错误: FATAL ERROR:please install the following Perl modules before executingscripts/mysql_install_db: Data::Dumper
    安装:autoconf库
    命令:yum –y install autoconf //此包安装时会安装Data::Dumper
    再次执行初始化AliSQL数据库命令
    八、复制AliSQL服务启动配置文件
    cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf
    注:如果/etc/my.cnf文件存在,则覆盖
    九、复制AliSQL服务启动脚本及加入path路径
    cp support-files/mysql.server /etc/init.d/mysqld
    vim /etc/profile
    PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
    export PATH
    source/etc/profile
    十、启动AliSQL服务并加入开机自启动(可选)
    service mysqld start
    chkconfig --level 35 mysqld on
    十一、检查服务是否启动
    netstat -tulnp | grep 30306
    mysql -u root -p

    ###################
    配置文件:
    AliSQL large.cnf

    [mysqld]
    socket = /opt/alisql/data30306/tmp/mysql.sock
    datadir = /opt/alisql/data30306/data
    tmpdir = /opt/alisql/data30306/tmp

    port = 30306
    back_log = 3000
    character_set_server = utf8mb4
    max_connect_errors = 100
    max_connections = 16050
    max_user_connections = 16050
    max_heap_table_size = 64M
    max_allowed_packet = 1024M
    max_binlog_size = 500M
    thread_stack = 256K
    interactive_timeout = 7200
    wait_timeout = 86400
    sort_buffer_size = 848KB
    read_buffer_size = 848KB
    read_rnd_buffer_size = 432KB
    join_buffer_size = 432KB
    net_buffer_length = 16K
    thread_cache_size = 100
    ft_min_word_len = 4
    transaction_isolation = READ-COMMITTED
    tmp_table_size = 262144
    table_open_cache = 1024
    skip_name_resolve
    explicit_defaults_for_timestamp=true
    core-file
    lower_case_table_names = 1
    log_bin_trust_function_creators = 1
    log-bin = /opt/alisql/data30306/mysql/mysql-bin.log
    log-bin-index = /opt/alisql/data30306/mysql/master-log-bin.index
    log-error = /opt/alisql/data30306/mysql/master-error.log
    relay-log = /opt/alisql/data30306/mysql/slave-relay.log
    relay-log-info-file = /opt/alisql/data30306/mysql/slave-relay-log.info
    relay-log-index = /opt/alisql/data30306/mysql/slave-relay-log.index
    master-info-file = /opt/alisql/data30306/mysql/master.info
    log-slave-updates = 1
    binlog_cache_size = 2048KB
    sync_binlog = 1000
    log_warnings
    slow_query_log_file = /opt/alisql/data30306/mysql/slow_query.log
    slow_query_log = 1
    log_output = TABLE
    long_query_time = 1
    binlog_format = ROW
    server_id = 710621770
    auto_increment_increment = 1
    auto_increment_offset = 1
    slave_net_timeout = 60
    key_buffer_size = 16M
    bulk_insert_buffer_size = 4M
    myisam_sort_buffer_size = 262144
    myisam_max_sort_file_size = 2048K
    myisam_repair_threads = 1
    myisam_recover_options = FORCE
    innodb_data_home_dir = /opt/alisql/data30306/mysql
    innodb_log_group_home_dir = /opt/alisql/data30306/mysql
    innodb_additional_mem_pool_size = 2097152
    innodb_buffer_pool_size = 52429M
    innodb_data_file_path = ibdata1:200M:autoextend
    innodb_file_per_table
    innodb_file_io_threads = 4
    innodb_flush_log_at_trx_commit = 2
    innodb_log_buffer_size = 8M
    innodb_log_file_size = 1500M
    innodb_log_files_in_group = 2
    innodb_max_dirty_pages_pct = 75
    innodb_flush_method = O_DIRECT
    innodb_lock_wait_timeout = 5000
    innodb_doublewrite = 1
    innodb_rollback_on_timeout = OFF
    innodb_autoinc_lock_mode = 1
    innodb_read_io_threads = 4
    innodb_write_io_threads = 4
    innodb_io_capacity = 2000
    innodb_purge_threads = 1
    master_info_repository = TABLE
    relay_log_info_repository = TABLE
    query_cache_type = 0
    concurrent_insert = 1
    query_cache_limit = 1048576
    query_cache_min_res_unit = 1K
    log-slow-admin-statements
    innodb_stats_on_metadata = OFF
    innodb_file_format = Barracuda
    innodb_read_ahead = 0
    innodb_thread_concurrency = 0
    innodb_sync_spin_loops = 100
    innodb_spin_wait_delay = 30
    default_storage_engine = InnoDB
    innodb_stats_sample_pages = 8
    open_files_limit = 65535
    gtid_mode = ON
    loose_rds-anonymous-in-gtid-out-enable = 1
    enforce-gtid-consistency = 1
    loose_opt_rds_enable_show_slave_lag = on
    loose_performance_schema = off
    loose_innodb_rds_buffer_pool_file_del = ON
    loose_binlog_order_commits = OFF
    innodb_ft_max_token_size = 84
    log_bin_use_v1_row_events = 1
    loose_innodb_rds_autoinc_persistent_interval = 1
    delay_key_write = ON
    key_cache_division_limit = 100
    innodb_old_blocks_pct = 37
    loose_rds_gtid_precommit = ON
    loose_implicit_primary_key = 1
    ft_query_expansion_limit = 20
    loose_rds_binlog_group_commit_sync_no_delay_count = 0
    loose_tokudb_checkpointing_period = 60
    loose_thread_pool_stall_limit = 30
    loose_innodb_log_compressed_pages = OFF
    init_connect = ''
    innodb_print_all_deadlocks = OFF
    delayed_insert_timeout = 300
    connect_timeout = 10
    loose_thread_pool_oversubscribe = 10
    loose_max_statement_time = 120000
    loose_tokudb_commit_sync = ON
    binlog_stmt_cache_size = 32768
    net_retry_count = 10
    binlog_checksum = CRC32
    low_priority_updates = 0
    loose_tokudb_support_xa = ON
    loose_rds_slave_minor_log = ON
    autocommit = 1
    loose_rds_force_archive_to_tokudb = ON
    loose_rds_set_connection_id_enabled = ON
    key_cache_age_threshold = 300
    innodb_concurrency_tickets = 5000
    loose_innodb_rds_log_checksum_algorithm = INNODB
    table_definition_cache = 512
    loose_rds_binlog_group_commit_sync_delay = 0
    loose_rds_force_myisam_to_innodb = ON
    loose_rds_check_core_file_enabled = ON
    loose_tokudb_rpl_lookup_rows = OFF
    innodb_use_native_aio = 0
    net_write_timeout = 60
    loose_rds_threads_running_high_watermark = 50000
    innodb_table_locks = ON
    query_alloc_block_size = 8192
    loose_tokudb_fs_reserve_percent = 5
    max_prepared_stmt_count = 16382
    loose_rds_enable_skip_counter = ON
    innodb_thread_sleep_delay = 10000
    net_read_timeout = 30
    loose_innodb_rds_min_concurrency_tickets = 50
    loose_rds_ic_reduce_hint_enable = OFF
    max_write_lock_count = 102400
    innodb_old_blocks_time = 1000
    innodb_stats_method = nulls_equal
    loose_rds_deny_drop_db_contain_foreign_key = ON
    max_length_for_sort_data = 1024
    query_prealloc_size = 8192
    innodb_large_prefix = OFF
    delayed_insert_limit = 100
    group_concat_max_len = 1024
    innodb_disable_sort_file_cache = ON
    innodb_ft_min_token_size = 3
    loose_rds_enable_log_global_var_update = ON
    loose_opt_rds_last_error_gtid = ON
    loose_skip_symbolic_links = ON
    key_cache_block_size = 1024
    loose_tokudb_directio = OFF
    slow_launch_time = 2
    loose_tokudb_fsync_log_period = 0
    loose_thread_handling = "one-thread-per-connection"
    loose_rds_allow_unsafe_stmt_with_gtid = ON
    innodb_online_alter_log_max_size = 134217728
    innodb_open_files = 300
    eq_range_index_dive_limit = 10
    loose_innodb_adaptive_hash_index_parts = 8
    div_precision_increment = 4
    binlog_row_image = full
    loose_tokudb_row_format = tokudb_zlib
    innodb_strict_mode = OFF
    read_only = 1
    delayed_queue_size = 1000
    default_week_format = 0
    loose_opt_rds_enable_restrict_non_super_user = ON
    loose_rds_expand_fast_index_creation = ON
    log_queries_not_using_indexes = OFF
    innodb_read_ahead_threshold = 56
    loose_rds_audit_row_limit = 100000
    loose_slave_parallel_workers = 0
    loose_rds_disable_explicit_trans = ON
    default_time_zone = SYSTEM
    loose_rds_slave_read_no_lock = ON
    loose_rds_restrict_stmt_for_mscheck = ON
    sql_mode = ''
    loose_rds_enable_shield_var = ON
    slave_exec_mode = strict
    loose_opt_rds_audit_log_enabled = 1
    query_cache_size = 0
    innodb_adaptive_hash_index = ON
    performance_schema = OFF
    innodb_purge_batch_size = 300
    loose_rds_file_operation_local_only = ON
    loose_innodb_rds_adaptive_tickets_algo = ON
    loose_innodb_rds_autoinc_persistent = ON
    loose_rpl_semi_sync_slave_trace_level = 1
    loose_rpl_semi_sync_master_timeout = 1000
    loose_rpl_semi_sync_master_trace_level = 1
    loose_rpl_semi_sync_slave_enabled = ON
    loose_rpl_semi_sync_master_enabled = ON
    loose_rpl_semi_sync_master_wait_no_slave = ON

    [mysqldump]
    quick
    max_allowed_packet = 64M

    [mysql]
    no-auto-rehash
    prompt = "\u@\h : \d \R:\m:\s> "

    [myisamchk]
    key_buffer = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M

    [mysqlhotcopy]
    interactive-timeout

    [mysqld_safe]
    user = mysql
    basedir = /opt/alisql

    [mysql_install_db]
    basedir = /opt/alisql

    #########################

    AliSQL middle.cnf

    [mysqld]
    socket = /home/alisql/data3029/tmp/mysql.sock
    datadir = /home/alisql/data3029/dbs3029
    tmpdir = /home/alisql/data3029/tmp
    port = 3029
    back_log = 3000
    character_set_server = utf8mb4
    max_connect_errors = 100
    max_connections = 4050
    max_user_connections = 4050
    max_heap_table_size = 64M
    max_allowed_packet = 1024M
    max_binlog_size = 500M
    thread_stack = 256K
    interactive_timeout = 7200
    wait_timeout = 86400
    sort_buffer_size = 848KB
    read_buffer_size = 848KB
    read_rnd_buffer_size = 432KB
    join_buffer_size = 432KB
    net_buffer_length = 16K
    thread_cache_size = 100
    ft_min_word_len = 4
    transaction_isolation = READ-COMMITTED
    tmp_table_size = 2097152
    table_open_cache = 2000
    skip_name_resolve
    core-file
    lower_case_table_names = 1
    log_bin_trust_function_creators = 1
    log-bin = /home/alisql/data3029/mysql/mysql-bin.log
    log-bin-index = /home/alisql/data3029/mysql/master-log-bin.index
    log-error = /home/alisql/data3029/mysql/master-error.log
    relay-log = /home/alisql/data3029/mysql/slave-relay.log
    relay-log-info-file = /home/alisql/data3029/mysql/slave-relay-log.info
    relay-log-index = /home/alisql/data3029/mysql/slave-relay-log.index
    master-info-file = /home/alisql/data3029/mysql/master.info
    log-slave-updates = 1
    binlog_cache_size = 2048KB
    sync_binlog = 1
    log_warnings
    slow_query_log_file = /home/alisql/data3029/mysql/slow_query.log
    slow_query_log = 1
    log_output = TABLE
    long_query_time = 1
    binlog_format = ROW
    server_id = 1482959851
    auto_increment_increment = 1
    auto_increment_offset = 1
    slave_net_timeout = 60
    key_buffer_size = 16M
    bulk_insert_buffer_size = 4M
    myisam_sort_buffer_size = 262144
    myisam_max_sort_file_size = 2048K
    myisam_repair_threads = 1
    myisam_recover_options = FORCE
    innodb_data_home_dir = /home/alisql/data3029/mysql
    innodb_log_group_home_dir = /home/alisql/data3029/mysql
    innodb_additional_mem_pool_size = 2097152
    innodb_buffer_pool_size = 13108M
    innodb_data_file_path = ibdata1:200M:autoextend
    innodb_file_per_table
    innodb_file_io_threads = 4
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 8M
    innodb_log_file_size = 1500M
    innodb_log_files_in_group = 2
    innodb_max_dirty_pages_pct = 75
    innodb_flush_method = O_DIRECT
    innodb_lock_wait_timeout = 50
    innodb_doublewrite = 1
    innodb_rollback_on_timeout = OFF
    innodb_autoinc_lock_mode = 1
    innodb_read_io_threads = 4
    innodb_write_io_threads = 4
    innodb_io_capacity = 2000
    innodb_purge_threads = 1
    master_info_repository = TABLE
    relay_log_info_repository = TABLE
    query_cache_type = 0
    concurrent_insert = 1
    query_cache_limit = 1048576
    query_cache_min_res_unit = 1K
    log-slow-admin-statements
    innodb_stats_on_metadata = OFF
    innodb_file_format = Barracuda
    innodb_read_ahead = 0
    innodb_thread_concurrency = 0
    innodb_sync_spin_loops = 100
    innodb_spin_wait_delay = 30
    default_storage_engine = InnoDB
    innodb_stats_sample_pages = 8
    open_files_limit = 65535
    gtid_mode = ON
    loose_rds-anonymous-in-gtid-out-enable = 1
    enforce-gtid-consistency = 1
    loose_opt_rds_enable_show_slave_lag = on
    loose_performance_schema = off
    loose_innodb_rds_buffer_pool_file_del = ON
    loose_binlog_order_commits = OFF
    innodb_ft_max_token_size = 84
    loose_opt_rds_enable_set_default_engine = OFF
    log_bin_use_v1_row_events = 1
    loose_innodb_rds_autoinc_persistent_interval = 1
    delay_key_write = ON
    key_cache_division_limit = 100
    innodb_old_blocks_pct = 37
    loose_rds_gtid_precommit = ON
    loose_implicit_primary_key = 1
    ft_query_expansion_limit = 20
    loose_rds_binlog_group_commit_sync_no_delay_count = 0
    loose_tokudb_checkpointing_period = 60
    loose_thread_pool_stall_limit = 30
    loose_innodb_log_compressed_pages = OFF
    init_connect = ''
    innodb_print_all_deadlocks = OFF
    delayed_insert_timeout = 300
    loose_thread_pool_oversubscribe = 10
    loose_max_statement_time = 0
    loose_tokudb_commit_sync = ON
    binlog_stmt_cache_size = 32768
    net_retry_count = 10
    binlog_checksum = CRC32
    low_priority_updates = 0
    loose_tokudb_support_xa = ON
    loose_rds_slave_minor_log = OFF
    autocommit = 1
    loose_rds_set_connection_id_enabled = ON
    key_cache_age_threshold = 300
    innodb_concurrency_tickets = 5000
    loose_innodb_rds_log_checksum_algorithm = INNODB
    table_definition_cache = 512
    loose_rds_binlog_group_commit_sync_delay = 0
    loose_rds_check_core_file_enabled = ON
    loose_tokudb_rpl_lookup_rows = OFF
    innodb_use_native_aio = 0
    net_write_timeout = 60
    loose_rds_threads_running_high_watermark = 50000
    innodb_table_locks = ON
    query_alloc_block_size = 8192
    loose_tokudb_fs_reserve_percent = 5
    max_prepared_stmt_count = 16382
    loose_rds_enable_skip_counter = ON
    innodb_thread_sleep_delay = 10000
    net_read_timeout = 30
    loose_innodb_rds_min_concurrency_tickets = 50
    loose_rds_ic_reduce_hint_enable = OFF
    max_write_lock_count = 102400
    innodb_old_blocks_time = 1000
    innodb_stats_method = nulls_equal
    loose_rds_deny_drop_db_contain_foreign_key = ON
    max_length_for_sort_data = 1024
    query_prealloc_size = 8192
    loose_opt_rds_last_trx_enabled = ON
    innodb_large_prefix = OFF
    delayed_insert_limit = 100
    group_concat_max_len = 1024
    innodb_disable_sort_file_cache = ON
    loose_tokudb_buffer_pool_ratio = 0
    loose_innodb_rds_autoinc_persistent = ON
    innodb_ft_min_token_size = 3
    loose_rds_enable_log_global_var_update = ON
    loose_opt_rds_last_error_gtid = ON
    loose_skip_symbolic_links = ON
    loose_tokudb_rpl_unique_checks = OFF
    key_cache_block_size = 1024
    loose_tokudb_directio = OFF
    slow_launch_time = 2
    loose_tokudb_fsync_log_period = 0
    loose_thread_handling = "one-thread-per-connection"
    loose_rds_allow_unsafe_stmt_with_gtid = ON
    innodb_online_alter_log_max_size = 134217728
    innodb_open_files = 3000
    eq_range_index_dive_limit = 10
    loose_innodb_adaptive_hash_index_parts = 8
    div_precision_increment = 4
    binlog_row_image = full
    loose_tokudb_row_format = tokudb_zlib
    innodb_strict_mode = OFF
    delayed_queue_size = 1000
    default_week_format = 0
    loose_opt_rds_enable_restrict_non_super_user = ON
    loose_rds_expand_fast_index_creation = ON
    log_queries_not_using_indexes = OFF
    innodb_read_ahead_threshold = 56
    loose_rds_audit_row_limit = 100000
    loose_slave_parallel_workers = 8
    connect_timeout = 10
    default_time_zone = SYSTEM
    loose_rds_slave_read_no_lock = ON
    loose_rds_restrict_stmt_for_mscheck = ON
    sql_mode = ''
    loose_rds_enable_shield_var = ON
    slave_exec_mode = strict
    loose_opt_rds_audit_log_enabled = 1
    query_cache_size = 3145728
    innodb_adaptive_hash_index = ON
    performance_schema = OFF
    innodb_purge_batch_size = 300
    loose_rds_file_operation_local_only = ON
    loose_innodb_rds_adaptive_tickets_algo = ON
    loose_rpl_semi_sync_slave_trace_level = 1
    loose_rpl_semi_sync_master_timeout = 1000
    loose_rpl_semi_sync_master_trace_level = 1
    loose_rpl_semi_sync_slave_enabled = ON
    loose_rpl_semi_sync_master_enabled = ON
    loose_rpl_semi_sync_master_wait_no_slave = ON

    [mysqldump]
    quick
    max_allowed_packet = 64M

    [mysql]
    no-auto-rehash
    prompt = "\u@\h : \d \R:\m:\s> "

    [myisamchk]
    key_buffer = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M

    [mysqlhotcopy]
    interactive-timeout

    [mysqld_safe]
    user = mysql
    basedir = /opt/alisql

    [mysql_install_db]
    basedir = /opt/alisql

    #####################

    AliSQL middle.cnf

    [mysqld]
    socket = /home/alisql/data3029/tmp/mysql.sock
    datadir = /home/alisql/data3029/dbs3029
    tmpdir = /home/alisql/data3029/tmp
    port = 3029
    back_log = 3000
    character_set_server = utf8mb4
    max_connect_errors = 100
    max_connections = 4050
    max_user_connections = 4050
    max_heap_table_size = 64M
    max_allowed_packet = 1024M
    max_binlog_size = 500M
    thread_stack = 256K
    interactive_timeout = 7200
    wait_timeout = 86400
    sort_buffer_size = 848KB
    read_buffer_size = 848KB
    read_rnd_buffer_size = 432KB
    join_buffer_size = 432KB
    net_buffer_length = 16K
    thread_cache_size = 100
    ft_min_word_len = 4
    transaction_isolation = READ-COMMITTED
    tmp_table_size = 2097152
    table_open_cache = 2000
    skip_name_resolve
    core-file
    lower_case_table_names = 1
    log_bin_trust_function_creators = 1
    log-bin = /home/alisql/data3029/mysql/mysql-bin.log
    log-bin-index = /home/alisql/data3029/mysql/master-log-bin.index
    log-error = /home/alisql/data3029/mysql/master-error.log
    relay-log = /home/alisql/data3029/mysql/slave-relay.log
    relay-log-info-file = /home/alisql/data3029/mysql/slave-relay-log.info
    relay-log-index = /home/alisql/data3029/mysql/slave-relay-log.index
    master-info-file = /home/alisql/data3029/mysql/master.info
    log-slave-updates = 1
    binlog_cache_size = 2048KB
    sync_binlog = 1
    log_warnings
    slow_query_log_file = /home/alisql/data3029/mysql/slow_query.log
    slow_query_log = 1
    log_output = TABLE
    long_query_time = 1
    binlog_format = ROW
    server_id = 1482959851
    auto_increment_increment = 1
    auto_increment_offset = 1
    slave_net_timeout = 60
    key_buffer_size = 16M
    bulk_insert_buffer_size = 4M
    myisam_sort_buffer_size = 262144
    myisam_max_sort_file_size = 2048K
    myisam_repair_threads = 1
    myisam_recover_options = FORCE
    innodb_data_home_dir = /home/alisql/data3029/mysql
    innodb_log_group_home_dir = /home/alisql/data3029/mysql
    innodb_additional_mem_pool_size = 2097152
    innodb_buffer_pool_size = 13108M
    innodb_data_file_path = ibdata1:200M:autoextend
    innodb_file_per_table
    innodb_file_io_threads = 4
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 8M
    innodb_log_file_size = 1500M
    innodb_log_files_in_group = 2
    innodb_max_dirty_pages_pct = 75
    innodb_flush_method = O_DIRECT
    innodb_lock_wait_timeout = 50
    innodb_doublewrite = 1
    innodb_rollback_on_timeout = OFF
    innodb_autoinc_lock_mode = 1
    innodb_read_io_threads = 4
    innodb_write_io_threads = 4
    innodb_io_capacity = 2000
    innodb_purge_threads = 1
    master_info_repository = TABLE
    relay_log_info_repository = TABLE
    query_cache_type = 0
    concurrent_insert = 1
    query_cache_limit = 1048576
    query_cache_min_res_unit = 1K
    log-slow-admin-statements
    innodb_stats_on_metadata = OFF
    innodb_file_format = Barracuda
    innodb_read_ahead = 0
    innodb_thread_concurrency = 0
    innodb_sync_spin_loops = 100
    innodb_spin_wait_delay = 30
    default_storage_engine = InnoDB
    innodb_stats_sample_pages = 8
    open_files_limit = 65535
    gtid_mode = ON
    loose_rds-anonymous-in-gtid-out-enable = 1
    enforce-gtid-consistency = 1
    loose_opt_rds_enable_show_slave_lag = on
    loose_performance_schema = off
    loose_innodb_rds_buffer_pool_file_del = ON
    loose_binlog_order_commits = OFF
    innodb_ft_max_token_size = 84
    loose_opt_rds_enable_set_default_engine = OFF
    log_bin_use_v1_row_events = 1
    loose_innodb_rds_autoinc_persistent_interval = 1
    delay_key_write = ON
    key_cache_division_limit = 100
    innodb_old_blocks_pct = 37
    loose_rds_gtid_precommit = ON
    loose_implicit_primary_key = 1
    ft_query_expansion_limit = 20
    loose_rds_binlog_group_commit_sync_no_delay_count = 0
    loose_tokudb_checkpointing_period = 60
    loose_thread_pool_stall_limit = 30
    loose_innodb_log_compressed_pages = OFF
    init_connect = ''
    innodb_print_all_deadlocks = OFF
    delayed_insert_timeout = 300
    loose_thread_pool_oversubscribe = 10
    loose_max_statement_time = 0
    loose_tokudb_commit_sync = ON
    binlog_stmt_cache_size = 32768
    net_retry_count = 10
    binlog_checksum = CRC32
    low_priority_updates = 0
    loose_tokudb_support_xa = ON
    loose_rds_slave_minor_log = OFF
    autocommit = 1
    loose_rds_set_connection_id_enabled = ON
    key_cache_age_threshold = 300
    innodb_concurrency_tickets = 5000
    loose_innodb_rds_log_checksum_algorithm = INNODB
    table_definition_cache = 512
    loose_rds_binlog_group_commit_sync_delay = 0
    loose_rds_check_core_file_enabled = ON
    loose_tokudb_rpl_lookup_rows = OFF
    innodb_use_native_aio = 0
    net_write_timeout = 60
    loose_rds_threads_running_high_watermark = 50000
    innodb_table_locks = ON
    query_alloc_block_size = 8192
    loose_tokudb_fs_reserve_percent = 5
    max_prepared_stmt_count = 16382
    loose_rds_enable_skip_counter = ON
    innodb_thread_sleep_delay = 10000
    net_read_timeout = 30
    loose_innodb_rds_min_concurrency_tickets = 50
    loose_rds_ic_reduce_hint_enable = OFF
    max_write_lock_count = 102400
    innodb_old_blocks_time = 1000
    innodb_stats_method = nulls_equal
    loose_rds_deny_drop_db_contain_foreign_key = ON
    max_length_for_sort_data = 1024
    query_prealloc_size = 8192
    loose_opt_rds_last_trx_enabled = ON
    innodb_large_prefix = OFF
    delayed_insert_limit = 100
    group_concat_max_len = 1024
    innodb_disable_sort_file_cache = ON
    loose_tokudb_buffer_pool_ratio = 0
    loose_innodb_rds_autoinc_persistent = ON
    innodb_ft_min_token_size = 3
    loose_rds_enable_log_global_var_update = ON
    loose_opt_rds_last_error_gtid = ON
    loose_skip_symbolic_links = ON
    loose_tokudb_rpl_unique_checks = OFF
    key_cache_block_size = 1024
    loose_tokudb_directio = OFF
    slow_launch_time = 2
    loose_tokudb_fsync_log_period = 0
    loose_thread_handling = "one-thread-per-connection"
    loose_rds_allow_unsafe_stmt_with_gtid = ON
    innodb_online_alter_log_max_size = 134217728
    innodb_open_files = 3000
    eq_range_index_dive_limit = 10
    loose_innodb_adaptive_hash_index_parts = 8
    div_precision_increment = 4
    binlog_row_image = full
    loose_tokudb_row_format = tokudb_zlib
    innodb_strict_mode = OFF
    delayed_queue_size = 1000
    default_week_format = 0
    loose_opt_rds_enable_restrict_non_super_user = ON
    loose_rds_expand_fast_index_creation = ON
    log_queries_not_using_indexes = OFF
    innodb_read_ahead_threshold = 56
    loose_rds_audit_row_limit = 100000
    loose_slave_parallel_workers = 8
    connect_timeout = 10
    default_time_zone = SYSTEM
    loose_rds_slave_read_no_lock = ON
    loose_rds_restrict_stmt_for_mscheck = ON
    sql_mode = ''
    loose_rds_enable_shield_var = ON
    slave_exec_mode = strict
    loose_opt_rds_audit_log_enabled = 1
    query_cache_size = 3145728
    innodb_adaptive_hash_index = ON
    performance_schema = OFF
    innodb_purge_batch_size = 300
    loose_rds_file_operation_local_only = ON
    loose_innodb_rds_adaptive_tickets_algo = ON
    loose_rpl_semi_sync_slave_trace_level = 1
    loose_rpl_semi_sync_master_timeout = 1000
    loose_rpl_semi_sync_master_trace_level = 1
    loose_rpl_semi_sync_slave_enabled = ON
    loose_rpl_semi_sync_master_enabled = ON
    loose_rpl_semi_sync_master_wait_no_slave = ON

    [mysqldump]
    quick
    max_allowed_packet = 64M

    [mysql]
    no-auto-rehash
    prompt = "\u@\h : \d \R:\m:\s> "

    [myisamchk]
    key_buffer = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M

    [mysqlhotcopy]
    interactive-timeout

    [mysqld_safe]
    user = mysql
    basedir = /opt/alisql

    [mysql_install_db]
    basedir = /opt/alisql

    #################

    AliSQL 8C 16G.cnf

    [mysqld]
    socket = /home/alisql/30306/tmp/mysql.sock
    datadir = /home/alisql/30306/data
    tmpdir = /home/alisql/30306/tmp
    port = 30306
    back_log = 3000
    character_set_server = utf8mb4
    max_connect_errors = 100
    max_connections = 4050
    max_user_connections = 4050
    max_heap_table_size = 64M
    max_allowed_packet = 1024M
    max_binlog_size = 500M
    thread_stack = 256K
    interactive_timeout = 7200
    wait_timeout = 86400
    sort_buffer_size = 848KB
    read_buffer_size = 848KB
    read_rnd_buffer_size = 432KB
    join_buffer_size = 432KB
    net_buffer_length = 16K
    thread_cache_size = 100
    ft_min_word_len = 4
    transaction_isolation = READ-COMMITTED
    tmp_table_size = 2097152
    table_open_cache = 2000
    skip_name_resolve
    core-file
    lower_case_table_names = 1
    log_bin_trust_function_creators = 1
    log-bin = /home/alisql/30306/mysql/mysql-bin.log
    log-bin-index = /home/alisql/30306/mysql/master-log-bin.index
    log-error = /home/alisql/30306/mysql/master-error.log
    relay-log = /home/alisql/30306/mysql/slave-relay.log
    relay-log-info-file = /home/alisql/30306/mysql/slave-relay-log.info
    relay-log-index = /home/alisql/30306/mysql/slave-relay-log.index
    master-info-file = /home/alisql/30306/mysql/master.info
    log-slave-updates = 1
    binlog_cache_size = 2048KB
    sync_binlog = 1
    log_warnings
    slow_query_log_file = /home/alisql/30306/mysql/slow_query.log
    slow_query_log = 1
    log_output = TABLE
    long_query_time = 1
    binlog_format = ROW
    server_id = 1844593058
    auto_increment_increment = 1
    auto_increment_offset = 1
    slave_net_timeout = 60
    key_buffer_size = 16M
    bulk_insert_buffer_size = 4M
    myisam_sort_buffer_size = 262144
    myisam_max_sort_file_size = 2048K
    myisam_repair_threads = 1
    myisam_recover_options = FORCE
    innodb_data_home_dir = /home/alisql/30306/mysql
    innodb_log_group_home_dir = /home/alisql/30306/mysql
    innodb_additional_mem_pool_size = 2097152
    innodb_buffer_pool_size = 13108M
    innodb_data_file_path = ibdata1:200M:autoextend
    innodb_file_per_table
    innodb_file_io_threads = 4
    innodb_flush_log_at_trx_commit = 1
    innodb_log_buffer_size = 8M
    innodb_log_file_size = 1500M
    innodb_log_files_in_group = 2
    innodb_max_dirty_pages_pct = 75
    innodb_flush_method = O_DIRECT
    innodb_lock_wait_timeout = 50
    innodb_doublewrite = 1
    innodb_rollback_on_timeout = OFF
    innodb_autoinc_lock_mode = 1
    innodb_read_io_threads = 4
    innodb_write_io_threads = 4
    innodb_io_capacity = 2000
    innodb_purge_threads = 1
    master_info_repository = TABLE
    relay_log_info_repository = TABLE
    query_cache_type = 0
    concurrent_insert = 1
    query_cache_limit = 1048576
    query_cache_min_res_unit = 1K
    log-slow-admin-statements
    innodb_stats_on_metadata = OFF
    innodb_file_format = Barracuda
    innodb_read_ahead = 0
    innodb_thread_concurrency = 0
    innodb_sync_spin_loops = 100
    innodb_spin_wait_delay = 30
    default_storage_engine = InnoDB
    innodb_stats_sample_pages = 8
    open_files_limit = 65535
    gtid_mode = ON
    loose_rds-anonymous-in-gtid-out-enable = 1
    enforce-gtid-consistency = 1
    loose_performance_schema = off
    loose_binlog_order_commits = OFF
    innodb_ft_max_token_size = 84
    loose_tokudb_cache_size = 13108M
    loose_opt_rds_enable_set_default_engine = OFF
    log_bin_use_v1_row_events = 1
    loose_innodb_rds_autoinc_persistent_interval = 1
    delay_key_write = ON
    key_cache_division_limit = 100
    innodb_old_blocks_pct = 37
    loose_rds_gtid_precommit = ON
    loose_implicit_primary_key = 1
    ft_query_expansion_limit = 20
    loose_tokudb_checkpointing_period = 60
    innodb_thread_sleep_delay = 10000
    loose_innodb_log_compressed_pages = OFF
    init_connect = ''
    loose_rds_sql_select_filter = ''
    innodb_print_all_deadlocks = OFF
    delayed_insert_timeout = 300
    loose_thread_pool_stall_limit = 30
    loose_thread_pool_oversubscribe = 10
    loose_max_statement_time = 0
    loose_tokudb_commit_sync = ON
    binlog_stmt_cache_size = 32768
    net_retry_count = 10
    binlog_checksum = CRC32
    low_priority_updates = 0
    loose_tokudb_support_xa = ON
    autocommit = 1
    loose_rds_set_connection_id_enabled = ON
    key_cache_age_threshold = 300
    innodb_concurrency_tickets = 5000
    loose_innodb_rds_log_checksum_algorithm = INNODB
    table_definition_cache = 512
    loose_rds_check_core_file_enabled = ON
    loose_tokudb_rpl_lookup_rows = OFF
    innodb_use_native_aio = 0
    net_write_timeout = 60
    loose_rds_threads_running_high_watermark = 50000
    slave_exec_mode = strict
    query_alloc_block_size = 8192
    loose_tokudb_fs_reserve_percent = 5
    max_prepared_stmt_count = 16382
    net_read_timeout = 30
    loose_innodb_rds_min_concurrency_tickets = 50
    loose_rds_ic_reduce_hint_enable = OFF
    max_write_lock_count = 102400
    innodb_old_blocks_time = 1000
    innodb_stats_method = nulls_equal
    max_length_for_sort_data = 1024
    query_prealloc_size = 8192
    innodb_large_prefix = OFF
    delayed_insert_limit = 100
    group_concat_max_len = 1024
    innodb_disable_sort_file_cache = ON
    loose_tokudb_buffer_pool_ratio = 0
    loose_innodb_rds_autoinc_persistent = ON
    innodb_ft_min_token_size = 3
    loose_rds_enable_log_global_var_update = ON
    loose_opt_rds_last_error_gtid = ON
    loose_skip_symbolic_links = ON
    loose_tokudb_rpl_unique_checks = OFF
    key_cache_block_size = 1024
    loose_tokudb_directio = OFF
    slow_launch_time = 2
    loose_tokudb_fsync_log_period = 0
    loose_thread_handling = "one-thread-per-connection"
    loose_rds_allow_unsafe_stmt_with_gtid = ON
    innodb_online_alter_log_max_size = 134217728
    innodb_open_files = 3000
    eq_range_index_dive_limit = 10
    loose_rds_reset_all_filter = 0
    loose_innodb_adaptive_hash_index_parts = 8
    div_precision_increment = 4
    binlog_row_image = full
    loose_tokudb_row_format = tokudb_zlib
    innodb_strict_mode = OFF
    delayed_queue_size = 1000
    default_week_format = 0
    loose_rds_expand_fast_index_creation = ON
    log_queries_not_using_indexes = OFF
    innodb_read_ahead_threshold = 56
    loose_slave_parallel_workers = 8
    connect_timeout = 10
    default_time_zone = SYSTEM
    loose_rds_slave_read_no_lock = ON
    sql_mode = ''
    innodb_table_locks = ON
    query_cache_size = 3145728
    innodb_adaptive_hash_index = ON
    innodb_purge_batch_size = 300
    loose_innodb_rds_adaptive_tickets_algo = ON
    loose_rpl_semi_sync_slave_trace_level = 1
    loose_rpl_semi_sync_master_timeout = 1000
    loose_rpl_semi_sync_master_trace_level = 1
    loose_rpl_semi_sync_slave_enabled = OFF
    loose_rpl_semi_sync_master_enabled = OFF
    loose_rpl_semi_sync_master_wait_no_slave = ON

    [mysqldump]
    quick
    max_allowed_packet = 64M

    [mysql]
    no-auto-rehash
    prompt = "\u@\h : \d \R:\m:\s> "

    [myisamchk]
    key_buffer = 512M
    sort_buffer_size = 512M
    read_buffer = 8M
    write_buffer = 8M

    [mysqlhotcopy]
    interactive-timeout

    [mysqld_safe]
    user = mysql
    basedir = /opt/alisql

    [mysql_install_db]
    basedir = /opt/alisql

    ##################


  • 相关阅读:
    看《你必须知道的.NET》有感工厂模式的另类解读
    学习笔记:PDO
    学习笔记:mysqli预处理和事务处理
    学习笔记:mysql
    学习笔记:基础+文件操作(上传|下载)+面向对象+xml
    学习笔记:php+mysql
    学习及求职心得|PHP学习心得|IT从业者的几点体会
    flash做登录页传递值给asp.net,其他语言的也可以参照下
    rpm安装依赖问题
    让进程在后台可靠运行
  • 原文地址:https://www.cnblogs.com/wdrain/p/11528478.html
Copyright © 2020-2023  润新知