{"id":13676067,"url":"https://github.com/po3rin/eskeeper","last_synced_at":"2026-02-16T02:53:23.462Z","repository":{"id":46626868,"uuid":"304369844","full_name":"po3rin/eskeeper","owner":"po3rin","description":"eskeeper synchronizes index and alias with configuration files while ensuring idempotency.","archived":false,"fork":false,"pushed_at":"2022-08-23T05:55:02.000Z","size":113,"stargazers_count":36,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-20T11:16:48.578Z","etag":null,"topics":["elasticsearch","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/po3rin.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":"2020-10-15T15:29:11.000Z","updated_at":"2022-11-06T14:06:02.000Z","dependencies_parsed_at":"2022-08-28T03:00:41.864Z","dependency_job_id":null,"html_url":"https://github.com/po3rin/eskeeper","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/po3rin%2Feskeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/po3rin%2Feskeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/po3rin%2Feskeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/po3rin%2Feskeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/po3rin","download_url":"https://codeload.github.com/po3rin/eskeeper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251426694,"owners_count":21587633,"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":["elasticsearch","go","golang"],"created_at":"2024-08-02T13:00:17.616Z","updated_at":"2026-02-16T02:53:18.413Z","avatar_url":"https://github.com/po3rin.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"eskeeper-logo\" src=\"logo.png\" height=\"100\" /\u003e\n  \u003ch2 align=\"center\"\u003eeskeeper\u003c/h2\u003e\n  \u003cp align=\"center\"\u003eTool managing Elasticsearch Index\u003c/p\u003e\n\u003c/p\u003e\n\n\u003cimg src=\"https://img.shields.io/badge/go-v1.17-blue.svg\"/\u003e [![GoDoc](https://godoc.org/github.com/po3rin/eskeeper?status.svg)](https://godoc.org/github.com/po3rin/eskeeper) ![Go Test](https://github.com/po3rin/eskeeper/workflows/Go%20Test/badge.svg) \n\neskeeper synchronizes index and alias with configuration files while ensuring idempotency. It still only supports WRITE. DELETE is not yet supported because the operation of deleting persistent data is dangerous and needs to be implemented carefully. \n\n:clipboard: [A Tour of eskeeper](https://github.com/po3rin/eskeeper/blob/main/example/README.md) explains more detail usage.\n\n## :muscle: Currently supports\n\n### mode\n\n- [x] CLI mode\n- [ ] Agent mode\n\n### sync \n\n* index\n- [x] create\n- [x] status (open or close)\n- [x] reindex (only basic parameter)\n- [x] status(open/close only)\n- [ ] lifecycke\n- [ ] update mapping\n- [ ] delete\n\n* alias\n- [x] create\n- [x] update\n- [ ] delete\n\n## :four_leaf_clover: How to use\n\n:clipboard: [A Tour of eskeeper](https://github.com/po3rin/eskeeper/blob/main/example/README.md) explains more detail usage.\n\n###  Quick Start\n\neskeeper recieves yaml format data from stdin.\n\n```bash\n$ go install github.com/po3rin/eskeeper/cmd/eskeeper\n$ eskeeper \u003c es.yaml\n```\n\nes.yaml is indices \u0026 aliases config file. \nBelow is an example of es.yaml.\n\n```yaml\nindex:\n  - name: test-v1 # index name\n    mapping: testdata/test.json # index setting \u0026 mapping (json)\n\n  - name: test-v2\n    mapping: testdata/test.json\n\n  - name: close-v1\n    mapping: testdata/test.json\n    status: close\n\n  # reindex test-v1 -\u003e reindex-v1\t\n  - name: reindex-v1\n    mapping: testdata/test.json\n    reindex:\n        source: test-v1 \n        slices: 3 # default=1\n        waitForCompletion: true\n\n        # 'on' field supports 2 hooks.\n        # 'firstCreated': only when index is created for the first time.\n        # 'always': always exec reindex.\n        on: firstCreated\n\n\nalias:\n  - name: alias1\n    index:\n      - test-v1\n\n  # multi indicies\n  - name: alias2\n    index:\n      - test-v1\n      - test-v2\n```\n\nresults\n\n```bach\ncurl localhost:9200/_cat/indices\nyellow open test-v1 ... 1 1 0 0 208b 208b\nyellow open test-v2 ... 1 1 0 0 208b 208b\nyellow close close-v1 xxxxxxxxxxxx 1 1\nyellow open reindex-v1 ... 1 1 0 0 208b 208b\n\ncurl localhost:9200/_cat/aliases\nalias2 test-v2 - - - -\nalias1 test-v1 - - - -\nalias2 test-v1 - - - -\n```\n\n\n### :triangular_ruler: CLI Options\n\neskeeper supports flag \u0026 environment value.\n\n```bash\n# use flags\neskeeper -u user -p pass -e=http://localhost:9200,http://localhost9300 \u003c testdata/es.yaml\n\n# use env\nESKEEPER_ES_USER=user ESKEEPER_ES_PASS=pass ESKEEPER_ES_URLS=http://localhost:9200 eskeeper \u003c testdata/es.yaml\n```\n\neskeeper can also execute validation only with validate subcommand.\n\n```bash\neskeeper validate \u003c testdata/es.yaml\n```\n\npre-check stage is slow processing. you can skip pre-check stage using -s flag.\n\n```bash\neskeeper -s \u003c testdata/es.yaml\n```\n\n## :mag_right: Internals\n\neskeeper process is divided into four stages. verbose option lets you know eskeeper details.\n\n```\n$ eskeeper \u003c es.yaml\nloading config ...\n\n=== validation stage ===\n[pass] index: test-v1\n[pass] index: test-v2\n[pass] index: close-v1\n[pass] alias: alias1\n[pass] alias: alias2\n\n=== pre-check stage ===\n[pass] index: test-v1\n[pass] index: test-v2\n[pass] index: close-v1\n[pass] alias: alias1\n[pass] alias: alias2\n\n=== sync stage ===\n[synced] index: test-v1\n[synced] index: test-v2\n[synced] index: close-v1\n[synced] alias: alias1\n[synced] alias: alias2\n\n=== post-check stage ===\n[pass] index: test-v1\n[pass] index: test-v2\n[pass] index: close-v1\n[pass] alias: alias1\n[pass] alias: alias2\n\nsucceeded\n```\n\n#### validation stage\n* Validates config yaml format\n\n#### pre-check stage \n\n* Check if mapping file is valid format\n* Check if there is an index for alias  \n\n#### sync stage\n* Sync indices and aliases with config\n\nThe order of synchronization is as follows.\n\n```\ncreate index\n↓\nopen index\n↓\nupdate alias\n↓\nclose index\n```\n\nIndex close operation should be done after switching the alias.\nBecause there can be downtime before switching aliases.\n\n#### post-check stage\n* Check if indices \u0026 aliases has been created\n\n\n## :triangular_flag_on_post: Contributing\n\nDid you find something technically wrong, something to fix, or something? Please give me Issue or Pull Request !!\n\n### Test\n\neskeeper's test uses [github.com/ory/dockertest](github.com/ory/dockertest). So you need docker to test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpo3rin%2Feskeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpo3rin%2Feskeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpo3rin%2Feskeeper/lists"}