{"id":28427235,"url":"https://github.com/talend/redis-tools","last_synced_at":"2025-10-26T13:06:22.760Z","repository":{"id":39737928,"uuid":"127096856","full_name":"Talend/redis-tools","owner":"Talend","description":"Simple repository of python redis tools, mostly used for keys synchronization between 2 redis","archived":true,"fork":false,"pushed_at":"2022-11-24T10:19:39.000Z","size":16,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-07-03T23:33:56.252Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Talend.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":"SECURITY.md","support":null}},"created_at":"2018-03-28T06:50:14.000Z","updated_at":"2024-03-25T11:12:49.000Z","dependencies_parsed_at":"2023-01-21T06:16:24.039Z","dependency_job_id":null,"html_url":"https://github.com/Talend/redis-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Talend/redis-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talend%2Fredis-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talend%2Fredis-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talend%2Fredis-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talend%2Fredis-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Talend","download_url":"https://codeload.github.com/Talend/redis-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Talend%2Fredis-tools/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265291748,"owners_count":23741913,"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-05T12:10:03.502Z","updated_at":"2025-10-26T13:06:22.674Z","avatar_url":"https://github.com/Talend.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# redis-tools\nSimple repository of python redis tools, mostly used for keys synchronization between 2 redis.\n\n## Installation\nInstallation can be done using `make`. Read the `Makefile` to get the manual commands.\n- Build the Docker image: `make docker`\n- Install redis-tools locally: `make install`\n\n## Configuration\nConfiguration is managed by environment variables:\n```\nDRY_RUN=yes                      # use \"yes\" with sync command to only compare keys\nINTERVAL=30                      # in seconds, use 0 to run the command only once\nLOG_LEVEL=INFO                   # use standard logging levels\nREDIS_ENDPOINT=localhost:6379    # use ip:port or fqdn:port\nREDIS_NAMESPACE=*                # use \"*\" to manage all keys\n                                 # use \"ns:*\" to manage only keys prefixed by \"ns:\" namespace\nREDIS_TARGET_ENDPOINT=redis:6379 # use ip:port or fqdn:port\n```\n\n## Usage\n### redis-sync\nUse `redis-sync` command to compare keys prefixed by a specific namespace between 2 Redis clusters and\ncopy new keys from source Redis to target Redis.\n```\n$ docker run -e REDIS_ENDPOINT=172.17.0.1:6379 -e REDIS_TARGET_ENDPOINT=172.17.0.1:6380 -e REDIS_NAMESPACE=ns:sessions:* -e INTERVAL=10 -e DRY_RUN=no redis-tools redis-sync\nroot 2018-04-05 14:15:59,666 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6379\nroot 2018-04-05 14:15:59,668 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6380\nroot 2018-04-05 14:15:59,669 INFO No new keys found on 172.17.0.1:6379\nroot 2018-04-05 14:15:59,669 INFO Every keys are already existing in 172.17.0.1:6380\nroot 2018-04-05 14:16:09,670 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6379                                                                                   root 2018-04-05 14:16:09,673 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6380\nroot 2018-04-05 14:16:09,674 INFO New keys: {b'ns:sessions:tds5', b'ns:sessions:tds4', b'ns:sessions:tds6', b'ns:sessions:tds8', b'ns:sessions:tds0', b'ns:sessions:tds2', b'ns:sessions:tds7', b'ns:sessions:tds3', b'ns:sessions:tds1', b'ns:sessions:tds9'}\nroot 2018-04-05 14:16:09,674 INFO New key to add on 172.17.0.1:6380\nroot 2018-04-05 14:16:09,689 INFO Execute pipeline with 10 tasks\nroot 2018-04-05 14:16:19,701 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6379\nroot 2018-04-05 14:16:19,704 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6380\nroot 2018-04-05 14:16:19,705 INFO No new keys found on 172.17.0.1:6379\nroot 2018-04-05 14:16:19,706 INFO Every keys are already existing in 172.17.0.1:6380\n```\n\n### redis-monitor\nUse `redis-monitor` command to watch Redis key prefixed by a specific namespace on Redis cluster\n(can monitor a second Redis cluster if `REDIS_TARGET_ENDPOINT` is set).\n```\n$ docker run -e REDIS_ENDPOINT=172.17.0.1:6379 -e REDIS_TARGET_ENDPOINT=172.17.0.1:6380 -e REDIS_NAMESPACE=ns:sessions:* -e INTERVAL=0 redis-tools redis-monitor\nroot 2018-04-05 14:18:32,533 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6379\nroot 2018-04-05 14:18:32,536 INFO Keys for Redis Source 172.17.0.1:6379: {b'ns:sessions:tds3', b'ns:sessions:tds5', b'ns:sessions:tds9', b'ns:sessions:tds6', b'ns:sessions:tds2', b'ns:sessions:tds0', b'ns:sessions:tds1', b'ns:sessions:tds8', b'ns:sessions:tds7', b'ns:sessions:tds4'}\nroot 2018-04-05 14:18:32,537 INFO Get redis keys starting by namespace \"ns:sessions:*\" for redis endpoint \"172.17.0.1:6380\nroot 2018-04-05 14:18:32,537 INFO Keys for Redis Target 172.17.0.1:6380: {b'ns:sessions:tds3', b'ns:sessions:tdc9', b'ns:sessions:tdc8', b'ns:sessions:tds5', b'ns:sessions:tds9', b'ns:sessions:tds6', b'ns:sessions:tds2', b'ns:sessions:tds0', b'ns:sessions:tdc2', b'ns:sessions:tdc5', b'ns:sessions:tdc6', b'ns:sessions:tds1', b'ns:sessions:tdc7', b'ns:sessions:tds8', b'ns:sessions:tdc1', b'ns:sessions:tdc4', b'ns:sessions:tdc0', b'ns:sessions:tds7', b'ns:sessions:tds4', b'ns:sessions:tdc3'}\n```\n\n## Tests\nA docker-compose.yaml is available which run a redis-tools container and 2 redis databases\ncontainers for local tests.\n```\ndocker-compose up\n```\n\nTo manage the 2 redis databases (test load injection for example), you can run the Docker image\nwith interactive python:\n```\n$ docker run -it --network=redistools_default redis-tools python\nIn [1]: import redis\nIn [2]: r1 = redis.StrictRedis(host='redis-source')\nIn [3]: r2 = redis.StrictRedis(host='redis-target')\nIn [4]: r1.keys()\nIn [5]: r1.set('ns:foo1', 'bar1')\nIn [6]: r1.set('ns:foo2', 'bar2')\nIn [7]: r1.keys()\nIn [8]: r2.keys()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalend%2Fredis-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalend%2Fredis-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalend%2Fredis-tools/lists"}