Ongoing Maintenance - EcoSys - Installation & Upgrade - Hexagon PPM

EcoSys Connect Installation and Configuration

Language
English
Product
EcoSys
Search by Category
Installation & Upgrade
EcoSys Version
1.0.01

Copy Log Agents to host

To copy the log agent logs to Host,

  1. Issue the host shell command:

    docker run --user root --rm -ti -v log-agent-log:/tmp/log-agent-log -v $HOME/LogAgentLogs:/tmp/dest alpine /bin/sh -c "tar cvzf /tmp/dest/log-agent-logs.tar.gz /tmp/log-agent-log/*"

    A folder called ‘LogAgentLogs’ appears under the user’s home directory. It contains a logs archive called ‘log-agent-logs.tar.gz’. An extraction tool such as 7zip (www.7-zip.org) can be used to extract the logs within..

Copy MongoDB logs to host

To copy MongoDB logs to the Host,

  1. Issue the host shell command:

    docker run --user root --rm -ti -v mongo-log:/tmp/mongo-log -v $HOME/MongoDBLogs:/tmp/dest alpine /bin/sh -c "tar cvzf /tmp/dest/mongodb-logs.tar.gz /tmp/mongo-log/*"

    A folder name ‘MongoDBLogs’ appears under the user’s home directory. It contains a logs archive called ‘mongodb-logs.tar.gz’. An extraction tool such as 7zip (www.7-zip.org) can be used to extract the logs within.

View MongoDB Logs

To view the MongoDB logs,

  1. Issue the host shell commands below:

    • On Linux

      docker exec -it $(docker ps -q -f name=mongo) /bin/sh -c "tail -30 /var/log/mongodb/mongod.log"

    • On Windows

      docker ps -q -f name=mongo

      docker exec -it <Container ID> /bin/sh -c "tail -30 /var/log/mongodb/mongod.log"

      This displays the last 30 lines of the MongoDB log.

  2. Change the number of lines as necessary.

Backup MongoDB Database

To backup MongoDB database,

  1. Issue the host shell commands below:

    • On Linux

      docker exec -it $(docker ps -q -f name=mongo) /bin/sh -c "exec mongodump -u _BACKUP_USER_ -p _BACKUP_PASS_ -d _DB1_ -–archive" > /some/path/on/your/host/_DB1_.archive

    • On Windows,

      docker ps -q -f name=mongo

      docker exec -it <container ID> /bin/sh -c "exec mongodump -u _BACKUP_USER_ -p _BACKUP_PASS_ -d _DB1_ -–archive" > $Connect/_DB1_.archive

      Replace _BACKUP_USER_ and _BACKUP_PASS_ in this command with the values you selected.

  • Replace _DB1_ in this command with the value you selected. This will generate the (binary) backup file _DB1_.archive on your host which must be backed up elsewhere.

  • Schedule regular backups by wrapping the command(s) above into a script that can be invoked by the Docker host OS scheduler.