jbossdemocentral / coolstore-microservice

CoolStore is a containerised polyglot microservices application consisting of services based on JBoss, NodeJS, Spring Boot, WildFly Swarm, Vert.x, Netflix OSS and more running on OpenShift
299 stars 324 forks source link

Problem with rating-mongodb #114

Open tombolala opened 6 years ago

tombolala commented 6 years ago

Hi,

my second mongodb service is not deploying. First one is running, but second aborts - this happens on OpenShift 3.7 cluster.

First service is catalog-mongodb => Waiting for MongoDB daemon up => MongoDB daemon is up

Second one fails (rating-mongodb) 2018-10-23T06:49:02.645+0000 I STORAGE [initandlisten] exception in initAndListen: 98 Unable to lock file: /var/lib/mongodb/data/mongod.lock errno:11 Resource temporarily unavailable. Is a mongod instance already running?, terminating

Ok, apparently there is already the catalog-mongodb running and both pods are on /var/lib/mongodb/data This is, however, running fine on my Notebook with Minishift:

  1. notebook running msa-cicd-eap-min (provision-demo.sh, 1.2.x)
  2. OpenShift Cluster running msa-full (Ansible, 1.2.x) no additional settings, as described on the openshift-demos-ansible page

Thanx in advance, Thomas

tqvarnst commented 5 years ago

Hi Thomas, This is probably because of a storage problem in your openshift cluster. The rating-mongodb service is using a persistant volume claim that is called rating-mongodb-pv (see https://github.com/jbossdemocentral/coolstore-microservice/blob/stable-ocp-3.10/openshift/templates/coolstore-deployments-template.yaml#L957)

You can investigate it a bit more by issuing oc get pvc rating-mongodb-pv

To verify you can override the storage claim of the mongodb using the following command:

oc volumes dc/rating-mongodb --name=mongodb-data --add -t emptyDir --overwrite -n <project-name>

and then delete the claim with the following command:

oc delete pvc rating-mongodb-pv -n <project-name>

After that the mongodb instance should start correctly (it will redeploy automatically)

Cheers Thomas

balajiraman commented 5 years ago

Just change the replicas=1 in the deployment config, it will start up just fine.