{"id":28965088,"url":"https://github.com/globocom/foxha","last_synced_at":"2025-10-19T01:31:55.385Z","repository":{"id":11092836,"uuid":"68321187","full_name":"globocom/FoxHA","owner":"globocom","description":"FoxHA is a high availability solution for MySQL","archived":false,"fork":false,"pushed_at":"2022-03-29T21:55:03.000Z","size":73,"stargazers_count":7,"open_issues_count":2,"forks_count":4,"subscribers_count":42,"default_branch":"master","last_synced_at":"2025-05-21T18:21:19.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/globocom.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}},"created_at":"2016-09-15T18:39:57.000Z","updated_at":"2024-08-12T16:51:34.000Z","dependencies_parsed_at":"2022-08-07T06:01:07.730Z","dependency_job_id":null,"html_url":"https://github.com/globocom/FoxHA","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/globocom/FoxHA","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2FFoxHA","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2FFoxHA/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2FFoxHA/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2FFoxHA/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globocom","download_url":"https://codeload.github.com/globocom/FoxHA/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globocom%2FFoxHA/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261508047,"owners_count":23169613,"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":"2025-06-24T06:08:35.725Z","updated_at":"2025-10-19T01:31:50.344Z","avatar_url":"https://github.com/globocom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Run Tests](https://github.com/globocom/FoxHA/actions/workflows/main.yml/badge.svg)](https://github.com/globocom/FoxHA/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/globocom/FoxHA/branch/master/graph/badge.svg?token=q825zxYwCN)](https://codecov.io/gh/globocom/FoxHA)\n# Introduction \n \nFoxHA was designed with the goal of replacing the Flipper as a more robust high availability \nsolution, safer and inter­network. \n \n# Topology \n![image](https://user-images.githubusercontent.com/6109737/135170743-6e3e75da-c2fd-4990-b7c3-863b41f3063a.png)\n\n \n# Requirements \nFoxHA requires the following: \n- Red Hat Linux (or its derivatives), based on version 5 or above; \n- python \u003e= 3.6.1\n- virtualenv \u003e= 1.11.6 \n \n \n# Quick start \nFoxHA is very simple. The best way to understand how it works is installing and using it. \n \n## You can install it by: \n \n    $ pip install foxha\n \nAfter installing, for usage tips type: \n \n    $ fox --help \n \n## Understanding how it works \nFoxha is an MySQL replication manager. This tool helps you to manage MySQL replication \nand watch the health of it. \n \nThe main difference between FoxHA and the Flipper, is that for Flipper to work, requires the \nMySQL servers be part of the same network. \n \nThe technology used for data replication is native to the DBMS itself, with its advantages and \nlimitations. One characteristic of MySQL replication is the absence of conflict resolution, and \nthis is the advantage of using the FoxHA as a replication manager. FoxHA manages on \nwhich node the application can write, and if necessary, allow the switching of the current \nwrite node in case of failure or maintenance, however avoiding data loss or application \nunavailability. \n \n# Configuration \n \nVIP configuration and Health Check:  \n \n- The health check will return 'WORKING’ only for the node that is read_write, and by \ndefinition, only one node has read_write enabled; \n- The connections are always directed only to one node, even if both hosts are with \n“WORKING\" status (Health-check); \n- When the VIP is switched, connections to the last node are dropped \n(service-down-action reset); \n- The VIP is configured not to perform Failback; \n- Vip checking interval: 5 sec / Timeout for switching: 16 sec. \n \n## Encryption file: \n \nDefault path: `./config/.key` \n \nThe passwords saved at the database and specified at configuration file are encrypted using \ncryptography.fernet (symmetric encryption). So, for using foxha is necessary a encryption file \ncontaining the encryption key, by default at the path specified above. You can specify a \ndifferent key file at command line using [--keyfile] argument. \n \n## Configurarion file: \n \nDefault path: `./config/foxha_config.ini`\n \nYou can specify a different configuration file at command line using [-c/--config] argument. \n \nConfiguration file parameters: \n \n```config\n[repository]   \nHost: ADDRESS_OF_MYSQL_REPOSITORY_DATABASE \nPort: MYSQL_PORT \nDatabase: REPOSITORY_DATABASE_NAME \nUser: DBUSER \nPass: ‘password’\n```\n *Note: Password must be specified between single quotes.*\n\n \n \n# Logging: \n \nDefault path: `./log/foxha_GROUP_NAME*.log`\n \nAll commands/operations executed are logged, by default at the path specified above. You \ncan specify a different log file name and path at command line using [--logfile] argument. \n \n    GROUP_NAME= Group name specified at command line with option [-g/--group]. \n \n## Log rotation and retention: \n \nFoxHA has its own mechanism to manage log rotation and retention. It will keep up to 24 \nhours (00:00:00 -\u003e 23:59:59) in the same log file, and one single file is created for each \nreplication group managed. By default, 4 days will be kept in disc, plus the current log file. \nThe default retention could be changed at command line using the [--logretention] argument. \n\n### FOXHA_HOME environment variable: \n \n`FOXHA_HOME` is an optional environment variable containing the base directory in which \nthe foxha specific configuration file, key file and log file resides.  \n \nIf is defined, the path for the configuration file, key file and log file will be as \nshown bellow: \n● Key file: $FOXHA_HOME/config/.key \n● Configuration file: $FOXHA_HOME/config/foxha_config.ini \n● Log file: $FOXHA_HOME/log/foxha_GROUP_NAME*.log \n \n*GROUP_NAME= Group name specified at command line with option [-g/-—group]. \n \n# Useful commands: \n \nList all replication groups registered: \n \n    $ fox --list \n \nList all nodes at a specific group: \n \n    $ fox --list -g GROUP_NAME* \n \nShow the status of a specific group: \n \n    $ fox --status -g GROUP_NAME* \n \nShow the configuration of a specific group: \n \n    $ fox --config -g GROUP_NAME* \n \nSwitch write and read node of a specific group: \n \n    $ fox --switchover --group GROUP_NAME* \n \nor the short version \n \n    $ fox --switch -g GROUP_NAME* \n \nSet a specific node as the new read_write node of that group: \n \n    $ fox -g GROUP_NAME* -n NODE_IP** --set read_write \n \nSpecify a different path to the config file and to the log file: \n \n    $ fox --status -g GROUP_NAME* --configfile /tmp/foxha_config.ini --logfile /home/logfile.log \n \n**GROUP_NAME= Group name of a specific replication group. \n**NODE_IP= Node IP specified for a node in that group.* \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Ffoxha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobocom%2Ffoxha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobocom%2Ffoxha/lists"}