返回顶部
首页 > 资讯 > 数据库 >MYSQL 多实例安装以及常见运维点
  • 436
分享到

MYSQL 多实例安装以及常见运维点

2024-04-02 19:04:59 436人浏览 薄情痞子
摘要

重点:配置GNR时需要所有的GNR以[ Mysqld xxx]的格式命名,否则会报找到GNR的错误 准备mysqld_multi配置文件加入多实例的配置信息 指定GNR启动实例(不要指定MYs

重点:配置GNR时需要所有的GNR以[ Mysqld xxx]的格式命名,否则会报找到GNR的错误

准备mysqld_multi配置文件加入多实例的配置信息

指定GNR启动实例(不要指定MYsqlD这个关键词)

mysqld_multi start 3308

指定端口和SOCK文件关闭实例

mysqladmin -uroot -p123456 -P3307 -S/mydata/data2/mysql.sock shutdown

指定连接实例

mysql -uroot -p123456 -S/mydata/data2/mysql.sock

指定启动实例

mysqld_multi start mysqld3307

如下为多实例的配置文件

[client]

#Socket = /mydata/data/mysql.sock

[mysqld_multi]

log=/mydata/mysqld_multi.log

#mysqld=/usr/sbin/mysqld

user=mysql

#basedir = /usr

#sql_mode=NO_ENGINE_SUBSTITUTioN,STRICT_TRANS_TABLES

[mysqld3306]

########basic settings########

user=mysql

server-id = 333

port = 3306

socket=/mydata/data/master1.sock

#skip-grant-tables

character_set_server=utf8

skip_name_resolve = 1

max_connections = 2000

max_connect_errors = 1000

datadir = /mydata/data

explicit_defaults_for_timestamp = 1

join_buffer_size = 134217728

tmp_table_size = 67108864

tmpdir = /tmp

lower_case_table_names=1

log_error = error.log

########replication settings########

master_info_repository = TABLE

relay_log_info_repository = TABLE

log_bin = bin.log

gtid_mode = on

enforce_gtid_consistency = 1

log_slave_updates

binlog_fORMat = row

relay_log = relay.log

relay_log_recovery = 1

#binlog_gtid_simple_recovery = 1

slave_skip_errors = ddl_exist_errors

########innodb settings########

innodb_buffer_pool_size = 1G

innodb_buffer_pool_instances = 8

innodb_lock_wait_timeout = 50

innodb_log_file_size = 500M

innodb_purge_threads = 4

innodb_large_prefix = 1

innodb_thread_concurrency = 64

innodb_print_all_deadlocks = 1

innodb_strict_mode = 1

innodb_sort_buffer_size = 67108864

########semi sync replication settings########

#plugin_dir=/usr/local/mysql/lib/plugin

#plugin_load = "rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"

loose_rpl_semi_sync_master_enabled = 1

loose_rpl_semi_sync_slave_enabled = 1

loose_rpl_semi_sync_master_timeout = 5000

[mysqld3307]

########basic settings########

user=mysql

server-id = 789

port = 3307

skip-grant-tables

socket=/mydata/data2/master2.sock

character_set_server=utf8

skip_name_resolve = 1

max_connections = 2000

max_connect_errors = 1000

datadir = /mydata/data2

explicit_defaults_for_timestamp = 1

join_buffer_size = 134217728

tmp_table_size = 67108864

tmpdir = /tmp

lower_case_table_names=1

log_error = error.log

########replication settings########

master_info_repository = TABLE

relay_log_info_repository = TABLE

log_bin = bin.log

gtid_mode = on

enforce_gtid_consistency = 1

log_slave_updates

binlog_format = row

relay_log = relay.log

relay_log_recovery = 1

#binlog_gtid_simple_recovery = 1

slave_skip_errors = ddl_exist_errors

########innodb settings########

innodb_buffer_pool_size = 1G

innodb_buffer_pool_instances = 8

innodb_lock_wait_timeout = 50

innodb_log_file_size = 500M

innodb_purge_threads = 4

innodb_large_prefix = 1

innodb_thread_concurrency = 64

innodb_print_all_deadlocks = 1

innodb_strict_mode = 1

innodb_sort_buffer_size = 67108864

########semi sync replication settings########

#plugin_dir=/usr/local/mysql/lib/plugin

#plugin_load = "rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so"

loose_rpl_semi_sync_master_enabled = 1

loose_rpl_semi_sync_slave_enabled = 1

loose_rpl_semi_sync_master_timeout = 5000


您可能感兴趣的文档:

--结束END--

本文标题: MYSQL 多实例安装以及常见运维点

本文链接: https://lsjlt.com/news/48357.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作