Saturday, 8 April 2017

How to set up docker elasticsearch with node?

here is my docker-composer.yml file:

db:
    image: mongo
    ports:
        - "27017:27017"
    restart: always
elasticsearch1:
    image: docker.elastic.co/elasticsearch/elasticsearch:5.3.0
    container_name: elasticsearch1
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    mem_limit: 1g
    cap_add:
      - IPC_LOCK
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
web:
    build: .
    volumes:
        - ./:/usr/src/app
    ports:
        - "3000:3000"
    links:
        - db
        - elasticsearch1
    command: npm start

Problem is I get this error:

web_1 | { Error: No Living connections web_1 |
at sendReqWithConnection (/usr/src/app/node_modules/mongoosastic/node_modules/elasticsearch/src/lib/transport.js:211:15) web_1 | at next (/usr/src/app/node_modules/mongoosastic/node_modules/elasticsearch/src/lib/connection_pool.js:213:7) web_1 | at _combinedTickCallback (internal/process/next_tick.js:67:7) web_1 | at process._tickDomainCallback (internal/process/next_tick.js:122:9) message: 'No Living connections' }

I can run elasticsearch in localhost but problem is with node it not working, I using mongoosastic lib for node.



via Vladimir

No comments:

Post a Comment