Skip to content

Commit d642903

Browse files
committed
[add] - add some instruction when working with rds(aurora)
1 parent 4d340f5 commit d642903

File tree

2 files changed

+51
-9
lines changed

2 files changed

+51
-9
lines changed

common/hep_aws_rds.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
aws_help_install_mysql_client_5_7() {
2+
3+
echo \
4+
"
5+
sudo rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
6+
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
7+
yum install -y mysql-community-client
8+
"
9+
}
10+
11+
aws_help_rds_list_bin_logs() {
12+
echo \
13+
"show binary logs;"
14+
}
15+
16+
aws_help_start_stop_replication() {
17+
echo "CALL mysql.rds_start_replication;"
18+
echo "CALL mysql.rds_stop_replication;"
19+
}
20+
21+
aws_help_rds_aurora_set_replication() {
22+
echo \
23+
"
24+
aws_rds_list_events
25+
CALL mysql.rds_set_external_master ('master_address', 3306, \
26+
'repl_user', '123456', 'mysql-bin-changelog.000002', 1234, 0);
27+
"
28+
}
29+
30+
aws_help_rds_aurora_test_replication() {
31+
32+
echo \
33+
"
34+
35+
# On master
36+
CREATE TABLE IF NOT EXISTS tasks (
37+
task_id INT AUTO_INCREMENT PRIMARY KEY
38+
) ENGINE=INNODB;
39+
40+
DB_USER=xxx
41+
DB_PASSWD=xxx
42+
DB_NAME=xxx
43+
DB_ADDRESS=xxx
44+
mysql --user=$DB_USER --password=$DB_PASSWD $DB_NAME -h $DB_ADDRESS << EOF
45+
INSERT INTO tasks (\`task_id\`) VALUES (NULL);
46+
EOF
47+
48+
# On slave
49+
select * from tasks;
50+
"
51+
}

common/install_instructions.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)