{"id":15688225,"url":"https://github.com/garutilorenzo/mysql-innodb-cluster","last_synced_at":"2025-08-01T03:06:37.319Z","repository":{"id":154321766,"uuid":"341915098","full_name":"garutilorenzo/mysql-innodb-cluster","owner":"garutilorenzo","description":"MySQL InnoDB Cluster dockerized environment for testing purposes","archived":false,"fork":false,"pushed_at":"2022-05-03T13:08:44.000Z","size":70,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T21:01:46.853Z","etag":null,"topics":["cluster","databases","docker","docker-image","innodb-cluster","mysql","mysql-innodb-cluster","mysql-router"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garutilorenzo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-24T13:48:56.000Z","updated_at":"2025-04-04T19:48:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd8ca880-c935-422e-94e5-4e629518508e","html_url":"https://github.com/garutilorenzo/mysql-innodb-cluster","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/garutilorenzo/mysql-innodb-cluster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garutilorenzo%2Fmysql-innodb-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garutilorenzo%2Fmysql-innodb-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garutilorenzo%2Fmysql-innodb-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garutilorenzo%2Fmysql-innodb-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garutilorenzo","download_url":"https://codeload.github.com/garutilorenzo/mysql-innodb-cluster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garutilorenzo%2Fmysql-innodb-cluster/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268162390,"owners_count":24205701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster","databases","docker","docker-image","innodb-cluster","mysql","mysql-innodb-cluster","mysql-router"],"created_at":"2024-10-03T17:56:19.782Z","updated_at":"2025-08-01T03:06:37.293Z","avatar_url":"https://github.com/garutilorenzo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MySQL InnoDB Cluster CI](https://github.com/garutilorenzo/mysql-innodb-cluster/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/garutilorenzo/mysql-innodb-cluster/actions/workflows/ci.yml)\n[![GitHub issues](https://img.shields.io/github/issues/garutilorenzo/mysql-innodb-cluster)](https://github.com/garutilorenzo/mysql-innodb-cluster/issues)\n![GitHub](https://img.shields.io/github/license/garutilorenzo/mysql-innodb-cluster)\n[![GitHub forks](https://img.shields.io/github/forks/garutilorenzo/mysql-innodb-cluster)](https://github.com/garutilorenzo/mysql-innodb-cluster/network)\n[![GitHub stars](https://img.shields.io/github/stars/garutilorenzo/mysql-innodb-cluster)](https://github.com/garutilorenzo/mysql-innodb-cluster/stargazers)\n[![Docker Stars](https://img.shields.io/docker/stars/garutilorenzo/mysql-innodb-cluster?style=flat-square)](https://hub.docker.com/r/garutilorenzo/mysql-innodb-cluster) \n[![Docker Pulls](https://img.shields.io/docker/pulls/garutilorenzo/mysql-innodb-cluster?style=flat-square)](https://hub.docker.com/r/garutilorenzo/mysql-innodb-cluster)\n\n![MySQL Logo](https://garutilorenzo.github.io/images/mysql.png?)\n\n# MySQL InnoDB Cluster\n\nMySQL InnoDB Cluster dockerized environment for testing purposes\n\n* [MySQL InnoDB Cluster](https://dev.mysql.com/doc/refman/8.0/en/mysql-innodb-cluster-introduction.html) - MySQL InnoDB Cluster provides a complete high availability solution for MySQL\n* [MySQL Router](https://dev.mysql.com/doc/mysql-router/8.0/en/) - MySQL Router is part of InnoDB Cluster, and is lightweight middleware that provides transparent routing between your application and back-end MySQL Servers\n\n\n## Notes about environment\n\n* The master branch is based on MySQL 8.0, the 5.7 branch is based on MySQL 5.7 \n* MySQL InnoDB cluster is created on an existing group replication (see mysql/docker-entrypoint.sh for datails)\n* Unlike official MySQL docker image, user an database are created only on the first node and then propagated to other nodes. User an database are created after group repliation setup.\n* MySQL router creates the cluster after all nodes are up (see mysqlrouter/docker-entrypoint.sh). The cluster is created only if cluster doesen't exist.\n\n## Environment variables\n* MySQL Server (mysql-innodb-cluster image)\n  * MYSQL_ROOT_PASSWORD: MySQL root password\n  * GROUP_NAME: uuid of the grpup replication\n  * BOOTSTRAP: if value is set, MySQL InnoDB Cluster is bootstrapped\n  * MYSQL_USER: mysql user (optional)\n  * MYSQL_PASSWORD: mysql user password (optional)\n  * MYSQL_DATABASE: mysql database (optional)\n* MySQL Router (mysql-innodb-cluster-router image)\n  * MYSQL_ROOT_PASSWORD: mysql for the root user\n  * MYSQL_HOST: mysql primary node\n  * CLUSTERMEMBERS: number of members expected in cluster\n\n## Spin up the cluster\n\nStart the cluster:\n\n```console\ndocker-compose up -d\n```\n\nSee if everything works correctrly:\n\n```console\ndocker-compose ps\ndocker-compose logs -f\n```\n\nBuild your own image, or build from scratch (Optional):\n\n```console\ndocker-compose build\n```\n\n## Play with the cluster\n\nShow current cluster statu:\n\n```console\ndocker-compose exec mysql_node01 bash\nroot@mysql_node01:/#  mysqlsh --js root@mysql_node01\nLogger: Tried to log to an uninitialized logger.\nPlease provide the password for 'root@mysql_node01': ****\nSave password for 'root@mysql_node01'? [Y]es/[N]o/Ne[v]er (default No): \nMySQL Shell 8.0.20\n\nCopyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.\nOracle is a registered trademark of Oracle Corporation and/or its affiliates.\nOther names may be trademarks of their respective owners.\n\nType '\\help' or '\\?' for help; '\\quit' to exit.\nCreating a session to 'root@mysql_node01'\nFetching schema names for autocompletion... Press ^C to stop.\nYour MySQL connection id is 22\nServer version: 5.7.32-log MySQL Community Server (GPL)\nNo default schema selected; type \\use \u003cschema\u003e to set one.\nMySQL  mysql_node01:3306 ssl  JS \u003e \u003cCluster:testcluster\u003e\nMySQL  mysql_node01:3306 ssl  JS \u003e clu.status()\n{\n    \"clusterName\": \"testcluster\", \n    \"defaultReplicaSet\": {\n        \"name\": \"default\", \n        \"primary\": \"mysql_node01:3306\", \n        \"ssl\": \"DISABLED\", \n        \"status\": \"OK\", \n        \"statusText\": \"Cluster is ONLINE and can tolerate up to ONE failure.\", \n        \"topology\": {\n            \"mysql_node01:3306\": {\n                \"address\": \"mysql_node01:3306\", \n                \"mode\": \"R/W\", \n                \"readReplicas\": {}, \n                \"role\": \"HA\", \n                \"status\": \"ONLINE\"\n            }, \n            \"mysql_node02:3306\": {\n                \"address\": \"mysql_node02:3306\", \n                \"mode\": \"R/O\", \n                \"readReplicas\": {}, \n                \"role\": \"HA\", \n                \"status\": \"ONLINE\"\n            }, \n            \"mysql_node03:3306\": {\n                \"address\": \"mysql_node03:3306\", \n                \"mode\": \"R/O\", \n                \"readReplicas\": {}, \n                \"role\": \"HA\", \n                \"status\": \"ONLINE\"\n            }\n        }, \n        \"topologyMode\": \"Single-Primary\"\n    }, \n    \"groupInformationSourceMember\": \"mysql_node01:3306\"\n}\n```\n\nFor advanced usage see the [docs](https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-innodb-cluster.html)\n\n## Tear down\n\n```console\ndocker-compose down -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarutilorenzo%2Fmysql-innodb-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarutilorenzo%2Fmysql-innodb-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarutilorenzo%2Fmysql-innodb-cluster/lists"}