再谈MysqlMHA

Jun 07, 2016 pm 02:53 PM
mysql kira-kira boleh pangkalan data Ketersediaan tinggi

关于 Mysql 数据库的高可用以及 mysql 的 proxy 中间件的选型一直是个很活跃的技术话题。以高可用为例,解决方案有 mysqlndb 集群, mmm,mha,drbd 等多种选择。 Mysql 的 proxy 中间件则有 mysql-proxy,atlas,cobar,mycat,tddl 等,可谓五花八门。 以上对应

关于Mysql数据库的高可用以及mysqlproxy中间件的选型一直是个很活跃的技术话题。以高可用为例,解决方案有mysql ndb集群,mmm , mha, drbd等多种选择。Mysql proxy中间件则有mysql-proxy, atlas , cobar, mycat, tddl等,可谓五花八门。

以上对应的解决方案都有各种的优缺点,生产环境的选型的原则无非几个字:“简单,符合要求且高效!”一句话:适合自己的,才是最好的!

本文将介绍采用在mysql 13从的环境下,采用mha架构实现mysql masterha和自动failover。进而结合atlas数据库代理完成mysql数据库的整体读写请求分离,同时在atlas这层实现hafailover,避免单点故障。数据库架构设计拓扑如下:

wKiom1RPRp2j2_9SAAKyuiFj7i4157.jpg

一:环境介绍

Atlas 主:192.168.1.12/24

Atlas 从:192.168.1.81/24

Atlas vip:  192.168.1.230/24

 

Atlas write:

master192.168.1.225/24

Slave1192.168.1.226/24

Slave2192.168.1.227/24

管理节点:192.168.1.12/24

Mha vip:  192.168.1.231/24

 

Atlas  read:

Slave2192.168.1.227/24

Slave3192.168.1.228/24

 

由于文章篇幅关系,mhaatlas将分开两篇文章来介绍!

其实早在两年前就尝试过mha, 由于种种原因,当时只研究了皮毛,本文也算是对前文的一个补充! 前文传送门:http://ylw6006.blog.51cto.com/470441/890360


二:配置数据库复制这个比较简单,配置步骤省略(如有问题请百度一下!)

Master

wKioL1RPR33Q8KadAAHyDYXMwUc190.jpg

Slave:(226,227,228均为此状态)

wKioL1RPR6LSBXipAAWhcpqA56k294.jpg

二:安装及配置mha

1: 配置主机间的ssh密钥信任,此处以225服务器为例,其他服务器执行同样的操作

# ssh-keygen
# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.12
# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.225
# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.226
# ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.1.227
Salin selepas log masuk

2:安装mha,这里为了方便,直接采用rpm包形式进行安装

Rpm包下载地址,需要翻墙:
https://code.google.com/p/mysql-master-ha/downloads/detail?name=mha4mysql-manager-0.53-0.el6.noarch.rpm
 
https://code.google.com/p/mysql-master-ha/downloads/detail?name=mha4mysql-node-0.52-0.noarch.rpm
 
管理节点:
# yum -y localinstall \
mha4mysql-node-0.52-0.noarch.rpm  \
mha4mysql-manager-0.53-0.el6.noarch.rpm
 
数据库节点:
# yum -y localinstall mha4mysql-node-0.52-0.noarch.rpm
Salin selepas log masuk

3: 配置mha主配置文件

管理节点:
# mkdir -p /usr/local/mha
# mkdir -p /etc/mha
# cat /etc/mha/mha.conf
[server default]
user=root
password=123456
manager_workdir=/usr/local/mha
manager_log=/usr/local/mha/manager.log
remote_workdir=/usr/local/mha
ssh_user=root
repl_user=replication
repl_password=123456
ping_interval=1
secondary_check_script= masterha_secondary_check -s 192.168.1.226 -s 192.168.1.227
master_ip_failover_script=/usr/local/scripts/master_ip_failover
[server1]
hostname=192.168.1.225
ssh_port=22
master_binlog_dir=/mydata
candidate_master=1
[server2]
hostname=192.168.1.226
ssh_port=22
master_binlog_dir=/mydata
candidate_master=1
[server3]
hostname=192.168.1.227
ssh_port=22
master_binlog_dir=/mydata
no_master=1
Salin selepas log masuk

4:准备failover脚本

# cat /usr/local/scripts/master_ip_failover

#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
use Getopt::Long;
my (
$command, $ssh_user, $orig_master_host, $orig_master_ip,
$orig_master_port, $new_master_host, $new_master_ip, $new_master_port
);
my $vip = '192.168.1.231'; # Virtual IP
my $gateway = '192.168.1.1';#Gateway IP
my $interface = 'eth0';
my $key = "1";
my $ssh_start_vip = "/sbin/ifconfig $interface:$key $vip;/sbin/arping -I $interface -c 3 -s $vip $gateway >/dev/null 2>&1";
my $ssh_stop_vip = "/sbin/ifconfig $interface:$key down";
GetOptions(
'command=s' => \$command,
'ssh_user=s' => \$ssh_user,
'orig_master_host=s' => \$orig_master_host,
'orig_master_ip=s' => \$orig_master_ip,
'orig_master_port=i' => \$orig_master_port,
'new_master_host=s' => \$new_master_host,
'new_master_ip=s' => \$new_master_ip,
'new_master_port=i' => \$new_master_port,
);
exit &main();
sub main {
print "\n\nIN SCRIPT TEST====$ssh_stop_vip==$ssh_start_vip===\n\n";
if ( $command eq "stop" || $command eq "stopssh" ) {
# $orig_master_host, $orig_master_ip, $orig_master_port are passed.
# If you manage master ip address at global catalog database,
# invalidate orig_master_ip here.
my $exit_code = 1;
eval {
print "Disabling the VIP on old master: $orig_master_host \n";
&stop_vip();
$exit_code = 0;
};
if ($@) {
warn "Got Error: $@\n";
exit $exit_code;
}
exit $exit_code;
}
elsif ( $command eq "start" ) {
# all arguments are passed.
# If you manage master ip address at global catalog database,
# activate new_master_ip here.
# You can also grant write access (create user, set read_only=0, etc) here.
my $exit_code = 10;
eval {
print "Enabling the VIP - $vip on the new master - $new_master_host \n";
&start_vip();
$exit_code = 0;
};
if ($@) {
warn $@;
exit $exit_code;
}
exit $exit_code;
}
elsif ( $command eq "status" ) {
print "Checking the Status of the script.. OK \n";
`ssh $ssh_user\@$orig_master_host \" $ssh_start_vip \"`;
exit 0;
}
else {
&usage();
exit 1;
}
}
# A simple system call that enable the VIP on the new master
sub start_vip() {
`ssh $ssh_user\@$new_master_host \" $ssh_start_vip \"`;
}
# A simple system call that disable the VIP on the old_master
sub stop_vip() {
`ssh $ssh_user\@$orig_master_host \" $ssh_stop_vip \"`;
}
sub usage {
print
"Usage: master_ip_failover --command=start|stop|stopssh|status --orig_master_host=host --orig_master_ip=ip --orig_master_port=port --new_master_host=host --new_master_ip=ip --new_master_port=port\n";
}
Salin selepas log masuk

# chmod +x /usr/local/scripts/master_ip_failover

5:进行ssh检查

# masterha_check_ssh  --conf=/etc/mha/mha.conf

wKioL1RPSRnTud9PAAiZ-mrutkA102.jpg

# cp -rvp /usr/lib/perl5/vendor_perl/MHA  /usr/local/lib64/perl5/

(mha的数据库节点和管理节点均需要执行此步骤)

# masterha_check_ssh  --conf=/etc/mha/mha.conf

wKiom1RPSOrzCSvkAAa8p7tBqwQ456.jpg

6:进行同步检查

# masterha_check_repl --conf=/etc/mha/mha.conf

Tue Oct 28 10:58:35 2014 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Oct 28 10:58:35 2014 - [info] Reading application default configurations from /etc/mha/mha.conf..
Tue Oct 28 10:58:35 2014 - [info] Reading server configurations from /etc/mha/mha.conf..
Tue Oct 28 10:58:35 2014 - [info] MHA::MasterMonitor version 0.53.
Tue Oct 28 10:58:36 2014 - [info] Dead Servers:
Tue Oct 28 10:58:36 2014 - [info] Alive Servers:
Tue Oct 28 10:58:36 2014 - [info]   192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:36 2014 - [info]   192.168.1.226(192.168.1.226:3306)
Tue Oct 28 10:58:36 2014 - [info]   192.168.1.227(192.168.1.227:3306)
Tue Oct 28 10:58:36 2014 - [info] Alive Slaves:
Tue Oct 28 10:58:36 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 10:58:36 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:36 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 10:58:36 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 10:58:36 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:36 2014 - [info]     Not candidate for the new Master (no_master is set)
Tue Oct 28 10:58:36 2014 - [info] Current Alive Master: 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:36 2014 - [info] Checking slave configurations..
Tue Oct 28 10:58:36 2014 - [warning]  relay_log_purge=0 is not set on slave 192.168.1.227(192.168.1.227:3306).
Tue Oct 28 10:58:36 2014 - [info] Checking replication filtering settings..
Tue Oct 28 10:58:36 2014 - [info]  binlog_do_db= , binlog_ignore_db=
Tue Oct 28 10:58:36 2014 - [info]  Replication filtering check ok.
Tue Oct 28 10:58:36 2014 - [info] Starting SSH connection tests..
^CTue Oct 28 10:58:41 2014 - [info] Got terminate signal. Exit.
[root@test_redis scripts]# masterha_check_repl --conf=/etc/mha/mha.conf
Tue Oct 28 10:58:51 2014 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Oct 28 10:58:51 2014 - [info] Reading application default configurations from /etc/mha/mha.conf..
Tue Oct 28 10:58:51 2014 - [info] Reading server configurations from /etc/mha/mha.conf..
Tue Oct 28 10:58:51 2014 - [info] MHA::MasterMonitor version 0.53.
Tue Oct 28 10:58:52 2014 - [info] Dead Servers:
Tue Oct 28 10:58:52 2014 - [info] Alive Servers:
Tue Oct 28 10:58:52 2014 - [info]   192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:52 2014 - [info]   192.168.1.226(192.168.1.226:3306)
Tue Oct 28 10:58:52 2014 - [info]   192.168.1.227(192.168.1.227:3306)
Tue Oct 28 10:58:52 2014 - [info] Alive Slaves:
Tue Oct 28 10:58:52 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 10:58:52 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:52 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 10:58:52 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 10:58:52 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:52 2014 - [info]     Not candidate for the new Master (no_master is set)
Tue Oct 28 10:58:52 2014 - [info] Current Alive Master: 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 10:58:52 2014 - [info] Checking slave configurations..
Tue Oct 28 10:58:52 2014 - [info] Checking replication filtering settings..
Tue Oct 28 10:58:52 2014 - [info]  binlog_do_db= , binlog_ignore_db=
Tue Oct 28 10:58:52 2014 - [info]  Replication filtering check ok.
Tue Oct 28 10:58:52 2014 - [info] Starting SSH connection tests..
Tue Oct 28 10:58:55 2014 - [info] All SSH connection tests passed successfully.
Tue Oct 28 10:58:55 2014 - [info] Checking MHA Node version..
Tue Oct 28 10:58:55 2014 - [info]  Version check ok.
Tue Oct 28 10:58:55 2014 - [info] Checking SSH publickey authentication settings on the current master..
Tue Oct 28 10:58:56 2014 - [info] HealthCheck: SSH to 192.168.1.225 is reachable.
Tue Oct 28 10:58:56 2014 - [info] Master MHA Node version is 0.52.
Tue Oct 28 10:58:56 2014 - [info] Checking recovery script configurations on the current master..
Tue Oct 28 10:58:56 2014 - [info]   Executing command: save_binary_logs --command=test --start_pos=4 --binlog_dir=/mydata --output_file=/usr/local/mha/save_binary_logs_test --manager_version=0.53 --start_file=mysql-bin.000013
Tue Oct 28 10:58:56 2014 - [info]   Connecting to root@192.168.1.225(192.168.1.225)..
Creating /usr/local/mha if not exists..    ok.
Checking output directory is accessible or not..
ok.
Binlog found at /mydata, up to mysql-bin.000013
Tue Oct 28 10:58:56 2014 - [info] Master setting check done.
Tue Oct 28 10:58:56 2014 - [info] Checking SSH publickey authentication and checking recovery script configurations on all alive slave servers..
Tue Oct 28 10:58:56 2014 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user=root --slave_host=192.168.1.226 --slave_ip=192.168.1.226 --slave_port=3306 --workdir=/usr/local/mha --target_version=5.6.17-log --manager_version=0.53 --relay_log_info=/mydata/relay-log.info  --relay_dir=/mydata/  --slave_pass=xxx
Tue Oct 28 10:58:56 2014 - [info]   Connecting to root@192.168.1.226(192.168.1.226:22)..
Checking slave recovery environment settings..
Opening /mydata/relay-log.info ... ok.
Relay log found at /mydata, up to mysql-relay-bin.000006
Temporary relay log file is /mydata/mysql-relay-bin.000006
Testing mysql connection and privileges.. done.
Testing mysqlbinlog output.. done.
Cleaning up test file(s).. done.
Tue Oct 28 10:58:57 2014 - [info]   Executing command : apply_diff_relay_logs --command=test --slave_user=root --slave_host=192.168.1.227 --slave_ip=192.168.1.227 --slave_port=3306 --workdir=/usr/local/mha --target_version=5.6.17-log --manager_version=0.53 --relay_log_info=/mydata/relay-log.info  --relay_dir=/mydata/  --slave_pass=xxx
Tue Oct 28 10:58:57 2014 - [info]   Connecting to root@192.168.1.227(192.168.1.227:22)..
Checking slave recovery environment settings..
Opening /mydata/relay-log.info ... ok.
Relay log found at /mydata, up to mysql-relay-bin.000016
Temporary relay log file is /mydata/mysql-relay-bin.000016
Testing mysql connection and privileges.. done.
Testing mysqlbinlog output.. done.
Cleaning up test file(s).. done.
Tue Oct 28 10:58:58 2014 - [info] Slaves settings check done.
Tue Oct 28 10:58:58 2014 - [info]
192.168.1.225 (current master)
+--192.168.1.226
+--192.168.1.227
 
Tue Oct 28 10:58:58 2014 - [info] Checking replication health on 192.168.1.226..
Tue Oct 28 10:58:58 2014 - [info]  ok.
Tue Oct 28 10:58:58 2014 - [info] Checking replication health on 192.168.1.227..
Tue Oct 28 10:58:58 2014 - [info]  ok.
Tue Oct 28 10:58:58 2014 - [info] Checking master_ip_failover_script status:
Tue Oct 28 10:58:58 2014 - [info]   /usr/local/scripts/master_ip_failover --command=status --ssh_user=root --orig_master_host=192.168.1.225 --orig_master_ip=192.168.1.225 --orig_master_port=3306
 
 
IN SCRIPT TEST====/sbin/ifconfig eth0:1 down==/sbin/ifconfig eth0:1 192.168.1.231;/sbin/arping -I eth0 -c 3 -s 192.168.1.231 192.168.1.1 >/dev/null 2>&1===
 
Checking the Status of the script.. OK
Tue Oct 28 10:59:02 2014 - [info]  OK.
Tue Oct 28 10:59:02 2014 - [warning] shutdown_script is not defined.
Tue Oct 28 10:59:02 2014 - [info] Got exit code 0 (Not master dead).
 
MySQL Replication Health is OK.
Salin selepas log masuk

7: 管理节点启动manager进程

# nohup masterha_manager --conf=/etc/mha/mha.conf > /tmp/mha_manager.log  &1 &
 
# masterha_check_status --conf=/etc/mha/mha.conf
mha (pid:4228) is running(0:PING_OK), master:192.168.1.225
Salin selepas log masuk

三:测试mhafailover

1Master节点(关闭mysql进程)

wKioL1RPSaCS9TgPAAgsT84sJ3A742.jpg

2226服务器(自动获取VIP,且转换为master)

wKiom1RPSWbhoo4YAAOulWD7YAI295.jpgwKioL1RPScfgssMeAAKCP5m1Lj0299.jpg

3227服务器(自动从新的master上进行复制)

wKiom1RPSYqx_c0ZAAS_urV_eHE101.jpg

4:管理节点查看到的日志(fairover之后,mha manager进程会自动关闭)

# tail -f /usr/local/mha/manager.log

Tue Oct 28 11:31:36 2014 - [info] HealthCheck: SSH to 192.168.1.225 is reachable.
Monitoring server 192.168.1.226 is reachable, Master is not reachable from 192.168.1.226. OK.
Monitoring server 192.168.1.227 is reachable, Master is not reachable from 192.168.1.227. OK.
Tue Oct 28 11:31:37 2014 - [info] Master is not reachable from all other monitoring servers. Failover should start.
Tue Oct 28 11:31:37 2014 - [warning] Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
Tue Oct 28 11:31:37 2014 - [warning] Connection failed 1 time(s)..
Tue Oct 28 11:31:38 2014 - [warning] Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
Tue Oct 28 11:31:38 2014 - [warning] Connection failed 2 time(s)..
Tue Oct 28 11:31:39 2014 - [warning] Got error on MySQL connect: 2013 (Lost connection to MySQL server at 'reading initial communication packet', system error: 111)
Tue Oct 28 11:31:39 2014 - [warning] Connection failed 3 time(s)..
Tue Oct 28 11:31:39 2014 - [warning] Master is not reachable from health checker!
Tue Oct 28 11:31:39 2014 - [warning] Master 192.168.1.225(192.168.1.225:3306) is not reachable!
Tue Oct 28 11:31:39 2014 - [warning] SSH is reachable.
Tue Oct 28 11:31:39 2014 - [info] Connecting to a master server failed. Reading configuration file /etc/masterha_default.cnf and /etc/mha/mha.conf again, and trying to connect to all servers to check server status..
Tue Oct 28 11:31:39 2014 - [warning] Global configuration file /etc/masterha_default.cnf not found. Skipping.
Tue Oct 28 11:31:39 2014 - [info] Reading application default configurations from /etc/mha/mha.conf..
Tue Oct 28 11:31:39 2014 - [info] Reading server configurations from /etc/mha/mha.conf..
Tue Oct 28 11:31:39 2014 - [info] Dead Servers:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info] Alive Servers:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.226(192.168.1.226:3306)
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.227(192.168.1.227:3306)
Tue Oct 28 11:31:39 2014 - [info] Alive Slaves:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info] Checking slave configurations..
Tue Oct 28 11:31:39 2014 - [info] Checking replication filtering settings..
Tue Oct 28 11:31:39 2014 - [info]  Replication filtering check ok.
Tue Oct 28 11:31:39 2014 - [info] Master is down!
Tue Oct 28 11:31:39 2014 - [info] Terminating monitoring script.
Tue Oct 28 11:31:39 2014 - [info] Got exit code 20 (Master dead).
Tue Oct 28 11:31:39 2014 - [info] MHA::MasterFailover version 0.53.
Tue Oct 28 11:31:39 2014 - [info] Starting master failover.
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] * Phase 1: Configuration Check Phase..
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] Dead Servers:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info] Checking master reachability via mysql(double check)..
Tue Oct 28 11:31:39 2014 - [info]  ok.
Tue Oct 28 11:31:39 2014 - [info] Alive Servers:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.226(192.168.1.226:3306)
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.227(192.168.1.227:3306)
Tue Oct 28 11:31:39 2014 - [info] Alive Slaves:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info] ** Phase 1: Configuration Check Phase completed.
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] * Phase 2: Dead Master Shutdown Phase..
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] Forcing shutdown so that applications never connect to the current master..
Tue Oct 28 11:31:39 2014 - [info] Executing master IP deactivatation script:
Tue Oct 28 11:31:39 2014 - [info]   /usr/local/scripts/master_ip_failover --orig_master_host=192.168.1.225 --orig_master_ip=192.168.1.225 --orig_master_port=3306 --command=stopssh --ssh_user=root
 
 
IN SCRIPT TEST====/sbin/ifconfig eth0:1 down==/sbin/ifconfig eth0:1 192.168.1.231;/sbin/arping -I eth0 -c 3 -s 192.168.1.231 192.168.1.1 >/dev/null 2>&1===
 
Disabling the VIP on old master: 192.168.1.225
Tue Oct 28 11:31:39 2014 - [info]  done.
Tue Oct 28 11:31:39 2014 - [warning] shutdown_script is not set. Skipping explicit shutting down of the dead master.
Tue Oct 28 11:31:39 2014 - [info] * Phase 2: Dead Master Shutdown Phase completed.
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] * Phase 3: Master Recovery Phase..
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] * Phase 3.1: Getting Latest Slaves Phase..
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] The latest binary log file/position on all slaves is mysql-bin.000016:120
Tue Oct 28 11:31:39 2014 - [info] Latest slaves (Slaves that received relay log files to the latest):
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info] The oldest binary log file/position on all slaves is mysql-bin.000016:120
Tue Oct 28 11:31:39 2014 - [info] Oldest slaves:
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:39 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:39 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:39 2014 - [info] * Phase 3.2: Saving Dead Master's Binlog Phase..
Tue Oct 28 11:31:39 2014 - [info]
Tue Oct 28 11:31:40 2014 - [info] Fetching dead master's binary logs..
Tue Oct 28 11:31:40 2014 - [info] Executing command on the dead master 192.168.1.225(192.168.1.225:3306): save_binary_logs --command=save --start_file=mysql-bin.000016  --start_pos=120 --binlog_dir=/mydata --output_file=/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.53
Creating /usr/local/mha if not exists..    ok.
Concat binary/relay logs from mysql-bin.000016 pos 120 to mysql-bin.000016 EOF into /usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog ..
Dumping binlog format description event, from position 0 to 120.. ok.
Dumping effective binlog data from /mydata/mysql-bin.000016 position 120 to tail(143).. ok.
Concat succeeded.
Tue Oct 28 11:31:41 2014 - [info] scp from root@192.168.1.225:/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog to local:/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog succeeded.
Tue Oct 28 11:31:41 2014 - [info] HealthCheck: SSH to 192.168.1.226 is reachable.
Tue Oct 28 11:31:42 2014 - [info] HealthCheck: SSH to 192.168.1.227 is reachable.
Tue Oct 28 11:31:42 2014 - [info]
Tue Oct 28 11:31:42 2014 - [info] * Phase 3.3: Determining New Master Phase..
Tue Oct 28 11:31:42 2014 - [info]
Tue Oct 28 11:31:42 2014 - [info] Finding the latest slave that has all relay logs for recovering other slaves..
Tue Oct 28 11:31:42 2014 - [info] All slaves received relay logs to the same position. No need to resync each other.
Tue Oct 28 11:31:42 2014 - [info] Searching new master from slaves..
Tue Oct 28 11:31:42 2014 - [info]  Candidate masters from the configuration file:
Tue Oct 28 11:31:42 2014 - [info]   192.168.1.226(192.168.1.226:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:42 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:42 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:42 2014 - [info]   192.168.1.227(192.168.1.227:3306)  Version=5.6.17-log (oldest major version between slaves) log-bin:enabled
Tue Oct 28 11:31:42 2014 - [info]     Replicating from 192.168.1.225(192.168.1.225:3306)
Tue Oct 28 11:31:42 2014 - [info]     Primary candidate for the new Master (candidate_master is set)
Tue Oct 28 11:31:42 2014 - [info]  Non-candidate masters:
Tue Oct 28 11:31:42 2014 - [info]  Searching from candidate_master slaves which have received the latest relay log events..
Tue Oct 28 11:31:42 2014 - [info] New master is 192.168.1.226(192.168.1.226:3306)
Tue Oct 28 11:31:42 2014 - [info] Starting master failover..
Tue Oct 28 11:31:42 2014 - [info]
From:
192.168.1.225 (current master)
+--192.168.1.226
+--192.168.1.227
 
To:
192.168.1.226 (new master)
+--192.168.1.227
Tue Oct 28 11:31:42 2014 - [info]
Tue Oct 28 11:31:42 2014 - [info] * Phase 3.3: New Master Diff Log Generation Phase..
Tue Oct 28 11:31:42 2014 - [info]
Tue Oct 28 11:31:42 2014 - [info]  This server has all relay logs. No need to generate diff files from the latest slave.
Tue Oct 28 11:31:42 2014 - [info] Sending binlog..
Tue Oct 28 11:31:43 2014 - [info] scp from local:/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog to root@192.168.1.226:/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog succeeded.
Tue Oct 28 11:31:43 2014 - [info]
Tue Oct 28 11:31:43 2014 - [info] * Phase 3.4: Master Log Apply Phase..
Tue Oct 28 11:31:43 2014 - [info]
Tue Oct 28 11:31:43 2014 - [info] *NOTICE: If any error happens from this phase, manual recovery is needed.
Tue Oct 28 11:31:43 2014 - [info] Starting recovery on 192.168.1.226(192.168.1.226:3306)..
Tue Oct 28 11:31:43 2014 - [info]  Generating diffs succeeded.
Tue Oct 28 11:31:43 2014 - [info] Waiting until all relay logs are applied.
Tue Oct 28 11:31:43 2014 - [info]  done.
Tue Oct 28 11:31:43 2014 - [info] Getting slave status..
Tue Oct 28 11:31:43 2014 - [info] This slave(192.168.1.226)'s Exec_Master_Log_Pos equals to Read_Master_Log_Pos(mysql-bin.000016:120). No need to recover from Exec_Master_Log_Pos.
Tue Oct 28 11:31:43 2014 - [info] Connecting to the target slave host 192.168.1.226, running recover script..
Tue Oct 28 11:31:43 2014 - [info] Executing command: apply_diff_relay_logs --command=apply --slave_user=root --slave_host=192.168.1.226 --slave_ip=192.168.1.226  --slave_port=3306 --apply_files=/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog --workdir=/usr/local/mha --target_version=5.6.17-log --timestamp=20141028113139 --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.53 --slave_pass=xxx
Tue Oct 28 11:31:43 2014 - [info]
Applying differential binary/relay log files /usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog on 192.168.1.226:3306. This may take long time...
Applying log files succeeded.
Tue Oct 28 11:31:43 2014 - [info]  All relay logs were successfully applied.
Tue Oct 28 11:31:43 2014 - [info] Getting new master's binlog name and position..
Tue Oct 28 11:31:43 2014 - [info]  mysql-bin.000010:120
Tue Oct 28 11:31:43 2014 - [info]  All other slaves should start replication from here. Statement should be: CHANGE MASTER TO MASTER_HOST='192.168.1.226', MASTER_PORT=3306, MASTER_LOG_FILE='mysql-bin.000010', MASTER_LOG_POS=120, MASTER_USER='replication', MASTER_PASSWORD='xxx';
Tue Oct 28 11:31:43 2014 - [info] Executing master IP activate script:
Tue Oct 28 11:31:43 2014 - [info]   /usr/local/scripts/master_ip_failover --command=start --ssh_user=root --orig_master_host=192.168.1.225 --orig_master_ip=192.168.1.225 --orig_master_port=3306 --new_master_host=192.168.1.226 --new_master_ip=192.168.1.226 --new_master_port=3306
 
 
IN SCRIPT TEST====/sbin/ifconfig eth0:1 down==/sbin/ifconfig eth0:1 192.168.1.231;/sbin/arping -I eth0 -c 3 -s 192.168.1.231 192.168.1.1 >/dev/null 2>&1===
 
Enabling the VIP - 192.168.1.231 on the new master - 192.168.1.226
Tue Oct 28 11:31:46 2014 - [info]  OK.
Tue Oct 28 11:31:46 2014 - [info] Setting read_only=0 on 192.168.1.226(192.168.1.226:3306)..
Tue Oct 28 11:31:46 2014 - [info]  ok.
Tue Oct 28 11:31:46 2014 - [info] ** Finished master recovery successfully.
Tue Oct 28 11:31:46 2014 - [info] * Phase 3: Master Recovery Phase completed.
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] * Phase 4: Slaves Recovery Phase..
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] * Phase 4.1: Starting Parallel Slave Diff Log Generation Phase..
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] -- Slave diff file generation on host 192.168.1.227(192.168.1.227:3306) started, pid: 2761. Check tmp log /usr/local/mha/192.168.1.227_3306_20141028113139.log if it takes time..
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] Log messages from 192.168.1.227 ...
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info]  This server has all relay logs. No need to generate diff files from the latest slave.
Tue Oct 28 11:31:46 2014 - [info] End of log messages from 192.168.1.227.
Tue Oct 28 11:31:46 2014 - [info] -- 192.168.1.227(192.168.1.227:3306) has the latest relay log events.
Tue Oct 28 11:31:46 2014 - [info] Generating relay diff files from the latest slave succeeded.
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] * Phase 4.2: Starting Parallel Slave Log Apply Phase..
Tue Oct 28 11:31:46 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] -- Slave recovery on host 192.168.1.227(192.168.1.227:3306) started, pid: 2763. Check tmp log /usr/local/mha/192.168.1.227_3306_20141028113139.log if it takes time..
Tue Oct 28 11:31:48 2014 - [info]
Tue Oct 28 11:31:48 2014 - [info] Log messages from 192.168.1.227 ...
Tue Oct 28 11:31:48 2014 - [info]
Tue Oct 28 11:31:46 2014 - [info] Sending binlog..
Tue Oct 28 11:31:47 2014 - [info] scp from local:/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog to root@192.168.1.227:/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog succeeded.
Tue Oct 28 11:31:47 2014 - [info] Starting recovery on 192.168.1.227(192.168.1.227:3306)..
Tue Oct 28 11:31:47 2014 - [info]  Generating diffs succeeded.
Tue Oct 28 11:31:47 2014 - [info] Waiting until all relay logs are applied.
Tue Oct 28 11:31:47 2014 - [info]  done.
Tue Oct 28 11:31:47 2014 - [info] Getting slave status..
Tue Oct 28 11:31:47 2014 - [info] This slave(192.168.1.227)'s Exec_Master_Log_Pos equals to Read_Master_Log_Pos(mysql-bin.000016:120). No need to recover from Exec_Master_Log_Pos.
Tue Oct 28 11:31:47 2014 - [info] Connecting to the target slave host 192.168.1.227, running recover script..
Tue Oct 28 11:31:47 2014 - [info] Executing command: apply_diff_relay_logs --command=apply --slave_user=root --slave_host=192.168.1.227 --slave_ip=192.168.1.227  --slave_port=3306 --apply_files=/usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog --workdir=/usr/local/mha --target_version=5.6.17-log --timestamp=20141028113139 --handle_raw_binlog=1 --disable_log_bin=0 --manager_version=0.53 --slave_pass=xxx
Tue Oct 28 11:31:47 2014 - [info]
Applying differential binary/relay log files /usr/local/mha/saved_master_binlog_from_192.168.1.225_3306_20141028113139.binlog on 192.168.1.227:3306. This may take long time...
Applying log files succeeded.
Tue Oct 28 11:31:47 2014 - [info]  All relay logs were successfully applied.
Tue Oct 28 11:31:47 2014 - [info]  Resetting slave 192.168.1.227(192.168.1.227:3306) and starting replication from the new master 192.168.1.226(192.168.1.226:3306)..
Tue Oct 28 11:31:48 2014 - [info]  Executed CHANGE MASTER.
Tue Oct 28 11:31:48 2014 - [info]  Slave started.
Tue Oct 28 11:31:48 2014 - [info] End of log messages from 192.168.1.227.
Tue Oct 28 11:31:48 2014 - [info] -- Slave recovery on host 192.168.1.227(192.168.1.227:3306) succeeded.
Tue Oct 28 11:31:48 2014 - [info] All new slave servers recovered successfully.
Tue Oct 28 11:31:48 2014 - [info]
Tue Oct 28 11:31:48 2014 - [info] * Phase 5: New master cleanup phease..
Tue Oct 28 11:31:48 2014 - [info]
Tue Oct 28 11:31:48 2014 - [info] Resetting slave info on the new master..
Tue Oct 28 11:31:48 2014 - [info]  192.168.1.226: Resetting slave info succeeded.
Tue Oct 28 11:31:48 2014 - [info] Master failover to 192.168.1.226(192.168.1.226:3306) completed successfully.
Tue Oct 28 11:31:48 2014 - [info]
 
----- Failover Report -----
 
mha: MySQL Master failover 192.168.1.225 to 192.168.1.226 succeeded
 
Master 192.168.1.225 is down!
 
Check MHA Manager logs at test_redis:/usr/local/mha/manager.log for details.
 
Started automated(non-interactive) failover.
Invalidated master IP address on 192.168.1.225.
The latest slave 192.168.1.226(192.168.1.226:3306) has all relay logs for recovery.
Selected 192.168.1.226 as a new master.
192.168.1.226: OK: Applying all logs succeeded.
192.168.1.226: OK: Activated master IP address.
192.168.1.227: This host has the latest relay log events.
Generating relay diff files from&nb
Salin selepas log masuk
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

Alat AI Hot

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

AI Hentai Generator

AI Hentai Generator

Menjana ai hentai secara percuma.

Artikel Panas

R.E.P.O. Kristal tenaga dijelaskan dan apa yang mereka lakukan (kristal kuning)
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Tetapan grafik terbaik
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Cara Memperbaiki Audio Jika anda tidak dapat mendengar sesiapa
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: Cara Membuka Segala -galanya Di Myrise
3 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌

Alat panas

Notepad++7.3.1

Notepad++7.3.1

Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina

SublimeText3 versi Cina

Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

SublimeText3 versi Mac

SublimeText3 versi Mac

Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Hubungan antara pengguna dan pangkalan data MySQL Hubungan antara pengguna dan pangkalan data MySQL Apr 08, 2025 pm 07:15 PM

Dalam pangkalan data MySQL, hubungan antara pengguna dan pangkalan data ditakrifkan oleh kebenaran dan jadual. Pengguna mempunyai nama pengguna dan kata laluan untuk mengakses pangkalan data. Kebenaran diberikan melalui perintah geran, sementara jadual dibuat oleh perintah membuat jadual. Untuk mewujudkan hubungan antara pengguna dan pangkalan data, anda perlu membuat pangkalan data, membuat pengguna, dan kemudian memberikan kebenaran.

mysql sama ada untuk menukar jadual kunci meja mysql sama ada untuk menukar jadual kunci meja Apr 08, 2025 pm 05:06 PM

Apabila MySQL mengubahsuai struktur jadual, kunci metadata biasanya digunakan, yang boleh menyebabkan jadual dikunci. Untuk mengurangkan kesan kunci, langkah -langkah berikut boleh diambil: 1. Simpan jadual yang tersedia dengan DDL dalam talian; 2. Melakukan pengubahsuaian kompleks dalam kelompok; 3. Beroperasi semasa tempoh kecil atau luar puncak; 4. Gunakan alat PT-OSC untuk mencapai kawalan yang lebih baik.

Adakah Mysql perlu membayar Adakah Mysql perlu membayar Apr 08, 2025 pm 05:36 PM

MySQL mempunyai versi komuniti percuma dan versi perusahaan berbayar. Versi komuniti boleh digunakan dan diubahsuai secara percuma, tetapi sokongannya terhad dan sesuai untuk aplikasi dengan keperluan kestabilan yang rendah dan keupayaan teknikal yang kuat. Edisi Enterprise menyediakan sokongan komersil yang komprehensif untuk aplikasi yang memerlukan pangkalan data yang stabil, boleh dipercayai, berprestasi tinggi dan bersedia membayar sokongan. Faktor yang dipertimbangkan apabila memilih versi termasuk kritikal aplikasi, belanjawan, dan kemahiran teknikal. Tidak ada pilihan yang sempurna, hanya pilihan yang paling sesuai, dan anda perlu memilih dengan teliti mengikut keadaan tertentu.

Bagaimana untuk mengoptimumkan prestasi MySQL untuk aplikasi beban tinggi? Bagaimana untuk mengoptimumkan prestasi MySQL untuk aplikasi beban tinggi? Apr 08, 2025 pm 06:03 PM

Panduan Pengoptimuman Prestasi Pangkalan Data MySQL Dalam aplikasi yang berintensifkan sumber, pangkalan data MySQL memainkan peranan penting dan bertanggungjawab untuk menguruskan urus niaga besar-besaran. Walau bagaimanapun, apabila skala aplikasi berkembang, kemunculan prestasi pangkalan data sering menjadi kekangan. Artikel ini akan meneroka satu siri strategi pengoptimuman prestasi MySQL yang berkesan untuk memastikan aplikasi anda tetap cekap dan responsif di bawah beban tinggi. Kami akan menggabungkan kes-kes sebenar untuk menerangkan teknologi utama yang mendalam seperti pengindeksan, pengoptimuman pertanyaan, reka bentuk pangkalan data dan caching. 1. Reka bentuk seni bina pangkalan data dan seni bina pangkalan data yang dioptimumkan adalah asas pengoptimuman prestasi MySQL. Berikut adalah beberapa prinsip teras: Memilih jenis data yang betul dan memilih jenis data terkecil yang memenuhi keperluan bukan sahaja dapat menjimatkan ruang penyimpanan, tetapi juga meningkatkan kelajuan pemprosesan data.

Integrasi RDS MySQL dengan Redshift Zero ETL Integrasi RDS MySQL dengan Redshift Zero ETL Apr 08, 2025 pm 07:06 PM

Penyederhanaan Integrasi Data: AmazonRDSMYSQL dan Integrasi Data Integrasi Zero ETL Redshift adalah di tengah-tengah organisasi yang didorong oleh data. Proses tradisional ETL (ekstrak, menukar, beban) adalah kompleks dan memakan masa, terutamanya apabila mengintegrasikan pangkalan data (seperti Amazonrdsmysql) dengan gudang data (seperti redshift). Walau bagaimanapun, AWS menyediakan penyelesaian integrasi ETL sifar yang telah mengubah keadaan ini sepenuhnya, menyediakan penyelesaian yang mudah, hampir-sebenar untuk penghijrahan data dari RDSMYSQL ke redshift. Artikel ini akan menyelam ke integrasi RDSMYSQL Zero ETL dengan redshift, menjelaskan bagaimana ia berfungsi dan kelebihan yang dibawa kepada jurutera dan pemaju data.

Pengoptimuman pertanyaan di MySQL adalah penting untuk meningkatkan prestasi pangkalan data, terutama ketika berurusan dengan set data yang besar Pengoptimuman pertanyaan di MySQL adalah penting untuk meningkatkan prestasi pangkalan data, terutama ketika berurusan dengan set data yang besar Apr 08, 2025 pm 07:12 PM

1. Gunakan indeks yang betul untuk mempercepatkan pengambilan data dengan mengurangkan jumlah data yang diimbas memilih*frommployeesWherElast_name = 'Smith'; Jika anda melihat lajur jadual beberapa kali, buat indeks untuk lajur tersebut. Jika anda atau aplikasi anda memerlukan data dari pelbagai lajur mengikut kriteria, buat indeks komposit 2. Elakkan pilih * Hanya lajur yang diperlukan, jika anda memilih semua lajur yang tidak diingini, ini hanya akan memakan lebih banyak pelayan dan menyebabkan pelayan melambatkan pada masa yang tinggi atau kekerapan misalnya, jadual anda

Cara Mengisi Nama Pengguna dan Kata Laluan MySQL Cara Mengisi Nama Pengguna dan Kata Laluan MySQL Apr 08, 2025 pm 07:09 PM

Untuk mengisi nama pengguna dan kata laluan MySQL: 1. Tentukan nama pengguna dan kata laluan; 2. Sambungkan ke pangkalan data; 3. Gunakan nama pengguna dan kata laluan untuk melaksanakan pertanyaan dan arahan.

MySQL: Kemudahan Pengurusan Data untuk Pemula MySQL: Kemudahan Pengurusan Data untuk Pemula Apr 09, 2025 am 12:07 AM

MySQL sesuai untuk pemula kerana mudah dipasang, kuat dan mudah untuk menguruskan data. 1. Pemasangan dan konfigurasi mudah, sesuai untuk pelbagai sistem operasi. 2. Menyokong operasi asas seperti membuat pangkalan data dan jadual, memasukkan, menanyakan, mengemas kini dan memadam data. 3. Menyediakan fungsi lanjutan seperti menyertai operasi dan subqueries. 4. Prestasi boleh ditingkatkan melalui pengindeksan, pengoptimuman pertanyaan dan pembahagian jadual. 5. Sokongan sokongan, pemulihan dan langkah keselamatan untuk memastikan keselamatan data dan konsistensi.

See all articles