MySQL multi-instance shutdown, startup, view status

Source: Internet
Author: User

One, my.cnf configuration file
[Mysqld]####### #basic settings#########user = MySQL#bind_address =#autocommit = 0Socket =/tmp/Mysqld.sockcharacter_set_server=Utf8mb4skip_name_resolve= 1max_connections= 1000max_connect_errors= 300transaction_isolation= read-Committedexplicit_defaults_for_timestamp= 1join_buffer_size= 134217728tmp_table_size= 167108864Tmpdir= /Tmpmax_allowed_packet= 16777216Sql_mode="Strict_trans_tables,no_engine_substitution,no_zero_date,no_zero_in_date,error_for_division_by_zero,no_auto _create_user"Interactive_timeout= 1800Wait_timeout= 1800read_buffer_size= 16777216read_rnd_buffer_size= 33554432sort_buffer_size= 33554432Lower_case_table_names=1####### #log settings########Log_error =Error.logslow_query_log= 1Slow_query_log_file=slow.loglog_queries_not_using_indexes= 1log_slow_admin_statements= 1log_slow_slave_statements= 1log_throttle_queries_not_using_indexes= 10expire_logs_days= 90Long_query_time= 2Min_examined_row_limit= 100####### #replication settings########Master_info_repository =tablerelay_log_info_repository=Tablelog_bin=Bin.logsync_binlog= 1Gtid_mode=onenforce_gtid_consistency= 1Log_slave_updatesbinlog_format=Row Relay_log=Relay.logrelay_log_recovery= 1Binlog_gtid_simple_recovery= 1slave_skip_errors=ddl_exist_errors####### #innodb settings########Innodb_page_size = 16384innodb_buffer_pool_size=3ginnodb_buffer_pool_instances= 8Innodb_buffer_pool_load_at_startup= 1Innodb_buffer_pool_dump_at_shutdown= 1innodb_lru_scan_depth= 2000Innodb_lock_wait_timeout= 50innodb_io_capacity= 4000Innodb_io_capacity_max= 8000Innodb_flush_method=O_directinnodb_file_format=Barracudainnodb_file_format_max=Barracuda#Innodb_log_group_home_dir =/usr/local/redolog/#innodb_undo_directory =/usr/local/undolog/#innodb_undo_logs =#innodb_undo_tablespaces = 3Innodb_flush_neighbors = 1innodb_log_file_size=2ginnodb_log_buffer_size= 16777216innodb_purge_threads= 4Innodb_large_prefix= 1innodb_thread_concurrency= 64Innodb_print_all_deadlocks= 1Innodb_strict_mode= 1innodb_sort_buffer_size= 67108864####### #semi sync replication settings########plugin_dir=/usr/local/mysql/lib/Pluginplugin_load="rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"loose_rpl_semi_sync_master_enabled= 1loose_rpl_semi_sync_slave_enabled= 1Loose_rpl_semi_sync_master_timeout= 5000[Mysqld-5.7]innodb_buffer_pool_dump_pct= 40innodb_page_cleaners= 4innodb_undo_log_truncate= 1innodb_max_undo_log_size=1ginnodb_purge_rseg_truncate_frequency= 128Binlog_gtid_simple_recovery=1Log_timestamps=systemtransaction_write_set_extraction=murmur32show_compatibility_56=On[mysqld_multi]mysqld=/usr/local/mysql/bin/Mysqld_safemysqladmin=/usr/local/mysql/bin/Mysqladminlog=/var/log/Mysqld_multi.loguser=Rootpassword=Lianyu2016[mysqld1]server-id = 111DataDir=/mnt/ipower365/lishu/Mysqldatasocket=/mnt/ipower365/lishu/mysqldata/Mysqld.sockport= 3306PID-file =/mnt/ipower365/lishu/mysqldata/Mysqld.pidlog_error=Error.log[mysqld2]server-id = 112Socket=/mnt/ipower365/lishu/mysqldata3307/Mysqld.sockport= 3307PID-file =/mnt/ipower365/lishu/mysqldata3307/Mysqld.piddatadir=/mnt/ipower365/lishu/Mysqldata3307log_error=Error.log[mysqld3]server-id = 113Socket=/mnt/ipower365/lishu/mysqldata3308/Mysqld.sockport= 3308PID-file =/mnt/ipower365/lishu/mysqldata3308/Mysqld.piddatadir=/mnt/ipower365/lishu/Mysqldata3308log_error= Error.log
my.cnfsecond, multi-instance operation1. View status
Mysqld_multi report# Output Reporting MySQL Serversmysql server from Group:mysqld1 are Runningmysql server from Group:mysqld2 I s Runningmysql server from GROUP:MYSQLD3 is running
2. Close

Description: 3 represents the MY.CNF configuration file in Mysqld3

Mysqld_multi Stop 3
3. Start
Third, view the configuration information1. View a mysqld instance configuration delivery information

Description: No effect of adding s

My_print_defaults mysqld_multi mysqld3# Output--mysqld=/usr/local/mysql/bin/mysqld_safe--mysqladmin=/usr/local/mysql/ bin/mysqladmin--log=/var/log/mysqld_multi.log--user=root--password=*****  #脚本错误, no parameter s, passed 5 *--server-id= 113--socket=/mnt/ipower365/lishu/mysqldata3308/mysqld.sock--port=3308--pid-file=/mnt/ipower365/lishu/ Mysqldata3308/mysqld.pid--datadir=/mnt/ipower365/lishu/mysqldata3308--log_error=error.log
2. View a mysqld instance configuration delivery information

Description: The effect of adding s

My_print_defaults mysqld_multi-s  mysqld3# output--mysqld=/usr/local/mysql/bin/mysqld_safe--mysqladmin=/usr/local /mysql/bin/mysqladmin--log=/var/log/mysqld_multi.log--user=root--password=lianyu2016  #加s, the display is S. --server-id=113--socket=/mnt/ipower365/lishu/mysqldata3308/mysqld.sock--port=3308--pid-file=/mnt/ipower365/ Lishu/mysqldata3308/mysqld.pid--datadir=/mnt/ipower365/lishu/mysqldata3308--log_error=error.log
3. Script Path
[email protected] ipower365]# which mysqld_multi/usr/local/mysql/bin/mysqld_multi[[email protected] ipower365]# vim/ Usr/local/mysql/bin/mysqld_multi

Search:/my_print_defaults, look at the following parameter is not less a-s, below is the correct wording,

4. Viewing log files

MySQL multi-instance shutdown, startup, view status

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.