我试图在本地运行Elasticsearch (用于开发目的),使用在dockerhub上找到的正常的docker容器。
当我在本地运行这个实例时,我希望看到所有的查询都被转储到stdout/控制台,这样我就可以很容易地看到我的弹性SDK客户机创建/组合/执行什么查询。
我在这个地方看到了一些评论,认为可以通过定制各种设置来实现,比如:
index.search.slowlog.threshold.query.debug: 0s
index.search.slowlog.threshold.fetch.debug: 0s
index.indexing.slowlog.threshold.index.debug: 0s但我不知道如何通过码头写作。
我尝试了以下方法,但ES在启动时崩溃了:
version: '3.5'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
container_name: my-elasticsearch
networks:
- my-network
ports:
- "9200:9200"
- "9300:9300"
environment:
- discovery.type=single-node
- index.indexing.slowlog.threshold.index.deb=0s
- index.search.slowlog.threshold.fetch.debug=0s
- index.search.slowlog.threshold.query.debug=0s有办法吗?
发布于 2020-04-04 11:30:26
为等于或大于5.X的版本添加另一个答案,
下面的elasticsearch.yml抛出中使用它们
elasticsearch {“类型”:“服务器”,“时间戳”:“2020-04-04T10:18:57,720 Z”,“级别”:“警告”,“组件”:"o.e.c.s.SettingsModule","cluster.name":"ami-es","node.name":"e35893907d50",“消息”:节点级配置上的"\n*************************************************************************************\nFound索引级别设置。\n\n SinceElasticSearch5.x索引级别设置不能是在节点上设置\n配置,如elasticsearch.yaml,在系统属性或命令行\narguments.In中,要升级所有索引,必须通过\n/${index}/_settings API更新设置。除非所有设置都是动态的,否则所有索引都必须关闭\n以便应用将来创建的upgradeIndices应该使用索引模板\n设置默认值。\n \n请通过执行:\n\ncurl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true‘-d '{\n \"index.search.slowlog.threshold.fetch.debug\“:\"0ms\",\n\”index.search.slowlog.threshold.fetch.debug\“:\"0ms\",确保在所有索引上更新所有所需的值。N \"index.search.slowlog.threshold.query.debug\“:\"0ms\"\n}'\n*************************************************************************************\n”}
基本上是为了解决这个问题,而不是在elasticsearch.yml**,中提到它们,只需点击下面的API,它就可以工作了。
放置http://{{hostname}}:{{es-port}}/{{index-name}}/_settings
{
"index.indexing.slowlog.threshold.index.warn": "0s",
"index.indexing.slowlog.threshold.index.info": "0s",
"index.indexing.slowlog.threshold.index.debug": "0s",
"index.indexing.slowlog.threshold.index.trace": "0s",
"index.indexing.slowlog.level": "info",
"index.indexing.slowlog.source": "1000"
}发布于 2020-03-27 11:17:10
对于低于5.X的Elasticsearch版本(这些是特定于索引的设置,不推荐使用ES版本5.X)
Elasticsearch.yml
cluster.name: "my-es-cluster"
network.host: 0.0.0.0
index.search.slowlog.threshold.query.debug: 0ms
index.search.slowlog.threshold.fetch.debug: 0ms
index.indexing.slowlog.threshold.index.debug: 0msDocker-compose.yml内容
version: '2.2'
services:
#Elasticsearch Docker Images: https://www.docker.elastic.co/
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.0
container_name: elasticsearch
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
volumes:
- ./elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
ports:
- 9200:9200
- 9300:9300
volumes:
elasticsearch-data:
driver: local编辑:根据OPs的评论,
elasticsearch.yml文件将被用来创建具有相同设置的Elasticsearch停靠器,并在localhost的配置文件中显示。因此,在这个组合文件*nix中,用于elasticsearch的:部分之后更改卷部分,但在此之前它是您的localhost文件系统,因此请将其更改为*nix如果您遇到任何问题,请告诉我,并愿意提供进一步的帮助。
https://stackoverflow.com/questions/60884748
复制相似问题