MongoDB with RockMongo on CentOS
RockMongo is a MongoDB administration GUI tool, written in PHP 5.
MongoDB is a NoSQL document-oriented database and it is cross-platform which makes the process of data integration faster and much easier.
Main features:
- Open source under New BSD License
- Runs fast, and easy to install
- I18N (English, Chinese(English, Chinese, French, Japanese, British, Spanish, German, Russion, Italian)
- System
- Multiple hosts, and one host can has multiple administrators
- Switch among hosts freely
- Password protection
- Server
- Server info (web server, PHP, directives in PHP.ini ...)
- Status
- Databases overview
- Replication status
- Database
- Query, create, drop, repair
- Execute commands and javascript codes
- Statistics
- Profiling
- Users management
- Data transfer(clone)
- Export/import
- Collection
- Advanced query and explain tool
- Read, insert, update, duplicate and remove single row
- Query, create and drop indexes
- Validate collection
- Clear all records in collection
- Remove and change a batch of criteria matched rows
- Statistics
- Rename
- Modify properties (capped, size, max ...)
- Data transfer(clone)
- Export/import
- Field
- Update/Remove/Clear operations
- GridFS
- View chunks
- Download file
INSTALL MONGODB and ROCKMONGO
First you need to install some much needed packages. Execute the following command:
yum install git install gcc php-pear php-devel openssl-devel unzip
Now create a MongoDB repo using your favorite text editor. and paste following code
# nano /etc/yum.repos.d/mongodb.repo
[mongodb] name=MongoDB Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ gpgcheck=0 enabled=1
Install MongoDB:
# yum install mongo-10gen mongo-10gen-server
Start MongoDB and enable it to start on boot:
# systemctl start mongod
# systemctl enable mongod
You can check the status of MongoDB with the below commands:
# systemctl status mongod
# mongostat
MongoDB is now installed on your server, so let’s continue with the RockMongo installation. RockMongo needs an active php_mongo extension. So let’s start. To install php_mongo we will use PECL. PECL is a repository for PHP Extensions.
# pecl install mongo
Once the installation is finished you should get the message below:
Build process completed successfully Installing '/usr/lib64/php/modules/mongo.so' install ok: channel://pecl.php.net/mongo-1.6.13 configuration option "php_ini" is not set to php.ini location You should add "extension=mongo.so" to php.ini
As the message says, you now need to edit your server php.ini file and add the Mongo extension. To find which is your actual php.ini file execute:
# php -i |grep php.ini
Now edit the file and paste the 'extension=mongo.so' line in the 'Dynamic Extensions' section. Save and close the file. Then restart Apache for the changes to take effect.
# nano /etc/php.ini
# service httpd restart
Verify that the extension is available and output bellow
# php -m | grep -i mongo
mongo
Now download RockMongo and install it. Enter the /opt directory:
# cd /opt
# wget https://github.com/iwind/rockmongo/archive/master.zip
# unzip master.zip
# mv rockmongo-master/ /var/www/html/rockmongo
Now Restart the server with following command:
# service httpd restart
Now open your favorite web browser and navigate to http://your_server_IP/rockmongo/ where you will be welcomed by the RockMongo interface as shown in the image below:
0 comments:
Post a Comment