Hi team,
We are trying to switch to MongoDB and it seems working alright until I reboot the EC2 instance.
Every time I reboot the EC2 instance or update the LAMP_SERVER
, I found the LAMP_SERVER
docker re-initialise the installation. The consequence is that it purge everything stored in the database and generate a new admin password. I am not sure something wrong with my configuration or it is a bug. Could you please have a look? I can provide non-product EC2 and portainer access to you if required.
Initializing database connection...
MONGODB adapter in use
(node:1) DeprecationWarning: isConnected is deprecated and will be removed in the next major version
(Use `node --trace-deprecation ...` to show where the warning was created)
Initializing ActivitySpec database...
Connected to redis
ActivitySpec database online.
Initializing SensorSpec database...
SensorSpec database online.
Initializing Researcher database...
Researcher database online.
Initializing Study database...
Study database online.
Initializing Participant database...
Participant database online.
Initializing Activity database...
Activity database online.
Initializing Sensor database...
Sensor database online.
Initializing ActivityEvent database...
ActivityEvent database online.
Initializing SensorEvent database...
SensorEvent database online.
Initializing Tag database...
Tag database online.
Initializing Credential database...
'An initial administrator password was generated and saved for this installation.'
│ (index) │ Values │
──────────────────────────────────────────┤
│ Administrator Password │ 'REALLYLONGPASSWORDREALLYLONGPASSWORDREALLYLONGPASSWORDREALLYLONGPASS' │
──────────────────────────────────┘
Credential database online.
Database verification complete.
Server routing initialized.
My lamp.yml
:
version: '3.7'
services:
server:
image: ghcr.io/bidmcdigitalpsychiatry/lamp-server:2022
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
environment:
HTTPS: 'off'
ROOT_KEY: 'REALLYLONGROOTKEYHEREREALLYLONGROOTKEYHERE'
DB: 'mongodb://USER:PASSWORD@database:27017/'
PUSH_API_GATEWAY: 'https://app-gateway.monashlamp.com/'
PUSH_API_KEY: 'ourpushkey'
DASHBOARD_URL: 'dashboard.oururl.com'
REDIS_HOST: 'redis://cache:6379/0'
NATS_SERVER: 'message_queue:4222'
networks:
- public
deploy:
.....
database:
image: mongo:latest
healthcheck:
test:
- CMD
- mongo
- --eval
- "db.adminCommand('ping')"
environment:
MONGO_INITDB_ROOT_USERNAME: 'admin'
MONGO_INITDB_ROOT_PASSWORD: 'LONGPASSWORDHERE'
volumes:
- /data:/data
networks:
- public
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "5"
deploy:
mode: replicated
update_config:
order: stop-first
failure_action: rollback
labels:
traefik.enable: 'true'
traefik.docker.network: 'public'
traefik.http.routers.lamp_database.entryPoints: 'websecure'
traefik.http.routers.lamp_database.rule: 'Host(`db.ourdomain.com`)'
traefik.http.routers.lamp_database.tls.certresolver: 'le'
traefik.http.services.lamp_database.loadbalancer.server.port: 27017
placement:
constraints:
- node.role == manager