Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MongoDB with single replica (docker compose)

Featured Replies

Hey everyone,

I'm Kevin, and I could use some help with Unraid and my Docker Compose file. Everything works smoothly when I'm using Docker Desktop locally, but as soon as I try it on Unraid, I can't connect to MongoDB.

Here's my Docker Compose file:

version: '3'
volumes:
  mongo1_data:
  mongo1_config:
services:
  mongo1:
    image: mongo:7.0.4
    command: ['--replSet', 'rs0', '--bind_ip_all', '--port', '27017']
    ports:
      - 27017:27017
    healthcheck:
      test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo1:27017'}]}) }" | mongosh --port 27017 --quiet
      interval: 5s
      timeout: 30s
      start_period: 0s
      start_interval: 1s
      retries: 30
    volumes:
      - 'mongo1_data:/data/db'
      - 'mongo1_config:/data/configdb'
  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_MONGODB_URL: mongodb://mongo1:27017/

 

I've tried a bunch of things like hardcoding the local IP to the port, changing ports, and defining networks, but none of them seem to solve the issue. What's really odd is that when I attempt to access port 27017 through a web browser, I get a message saying: "It looks like you are trying to access MongoDB over HTTP on the native driver port."

 

So, it appears that something is listening, but when I try to connect with MongoDB Compass or Mongo Express, it just doesn't work. This problem seems to be related to Unraid because it works perfectly fine locally.

Any ideas or suggestions would be greatly appreciated!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.