{"id":23282213,"url":"https://github.com/alilotfi23/bash-galera","last_synced_at":"2026-04-05T21:05:33.992Z","repository":{"id":178135138,"uuid":"661399568","full_name":"alilotfi23/Bash-galera","owner":"alilotfi23","description":"Galera cluster","archived":false,"fork":false,"pushed_at":"2024-07-11T09:49:21.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-12T20:18:11.402Z","etag":null,"topics":["database","galera-cluster","mysql","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alilotfi23.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":"2023-07-02T18:10:12.000Z","updated_at":"2024-07-11T11:58:26.000Z","dependencies_parsed_at":"2023-07-05T04:48:08.871Z","dependency_job_id":null,"html_url":"https://github.com/alilotfi23/Bash-galera","commit_stats":null,"previous_names":["alilotfi23/bash-galera"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2FBash-galera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2FBash-galera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2FBash-galera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alilotfi23%2FBash-galera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alilotfi23","download_url":"https://codeload.github.com/alilotfi23/Bash-galera/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492543,"owners_count":20947545,"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","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":["database","galera-cluster","mysql","shell-script"],"created_at":"2024-12-20T00:15:02.889Z","updated_at":"2025-12-30T22:45:56.197Z","avatar_url":"https://github.com/alilotfi23.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MariaDB Galera Cluster Setup Script\n\nThis project provides a Bash script to configure and set up a MariaDB Galera Cluster with options for 2 to 5 nodes. The script automates the configuration of `/etc/hosts` and MariaDB settings for each node in the cluster.\n\n## Features\n\n- Configures `/etc/hosts` with the IP addresses, hostnames, and host aliases of the nodes.\n- Updates MariaDB configuration for Galera cluster settings.\n- Option to specify which node is the MASTER node.\n- Restarts the MariaDB service and displays the status.\n\n## Prerequisites\n\n- Bash shell\n- MariaDB installed on all nodes\n- Galera plugin for MariaDB\n\n## Usage\n\n1. **Clone the repository**:\n   ```sh\n   git clone https://github.com/alilotfi23/Bash-galera.git\n   cd Bash-galera\n   ```\n\n2. **Make the script executable**:\n   ```sh\n   chmod +x setup_galera_cluster.sh\n   ```\n\n3. **Run the script**:\n   ```sh\n   ./galera.sh\n   ```\n\n## Script Breakdown\n\n### Function: `node2()`\n\n- Prompts for the IP, hostname, and host alias of two nodes.\n- Appends these details to `/etc/hosts`.\n- Configures MariaDB for the Galera cluster.\n- Restarts MariaDB and displays the service status.\n\n### Function: `node3()`\n\n- Prompts for the IP, hostname, and host alias of three nodes.\n- Appends these details to `/etc/hosts`.\n- Configures MariaDB for the Galera cluster.\n- Restarts MariaDB and displays the service status.\n\n### Function: `node4()`\n\n- Prompts for the IP, hostname, and host alias of four nodes.\n- Appends these details to `/etc/hosts`.\n- Configures MariaDB for the Galera cluster.\n- Restarts MariaDB and displays the service status.\n\n### Function: `node5()`\n\n- Prompts for the IP, hostname, and host alias of five nodes.\n- Appends these details to `/etc/hosts`.\n- Configures MariaDB for the Galera cluster.\n- Restarts MariaDB and displays the service status.\n\n### Node Selection\n\n- The script provides a menu to select the number of nodes for the cluster.\n- Based on the selection, the corresponding function (`node2`, `node3`, `node4`, or `node5`) is called.\n\n### Example Menu\n\n```sh\nPS3=\"Select node count: \"\n\nselect choice in \"2node\" \"3node\"  \"4node\" \"5node\"  \"Exit\"\n\ndo\n\ncase $REPLY in\n\n1)\nnode2\n;;\n2)\nnode3\n;;\n3)\nnode4\n;;\n4)\nnode5\n;;\n5)\necho \"...Bye...\"\nexit 0\n;;\n*)\necho \"Invalid Choice\"\n\nesac\n\ndone\n```\n\n## Conclusion\n\nThis script simplifies the setup process for a MariaDB Galera Cluster by automating the configuration of multiple nodes. Ensure you have the necessary prerequisites installed before running the script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falilotfi23%2Fbash-galera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falilotfi23%2Fbash-galera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falilotfi23%2Fbash-galera/lists"}