我已经成功地使用FSCrawler为pdf建立了索引,但是我无法连接到FSCrawler的REST客户端来建立到elasticsearch的管道。这是我在docker-compose中的命令:
command: fscrawler fscrawler_rest我可以用我的FSCrawler作业名的索引查询elasticsearch并检索结果。然后,当我将--rest标志添加到我的docker-compose命令中时,我成功地启动了REST客户端(尽管有一个我不理解的警告):
WARN [o.g.j.i.i.Providers] A provider fr.pilato.elasticsearch.crawler.fs.rest.UploadApi registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime.
Due to constraint configuration problems the provider fr.pilato.elasticsearch.crawler.fs.rest.UploadApi will be ignored.
INFO [f.p.e.c.f.r.RestServer] FS crawler Rest service started on [http://127.0.0.1:8080/fscrawler]然后,当我尝试使用或不使用尾随斜杠:curl -XGET "127.0.0.1:8080/fscrawler/"的curl时,我得到的是curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused
新增docker-compose命令供参考:
command: fscrawler fscrawler_rest --loop 0 --rest debug我似乎不能很好地调试它,因为docker-compose不允许在容器运行时使用命令行界面命令,但我不明白为什么我仍然可以使用http://localhost:9200/fscrawler_rest在elasticsearch中访问我的作业索引。
FSCrawler正在使用elasticsearch,但REST服务似乎不起作用。有没有人成功使用过FSCrawler REST API?
编辑:
version: '3.6'
services:
postgres:
image: "postgres:12.1"
env_file:
- '.env'
ports:
- '127.0.0.1:5432:5432'
restart: "${DOCKER_RESTART_POLICY:-unless-stopped}"
stop_grace_period: "${DOCKER_STOP_GRACE_PERIOD:-3s}"
volumes:
- postgres:/var/lib/postgresql/data
networks:
- esnet
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
# build: ./es
container_name: elasticsearch
env_file:
- ".env"
depends_on:
- "postgres"
volumes:
- esdata:/usr/share/elasticsearch/data
environment:
- node.name=elasticsearch
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- discovery.type=single-node
- network.host=0.0.0.0
- network.publish_host=0.0.0.0
- http.cors.enabled=true
- http.cors.allow-origin=*
- http.host=0.0.0.0
- transport.host=0.0.0.0
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
- 9300:9300
networks:
- esnet
fscrawler:
# I have taken this docker image and updated to 2.7 snapshot: toto1310/fscrawler
build:
context: ${PWD}
dockerfile: Dockerfile-toto
container_name: fscrawler
depends_on:
- elasticsearch
restart: always
volumes:
- ${PWD}/config:/root/.fscrawler
- ${PWD}/data:/tmp/es
networks:
- esnet
environment:
- FS_URL=/tmp/es
- ELASTICSEARCH_URL=http://elasticsearch:9200
- ELASTICSEARCH_INDEX=fscrawler_rest
command: fscrawler fscrawler_rest --loop 0 --rest debug
volumes:
postgres:
esdata:
driver: local
networks:
esnet:发布于 2020-07-20 18:38:32
向fscrawler添加端口
ports:
- 8080:8080除非您更改settings.yaml rest url,否则将提供空响应:
rest:
url: “http://fscrawler:8080”以到达名为fscrawler的停靠容器。
https://stackoverflow.com/questions/62991297
复制相似问题