MongoDB¶
MongoDB is an open, non-relational database management system written in C++. Data is stored as JSON style documents which allows applications to process them more naturally while maintaining the ability to create hierarchies and indexes. Management is available from the administration panel, after logging in to SSH with the command devil mongo
and the available console applications, through the panel RockMongo and using adminMongo which can be installed on your account.
Warning
The access address to the MongoDB databases depends on the server number. For the server s0.serv00.com
it will be the address mongo0.serv00.com
, for the server s1.serv00.com
- mongo1.serv00.com
, for the server s2.serv00.com
- mongo2 .serv00.com
etc. In the examples the address mongoX.serv00.com
was used.
DevilWEB¶
After logging in to the administration panel, the management of MongoDB databases can be found in the MongoDB
tab. After clicking, the list of MongoDB databases is displayed. You can change the password for each database.
New database¶
To add a new database, click + Add database
and fill in the database name
and password
fields on the next page.
Devil¶
MongoDB configuration is also possible from SHELL using the devil mongo
module.
Adding and removing base¶
Adding the MongoDB database is done with the command devil mongo db add DB_NAME
, where the argument is:
- DB_NAME - database name.
A user with the same login as the database name will be created automatically
.
After executing this command, you will be asked for a password.
Removing the MongoDB database is done with the command devil mongo db del DB_NAME
, where the argument is:
- DB_NAME - database name.
Change the user's password¶
Changing the password of the MongoDB database user is done with the command devil mongo passwd DB_NAME
, where the argument is:
- DB_NAME - name of the database to which the password is changed.
List of bases and users¶
To get a list of all databases and users, use the command devil mongo list
.
Examples¶
All the following operations must be performed after logging in to the account via SSH.
- Database dump to
/usr/home/LOGIN/dump/DB_NAME
directory:
mongodump -d DB_NAME -u DB_NAME -p
- Importing the database what was dumped in the
/usr/home/LOGIN/dump/DB_NAME
directory:
mongorestore -d DB_NAME -u DB_NAME /usr/home/LOGIN/dump/DB_NAME -p