重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

mha相关设置

/etc/my.cnf

在瑞金等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供成都网站建设、做网站 网站设计制作定制开发,公司网站建设,企业网站建设,成都品牌网站建设,成都全网营销推广,成都外贸网站建设公司,瑞金网站建设费用合理。

read_only=on

启动项加入 --relay-log-purge=off

/etc/systemd/system/MySQL.service

# Simple MySQL systemd service file

#

# systemd supports lots of fancy features, look here (and linked docs) for a full list: 

#  http://www.freedesktop.org/software/systemd/man/systemd.exec.html

#

# Note: this file ( /usr/lib/systemd/system/mysql.service )

# will be overwritten on package upgrade, please copy the file to 

#

#  /etc/systemd/system/mysql.service 

#  

# to make needed changes.

# systemd-delta can be used to check differences between the two mysql.service files.

#

[Unit]

Description=MySQL Community Server

After=network.target

After=syslog.target

[Install]

WantedBy=multi-user.target

Alias=mysql.service

[Service]

User=mysql

Group=mysql

# Execute pre and post scripts as root

PermissionsStartOnly=true

# Needed to create system tables etc.

#ExecStartPre=/usr/bin/mysql-systemd-start pre

# Start main service

ExecStart=/usr/local/mysql/bin/mysqld_safe --relay-log-purge=0

# Don't signal startup success before a ping works

#ExecStartPost=/usr/bin/mysql-systemd-start post

# Give up if ping don't get an answer

TimeoutSec=600

Restart=always

PrivateTmp=false

不自动清理relay log 用作业的方式清理

清理时调用 mha_node 工具 purge_relay_logs

cat purge_relay_log.sh 


#!/bin/bash

user=root

passwd=123456

port=3306

log_dir='/data/masterha/log'

work_dir='/data'

purge='/usr/local/bin/purge_relay_logs'


if [ ! -d $log_dir ]

then

   mkdir $log_dir -p

fi


$purge --user=$user --password=$passwd --disable_relay_log_purge --port=$port --workdir=$work_dir >> $log_dir/purge_relay_logs.log 2>&1



文章题目:mha相关设置
标题链接:http://cqcxhl.com/article/jedhgs.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP