{"id":22729690,"url":"https://github.com/perfectstorm88/es_docker_simple","last_synced_at":"2026-04-13T21:04:22.595Z","repository":{"id":89736022,"uuid":"283140022","full_name":"perfectstorm88/es_docker_simple","owner":"perfectstorm88","description":null,"archived":false,"fork":false,"pushed_at":"2020-07-28T08:18:31.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T02:53:42.916Z","etag":null,"topics":["docker-compose","elasticsearch","es6","kibana"],"latest_commit_sha":null,"homepage":"","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/perfectstorm88.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-28T07:48:54.000Z","updated_at":"2020-07-28T08:21:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"592cabf6-0eeb-4072-9690-7337803ab959","html_url":"https://github.com/perfectstorm88/es_docker_simple","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/perfectstorm88%2Fes_docker_simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectstorm88%2Fes_docker_simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectstorm88%2Fes_docker_simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perfectstorm88%2Fes_docker_simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perfectstorm88","download_url":"https://codeload.github.com/perfectstorm88/es_docker_simple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262489,"owners_count":20749171,"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":["docker-compose","elasticsearch","es6","kibana"],"created_at":"2024-12-10T18:11:26.079Z","updated_at":"2026-04-13T21:04:22.561Z","avatar_url":"https://github.com/perfectstorm88.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"elasticsearch简单的安装部署、关键参数、增加密码、测试等功能\n\n# 最简单集群的docker安装\n\n参见官网[Install Elasticsearch with Docker](\nhttps://www.elastic.co/guide/en/elasticsearch/reference/6.6/docker.html)\n\n- 1、根据样例直接启动集群\n- 2、检查启动状态\n```\ncurl http://127.0.0.1:9200/_cat/health\n```\n\n## 最基础配置参数\n第一个节点es01(主节点)\n```yaml\n  - cluster.name=docker-cluster #集群名称\n  - bootstrap.memory_lock=true  # 关键参数，锁定内存，禁止swaping，提高效率\n  - \"ES_JAVA_OPTS=-Xms512m -Xmx512m\"\n```\n第二给节点es02(从节点)\n```yaml\n  - cluster.name=docker-cluster  #集群名称\n  - bootstrap.memory_lock=true\n  - \"ES_JAVA_OPTS=-Xms512m -Xmx512m\"\n  - \"discovery.zen.ping.unicast.hosts=es02\" # 静态设置主机列表\n```\n\n# 设置用户名密码\n\n## 通过手工方式设置\n参见：[ElasticSearch设置用户名密码访问](https://juejin.im/post/5c9c58fa5188250ef95d8b3c)\n可以通过手工方式用户名密码访问\n\n## 设置用户名密码的功能集成到docker-compose中\n结合[Encrypting communications in an Elasticsearch Docker Container](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/configuring-tls-docker.html)中的部分配置参数，在docker-compose.yml中每个es节点的环境增加下列参数也可以完成此功能\n```\nenvironment:\n  - ELASTIC_PASSWORD=123456  # 设置密码\n  - xpack.license.self_generated.type=trial  # 自动生成并应用启动trial license，以便启用安全功能\n  - xpack.security.enabled=true  # 开启x-pack验证\n```\n\n设置完密码后的访问方式为：\n```\ncurl  -u elastic:elastic http://localhost:9200\n```\n\n# 辅助功能-docker-compose的健康检查\n\n- 1、给es01主节点，增加healthcheck项，执行curl命令`curl  -u elastic:123456 http://localhost:9200` 检查节点是否正常\n- 2、增加wait_until_ready服务，当服务启动完成后才退出（但是service_healthy在docker-compose 3版本中已经不再支持,而且在swam模式会被忽略）\n\n\n# 安装es插件\n\n以[Lucene IK analyzer 分词](https://github.com/medcl/elasticsearch-analysis-ik)插件为例:支持两个安装方式，一定要找到对应的安装包：\n\n- 下载zip包，直接解压到plugins目录\n- 使用elasticsearch-plugin命令安装\n\n下载zip包的执行命令\n\n## download.sh下载zip包的执行命令\n```shell\nmkdir plugins\nwget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.6.2/elasticsearch-analysis-ik-6.6.2.zip\nunzip elasticsearch-analysis-ik-6.6.2.zip -d ./plugins/ik\n```\n## 验证插件\n执行脚本`test_ik6.x.sh`\n\n# 使用kibana\n参照 [kibana使用.md](./kibana使用.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperfectstorm88%2Fes_docker_simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperfectstorm88%2Fes_docker_simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperfectstorm88%2Fes_docker_simple/lists"}