After some research,I decide to use RockMongo.It is a MongoDB administration tool, written in PHP5, is Best in PHP world, more like PHPMyAdmin.You can download it from http://rockmongo.com/downloads.
Since it used PHP and Mongo db,when we deploy this app to the BlueMix,there are some steps we need to do.
1.Unzip the download package to specified folder. For exmaple c:\rockmongo
2.Create a manifest.yml in the c:\rockmongo.The manifest document has captured all of the configuration that we entered above for the application push into a description of the application deployment. Once you have a manifest.yml file, you can modify it however you would like.Copy the below content to this manifest.yml
- name: php-mongoAdmin
3.Since this php application need to use mongo module,so you need to included php_mongo in the list of extensions in the buildpack options file. This is documented here:
So we need to create a folder named .bp-config under your project and create a options.json file which will include php extension ,so when you install php buildpack it will install the dependency based on this options.json file.
"PHP_EXTENSIONS": ["bz2", "zlib", "curl", "mcrypt", "mongo"]
5.When we config rockmongo db info we need to know the mongo db name,ip ,user name ,password etc info.In order to get this kind of info,we double click the mongo db service,choose the application used this service then find the env log under the Files and Logs directory.You can get db credential info.
6.Open the config,php change the setting value based on the step5.You can add multiple server in this configuration file.
$MONGO["servers"][$i]["mongo_name"] = "220.127.116.11";//mongo server name
$MONGO["servers"][$i]["mongo_host"] = "18.104.22.168";//mongo host
$MONGO["servers"][$i]["mongo_port"] = "10014";//mongo port
$MONGO["servers"][$i]["mongo_timeout"] = 0;//mongo connection timeout
$MONGO["servers"][$i]["mongo_db"] = "db";//default mongo db to connect, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_user"] = "430f4c04-9ab0-49b2-95c8-226a3db5386f";//mongo authentication user name, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_pass"] = "a30d54be-2159-48ee-ae33-ca50d1ecc3ef";//mongo authentication password, works only if mongo_auth=false
$MONGO["servers"][$i]["mongo_auth"] = true;//enable mongo authentication?
7.Create a composer.json empty file. This file describes the dependencies of your project and may contain other metadata as well.
So by now all the configuration changes are done.The next step just deploy the app to the BlueMix.
Using the cloud foundry v6 cli, login to BlueMix and deploy your modified files using a PHP buildpack runtime.
# Step 0: cf login -a <api target url>
$ cf login -a https://api.ng.bluemix.net
# Step 1: under the rockmongo project folder
$ cf push
After successfully deployment,open the browser and visit the http://php-mongoadmin.ng.bluemix.net/,you will see below login screen
After input the db credential ,you can see Mongo db management UI.Now we can totally control our db in the cloud.
During my research ,I find some technical difficulty,so I post some questions on dw bluemix fourm and got my answers.It is a place to ask BlueMix usage questions since lots of IBM experts there.