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
Utilise the build-crontab-and-cp-files script or the build_crontab_and_setup_files (in imageupgrade_functions.sh) 
to create the crontab file and install it in the root user.
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.