Skip to content

I am utterly confused by the compose instructions. #40

Open
@scyto

Description

@scyto

I am a little confused by the instructions and have been unable to get this working. I am unclear if i have hit an issue, didn't read something i should have (like manually creating databases and users)?

I am trying to deploy in a swarm using mongodb, i am unclear if mongodb is in the docker image or not?
I have tried both of the following:

  • assuming mongodb is in the image
  • assuming i need separate mongodb

(note i have never used mongodb before)
for approach #1 above

panic: failed to load storage engine: no reachable servers

as such i believe there to be no mondodb server running in the container

for approach #2 above mycompose is further below, when swirl tries to connect to the mongodb it results in this if the db path ends in /swirl

panic: failed to load storage engine: server returned error on SASL authentication step: Authentication failed.

if it doesn't end in /swirl i get

panic: failed to load storage engine: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.

compose file:

version: '3.8'

services:
  swirl:
    image: cuigh/swirl
    environment:
      DB_TYPE: mongo
      DB_ADDRESS: mongodb://mongoroot:password@mongodb:27017/swirl
      DOCKER_ENDPOINT: tcp://swirl_manager_agent:2375
      AGENTS: swirl_manager_agent,swirl_worker_agent
    ports:
      - 8001:8001
    deploy:
      replicas: 1
      placement:
        constraints: [ node.role == worker ]

  manager_agent:
    image: cuigh/socat
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    deploy:
      mode: global
      placement:
        constraints: [ node.role == manager ]

  worker_agent:
    image: cuigh/socat
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    deploy:
      mode: global
      placement:
        constraints: [ node.role == worker ]
        
  mongodb:
    image: mongo
    restart: always
    environment:
      MONGO_INITDB_ROOT_USERNAME: mongoroot
      MONGO_INITDB_ROOT_PASSWORD: password

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 7081:8081
    environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME: mongoroot
      ME_CONFIG_MONGODB_ADMINPASSWORD: password
      ME_CONFIG_MONGODB_URL: mongodb://mongoroot:password@mongodb:27017/      

note my mongo-express service connects with no issues to the database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions