MySQL InnoDB Cluster
Deploy a MySQL InnoDB Cluster for high availability
initService - delete when done
railwayapp-templates/mysql-cluster
Just deployed
mysql3
railwayapp-templates/mysql-cluster
Just deployed
/var/lib/mysql
mysql2
railwayapp-templates/mysql-cluster
Just deployed
/var/lib/mysql
mysql1
railwayapp-templates/mysql-cluster
Just deployed
/var/lib/mysql
mysql router
mysql/mysql-router
Just deployed
This template deploys a MySQL InnoDB Cluster for a more highly available and redundant data layer.
Requirements
You will need a Railway Public API token for the initialization service.
Private Networking
All communication between nodes is done over the private network.
Configuration Tuning
To tune the configuration of the MySQL Cluster, refer to the MySQL documentation or the documentation page in Docker Hub.
Connecting to the Cluster
An instance of the MySQL Router is deployed with the cluster. It is recommended to connect to the cluster via the MySQL router, instead of connecting to any one of the nodes directly.
For an example client which connects via the router, see the exampleApps folder in the source repo.
Template Source
The source for this template can be found in the Railway Templates GitHub.
The MySQL nodes are built almost directly from the official MySQL image in Docker Hub, with the only customization being the addition of a my.cnf file.
Resources
- MySQL InnoDB Cluster documentation
- Example apps for reference on setting up a client to connect to the cluster
Template Content
initService - delete when done
railwayapp-templates/mysql-clusterRAILWAY_API_TOKEN
Your Railway API token
mysql router
mysql/mysql-router