Applies to Product: |
|
|
MongoDB is a cross-platform and open-source document-oriented database, a kind of NoSQL database. As a NoSQL database, MongoDB avoids the relational database’s table-based structure to adapt JSON-like documents that have dynamic schemas, which it calls BSON.
This makes data integration for certain types of applications faster and easier. MongoDB is built for scalability, high availability, and performance from a single server deployment to large and complex multi-site infrastructures.
Backing Up MongoDB
To back up MongoDB
-
Connect to the AlienVault Console through SSH and use your credentials to log in.
The AlienVault Setup menu displays.
-
On the AlienVault Setup main menu, select Jailbreak System to gain command line access.
Select Yes when prompted. You will be in the root directory.
-
On the command line, type the following command:
screen
We recommend using the screen session so that you can keep the program running even after you log out.
-
Back up the MongoDB database and create the dump directory:
mongodump --host localhost
-
Compress the file:
tar cvfz alienvault-mongodb-`date +%s`.tgz dump
Adding `date +%s` to the filename gives it a unique time stamp.
-
Remove the dump directory:
rm -rf ./dump
This procedure creates the alienvault-
Restoring MongoDB
Before following the procedure below, you should have deployed the SAME version of USM Appliance. You should have transferred the backup files to the target system and place them in the root directory.
To restore MongoDB
-
Connect to the AlienVault Console through SSH and use your credentials to log in.
The AlienVault Setup menu displays.
-
On the AlienVault Setup main menu, select Jailbreak System to gain command line access.
Select Yes when prompted. You will be in the root directory.
-
On the command line, type the following command:
screen
We recommend using the screen session so that you can keep the program running even after you log out.
-
Stop the following services so that they do not interfere with the process:
/etc/init.d/monit stop
/etc/init.d/ossim-server stop
/etc/init.d/ossim-agent stop
/etc/init.d/ossim-framework stop
/etc/init.d/alienvault-api stop
-
Extract the file:
tar xvzf alienvault-mongodb-<timestamp>.tgz
-
Restore the backup file
mongorestore --db inventory dump/inventory
-
Remove the dump directory:
rm -rf ./dump
-
Restart all services for changes to apply:
alienvault-reconfig -c -v -d