0

I am trying to deploy two MobileFirst servers using different projects and on different IBM bluemix containers, where both point to the same Cloudant service.

Both MobileFirst servers and projects contain the same WAR file deployed with the same project name, because I want to create a development and a staging environment for myself.

Both projects have the same war file, and the default admin and environment database are the same. I cannot have separate environments, as modifying any one of them also changes the other because the databases are the same.

I also tried the following to create separate databases for the two environments, but it didn't work.

1) In usr/config/wladmin.xml added the following jndi entries to create different named databases.

<jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.adminDbName" value="new_ProjectName_db"/>
<jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.dbNamePrefix" value="ProjectName_dev"/>

2) Also did the same entries on projectName.xml file

<jndiEntry jndiName="ProjectName/mfp.db.cloudant.adminDbName" value="new_ProjectName_db"/>
<jndiEntry jndiName="ProjectName/mfp.db.cloudant.dbNamePrefix" value="ProjectName_dev"/>

After deploying the containers, both the servers still use the same databases and no new databases were created using different names.

Thanks

ralphearle
  • 1,696
  • 13
  • 18

1 Answers1

1

In the 7.1 version you will have to make changes to 2 files.

1.usr/config/wladmin.xml change the "value" to point to the new DB

<jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.username" value="MFPF_CLOUDANT_USERNAME"/>
<jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.password" value="MFPF_CLOUDANT_PASSWORD"/>
<jndiEntry jndiName="${env.MFPF_ADMIN_ROOT}/mfp.db.cloudant.url" value="MFPF_CLOUDANT_URL"/>

2.Change runtimename.xml in the same folder (based on whatever runtime name you have specified) Change the "value" to point to the new DB

<jndiEntry jndiName="MFPF_RUNTIME_NAME/mfp.db.cloudant.username" value="MFPF_CLOUDANT_USERNAME"/>
<jndiEntry jndiName="MFPF_RUNTIME_NAME/mfp.db.cloudant.password" value="MFPF_CLOUDANT_PASSWORD"/>
<jndiEntry jndiName="MFPF_RUNTIME_NAME/mfp.db.cloudant.url" value="MFPF_CLOUDANT_URL"/>

-

Ajay Chebbi
  • 171
  • 8
  • These changes will let me use another cloudant db service, but i dont want to use another cloudant db service. I want both of my servers to point to the same cloudant service but should have different databases. – Ravi Solanki Nov 30 '16 at 12:53
  • The clodant URL should have the Database name embedded in it - change that – Ajay Chebbi Nov 30 '16 at 13:40
  • BTW - the MFP 8.0 version on Liberty build packs is available - you should try that – Ajay Chebbi Nov 30 '16 at 13:41