Skip to content

Conversation

@bourasom
Copy link
Member

@bourasom bourasom commented Mar 6, 2019

No description provided.

Copy link
Contributor

@vsellier vsellier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This should be placed on a backup directory, not directly under srv/bin
  • The elasticsearch directory backup is missing

EXO_MONGO_SERVER=${MONGO_SERVER}
EXO_USER=exo
#Database Backup
DB_DUMP_WORKING_DIR=/srv/backup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not work directly on the final backup directory because you will erase the previous backup at the beginning. If several services are on the same server the last backuped service will erase the other service backup

ACTION=stop
sudo systemctl ${ACTION} elasticsearch
else
echo "[WARN] $(display_date) ElasticSearch not deployed. Cannot be stopped !!!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should stop here

pgrep -U $(id -u) soffice | xargs kill -9
fi
else
echo "[WARN] ${PLF_NAME} not deployed. Cannot be stopped !!!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should stop here

vsellier and others added 7 commits March 7, 2019 20:24
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Co-Authored-By: bourasom <omar.bouras@exoplatform.com>
Copy link
Contributor

@vsellier vsellier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • You should centralize the systemd services start and stop in a generic management script to have the same controls (service declaration, command and service status) for all of them

@@ -0,0 +1,20 @@
#!/bin/bash -eu
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be name _startDatabase.sh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


display_time mongodump -o ${BACKUP_WORKING_DIR}/tmp_mongo --db=${EXO_CHAT_MONGODB_NAME}
#display_time sudo chown -R exo:exo ${BACKUP_WORKING_DIR}/tmp_mongo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should create an tar of the backuped data and cleanup the wordking dir after

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@bourasom
Copy link
Member Author

* You should centralize the systemd services start and stop in a generic management script to have the same controls (service declaration, command and service status) for all of them

Done

Vincent Sellier added 3 commits April 11, 2019 20:01
- centralize the service detection on _functions.sh
- Remove an unnecessary variable containing the action
- Don't stop anymore tomcat if an error is detected during the startup
- Rename _*PLF.sh _*eXo.sh
Vincent Sellier added 4 commits April 12, 2019 00:48
- ensure we go back to the initial directory at the end
- ensure the backup is made from the n-1 level and don't assume the data dir is name data
- use elasticsearch instead of elastic
- respect the full path for the backup
- Rename database name paramter
- Rename finale dump to respect usual template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants