Skip to content

Conversation

@geoffreynyaga
Copy link
Contributor

This PR adds a new tutorial for setting up and working with AZ. It provides step-by-step guidance to help users get started quickly with AZs and work on a primary-replica setup across two VMs.

Additions

  • Added an introductory tutorial covering AZ setup
  • Documented prerequisites and installation steps
  • Primary and replica setup for MySQL

Notes

  • There is also an additional explanation page for Availability Zones

@geoffreynyaga geoffreynyaga self-assigned this Sep 12, 2025
@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 90.16393% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (a0008b1) to head (d5e2b0d).
⚠️ Report is 190 commits behind head on availability-zones.

Files with missing lines Patch % Lines
src/daemon/daemon.cpp 25.00% 12 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           availability-zones    #4360      +/-   ##
======================================================
+ Coverage               89.35%   89.67%   +0.31%     
======================================================
  Files                     259      268       +9     
  Lines                   15744    16270     +526     
======================================================
+ Hits                    14068    14590     +522     
- Misses                   1676     1680       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sploder12 Sploder12 force-pushed the availability-zones branch 2 times, most recently from f21b770 to 3098c8f Compare September 15, 2025 09:26
@levkropp levkropp force-pushed the az-tutorial branch 3 times, most recently from d45e88c to c243ac6 Compare September 17, 2025 22:47
@levkropp levkropp force-pushed the az-tutorial branch 3 times, most recently from ff67820 to 43a6ad7 Compare September 23, 2025 13:54
@levkropp levkropp requested a review from sharder996 September 23, 2025 16:15
@Sploder12 Sploder12 changed the base branch from availability-zones to az-implementation October 21, 2025 19:59
Copy link
Collaborator

@sharder996 sharder996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @geoffreynyaga, after extensive testing I think I'm finally able to give some feedback on this.

First of, after having trouble getting the MySQL setup to work following this guide I used the Google doc version which I had better success with. I actually think the Google doc version is better written than this one here and fixes a lot of the things I was going to leave comments on in this review. I did still have some additional comments which I left there.

As far as testing goes, I got the setup working properly on macOS after tinkering a bit. So, pending my comments on the Google doc, I think that side is good.

For Ubuntu, I was not able to get the setup working with issues arising when trying to get mysql-primary to rejoin the cluster. Below are some logs parsed out of /var/log/mysql/error.log:

2025-10-29T04:58:56.540884Z 11 [ERROR] [MY-010584] [Repl] Replica I/O for channel '': Error connecting to source '[email protected]:3306'. This was attempt 10/86400, with a delay of 60 seconds between attempts. Message: Access denied for user 'replica'@'10.32.29.1' (using password: YES), Error_code: MY-001045
2025-10-29T04:59:01.244290Z 27 [Warning] [MY-010056] [Server] Host name 'scott-Darter-Pro' could not be resolved: Temporary failure in name resolution

I find it interesting that the database is trying to connect to 10.32.29.1, which is the IP address of my host and not the IP of the new primary.

Another thing I find interesting is that on macOS, the two VMs which should be in different availability zones are located within the same subnet, i.e. 192.168.2.* where as on Ubuntu they are in different subnets, i.e. 10.152.207.* and 10.32.29.*. I'm not sure, but wouldn't be surprised if this is related to the issues I have on Ubuntu as described above.

@Sploder12 maybe you are able to provide some more insight into what is going on here.

GRANT REPLICATION SLAVE ON *.* TO 'replica'@'%';
FLUSH PRIVILEGES;
EOF
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to mention here for the user to enter their created password from before, i.e., SecureRootPass123

Extract the replication log file and position from the full.sql file:

```bash
grep -i 'CHANGE MASTER' full.sql
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
grep -i 'CHANGE MASTER' full.sql
grep -i 'CHANGE MASTER TO MASTER_LOG_FILE' full.sql

Otherwise, I get so much text I have to scroll through it.


```bash
mysql -u root -p -e "SELECT * FROM testdb.t1;"
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention what should be returned?

server-id=1
log_bin=mysql-bin
binlog_do_db=testdb
bind-address=0.0.0.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mention that this isn't simply adding settings, some of them exist already and must be overwritten.


**Important**: Use the same root password (`SecureRootPass123`) as configured on the primary server.

Edit the MySQL configuration file /etc/mysql/mysql.conf.d/mysqld.cnf to include these settings:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a code block as before with sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

multipass transfer client-key.pem mysql-standby:
```

On the standby VM, move certificates to the SSL directory and set appropriate permissions:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem Be more clear where

multipass transfer client-cert.pem mysql-standby:
multipass transfer mysql-primary:client-key.pem .
multipass transfer client-key.pem mysql-standby:
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an additional command to remove the certificates from the host? Just to be tidy and to not encourage users to leave their certificates lying around.

On the standby VM, move certificates to the SSL directory and set appropriate permissions:

```bash
# On mysql-standby, move certificates and set permissions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem Be more clear where


```bash
multipass transfer mysql-primary:full.sql .
multipass transfer full.sql mysql-standby:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem Clean up after ourselves

-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000002', MASTER_LOG_POS=157;
```

Finally, configure the standby as a replica by providing the primary's IP, replication user credentials, and the extracted master log file and position. **Use the values from the mysqldump file, not the current master status**:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replication user credentials

Its unclear what this is supposed to be.

Base automatically changed from az-implementation to availability-zones November 7, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants