Closed pmaojo closed 5 years ago
Hi @pmaojo,
It looks like spree2vs can't connect to Elastic Search. Try changing es1:9200
to the appropriate address of the ES server. spree2vs connects directly to ES and skips connecting to vs-api when importing the catalogue.
hi @tniezg I can't guess which is the appropriate address, I have a fresh Vue Storefront API docker image running..
If you're running vs-api inside Docker Compose and spree2vs inside Docker Compose, you'll have to put them in the same Docker network for them to see each other. spree2vs already joins an auxiliary network called spree_vue_storefront_shared_development_network
. Try modifying vs-api's docker-compose.yml file to also join this network. You can use https://github.com/spark-solutions/spree2vuestorefront/blob/master/docker-compose.yml as reference. version: '3.5'
of Docker Compose is required. After doing this, spree2vs should see Elastic Search at address es1:9200
.
Thanks! I will try!
That was it. It almost works. This is how docker-compose.yml of vue storefront api looks like
version: '3.5'
services:
es1:
container_name: elasticsearch
build: docker/elasticsearch/
volumes:
- ./docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- ./docker/elasticsearch/data:/usr/share/elasticsearch/data
ports:
- '9200:9200'
- '9300:9300'
networks:
- net
environment:
ES_JAVA_OPTS: "-Xmx512m -Xms512m"
kibana:
build: docker/kibana/
volumes:
- ./docker/kibana/config/:/usr/share/kibana/config:ro
ports:
- '5601:5601'
depends_on:
- es1
redis:
image: 'redis:4-alpine'
ports:
- '6379:6379'
volumes:
esdat1:
networks:
net:
name: spree_vue_storefront_shared_development_network
To make it connect, I had to change also .env.docker
# Spree config
SPREE_URL=https://xxxxx.com
SPREE_PATH=api/v2/storefront/
SPREE_IMAGES_HOST=https://xxxxxx.com
# Server config
# 8889 port is same as in docker-compose.yml
SERVER_PORT=8889
# Importer config
PER_PAGE=100
MAX_PAGES=1000
# Elastic Search config
ES_URL=http://elasticsearch:9200
ES_INDEX=vue_storefront_catalog
ES_LOG_LEVEL=error
ES_REQUEST_TIMEOUT=3000
ES_BULK_SIZE=200
# Scheduler config
CRON_SCHEDULE="*/1 * * * *"
I have Vue Storefront API running, Elasticsearch responds to this command: curl -i http://elastic:changeme@localhost:8080/api/catalog/vue_storefront_catalog/_search
And this is the config file:
This is the log with the error: