{"id":16540613,"url":"https://github.com/fcwu/glusterfs-keepalived","last_synced_at":"2025-04-11T07:56:58.531Z","repository":{"id":24144423,"uuid":"27533863","full_name":"fcwu/glusterfs-keepalived","owner":"fcwu","description":"docker image for glusterfs-keepalived(HA glusterfs) via macvlan in the same computer","archived":false,"fork":false,"pushed_at":"2015-02-03T07:39:33.000Z","size":132,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T05:35:27.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fcwu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-04T09:48:29.000Z","updated_at":"2024-10-10T18:36:42.000Z","dependencies_parsed_at":"2022-08-22T12:10:15.282Z","dependency_job_id":null,"html_url":"https://github.com/fcwu/glusterfs-keepalived","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcwu%2Fglusterfs-keepalived","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcwu%2Fglusterfs-keepalived/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcwu%2Fglusterfs-keepalived/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcwu%2Fglusterfs-keepalived/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcwu","download_url":"https://codeload.github.com/fcwu/glusterfs-keepalived/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248360072,"owners_count":21090645,"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":[],"created_at":"2024-10-11T18:52:54.787Z","updated_at":"2025-04-11T07:56:58.503Z","avatar_url":"https://github.com/fcwu.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"glusterfs-keepalived\n=========================\n\nDocker image for multi-nodes glusterfs and keepalived (HA for glusterfs) via macvlan in the same machine.\n\nGet Started\n--------------------\n\nStart glusterfs and keepalived in the same machine. Modify configure in conf/base.conf such as `VIPADDR`(virtual IP Address), `C*_IP` and `C*_ROUTE` to conform with your environment.\n\nHere is my environment\n\n```bash\nIFACE=eth0\nIFACE_GUEST=eth10\nIFACE_CONTAINER=eth10\nVIPADDR=192.168.80.220\nIMAGE=dorowu/glusterfs-keepalived\nREPLICA=2\n\nC1_NAME=gk1\nC1_IP=192.168.80.221/23\nC1_ROUTE=192.168.80.254\n\nC2_NAME=gk2\nC2_IP=192.168.80.225/23\nC2_ROUTE=192.168.80.254\n```\n\nRun both containers and start volume\n\n```bash\n$ bin/glusterfs-keepalived start-containers\n50b127fdfbdb3a442faf3c5e3d3f5d4e581570f89c5d6ebf29028b3ca0ea106b\n8f5203ddf3e9592ea8416033d92ea6249d91ee27a311a451a2a73da6f7a52168\n$ bin/glusterfs-keepalived start-volume\npeer probe: success: on localhost not needed\npeer probe: success\nvolume create: volume1: failed: Host 192.168.80.225 is not in 'Peer in Cluster' state\nvolume set: success\nvolume set: success\nvolume set: success\nvolume set: success\nvolume start: volume1: success\n```\n\nCheck the result\n\n```bash\n$ bin/glusterfs-keepalived status\nImage: dorowu/glusterfs-keepalived\nHost Network Interface: eth0\nVIP: 192.168.80.220\nContainer: gk1\n  Network: 192.168.80.221/23 via 192.168.80.254\n  Created: true\n  Running: true\n  ID: 50b127fdfbdb3a442faf3c5e3d3f5d4e581570f89c5d6ebf29028b3ca0ea106b\n  Process: glusterfs                        RUNNING    pid 13, uptime 0:05:49\n  Process: keepalived                       RUNNING    pid 14, uptime 0:05:49\n  Keepalived State: MASTER\nContainer: gk2\n  Network: 192.168.80.225/23 via 192.168.80.254\n  Created: true\n  Running: true\n  ID: 8f5203ddf3e9592ea8416033d92ea6249d91ee27a311a451a2a73da6f7a52168\n  Process: glusterfs                        RUNNING    pid 12, uptime 0:05:48\n  Process: keepalived                       RUNNING    pid 13, uptime 0:05:48\n  Keepalived State: BACKUP\n```\n\nBecause the container was configure to connect with macvlan, if you would like to mount glusterfs, you should run mount command in another computer by\n\n```bash\n$ sudo mount.glusterfs 192.168.80.220:volume1 mnt\n```\n\nfailover test\n-----------------------\n\nStop container, then you will see Keepalived State of gk2 is switching to MASTER\n\n```bash\n$bin/glusterfs-keepalived stop-container gk1\ngk1\n$ bin/glusterfs-keepalived status\nImage: dorowu/glusterfs-keepalived\nHost Network Interface: eth0\nVIP: 192.168.80.220\nContainer: gk1\n  Network: 192.168.80.221/23 via 192.168.80.254\n  Created: true\n  Running: false\nContainer: gk2\n  Network: 192.168.80.225/23 via 192.168.80.254\n  Created: true\n  Running: true\n  ID: 8f5203ddf3e9592ea8416033d92ea6249d91ee27a311a451a2a73da6f7a52168\n  Process: glusterfs                        RUNNING    pid 12, uptime 0:09:07\n  Process: keepalived                       RUNNING    pid 13, uptime 0:09:07\n  Keepalived State: MASTER\n```\n\nSwtich to gk1 again\n```bash\n$ bin/glusterfs-keepalived start-container gk1\n$ bin/glusterfs-keepalived stop-container gk2\n$ bin/glusterfs-keepalived start-container gk1\n$ bin/glusterfs-keepalived status\nImage: dorowu/glusterfs-keepalived\nHost Network Interface: eth0\nVIP: 192.168.80.220\nContainer: gk1\n  Network: 192.168.80.221/23 via 192.168.80.254\n  Created: true\n  Running: true\n  ID: 50b127fdfbdb3a442faf3c5e3d3f5d4e581570f89c5d6ebf29028b3ca0ea106b\n  Process: glusterfs                        RUNNING    pid 12, uptime 0:00:49\n  Process: keepalived                       RUNNING    pid 13, uptime 0:00:49\n  Keepalived State: MASTER\nContainer: gk2\n  Network: 192.168.80.225/23 via 192.168.80.254\n  Created: true\n  Running: true\n  ID: 8f5203ddf3e9592ea8416033d92ea6249d91ee27a311a451a2a73da6f7a52168\n  Process: glusterfs                        RUNNING    pid 11, uptime 0:00:37\n  Process: keepalived                       RUNNING    pid 12, uptime 0:00:37\n  Keepalived State: BACKUP\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcwu%2Fglusterfs-keepalived","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcwu%2Fglusterfs-keepalived","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcwu%2Fglusterfs-keepalived/lists"}