Files
sailing-analytics/configuration/mongo_instance_setup
..
2024-02-09 10:36:09 +01:00

Deploy the .mount and .service units to /etc/systemd/system.
Deploy the ephemeralvolume and the patch-mongo-replicaset-name-from-ec2-metadata script to /usr/local/bin,
furthermore the ../imageupgrade_functions.sh has to go to /usr/local/bin.
Deploy mongod.conf to /etc and make sure that /root has a+r and a+x permissions because
otherwise the mongod user won't be able to read through the symbolic link
Link mongodb to /etc/logrotate.d
Link the crontab-mongo, in configuration/crontabs/environments, to /root/crontab and run "crontab crontab" as root.

Run with optional EC2 user detail, e.g., as follows:

  REPLICA_SET_NAME=archive
  REPLICA_SET_PRIMARY=dbserver.internal.sapsailing.com:10201

This will automatically patch /etc/mongod.conf such that the replSetName property
is set to the value of REPLICA_SET_NAME. Then, the instance will be added to
the REPLICA_SET_PRIMARY's replica set.