NodeJS microservice with persistence on Infinispan
-
npm install
-
node app.js
Install Openshift "all-in-one" cluster either by:
-
Downloading it directly from https://github.com/openshift/origin/releases. Look for openshift-origin-client-tools-your-platform.tar.gz
-
Building from the sources
git clone https://github.com/openshift/origin.git make clean build sudo cp _output/local/bin/linux/amd64/oc /usr/local/bin
oc cluster up
git clone https://github.com/infinispan-demos/nodejs-infinispan-openshift/
oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q)
oc create -f openshift/nodejs-infinispan.json
Acess the endpoint using the public IP, example:
http://nodejs-infinispan-myproject.192.168.1.85.xip.io/greet?name=Hodor
Use oc get route to find out the exact host.
First verify that everything is up and running in the web console. Next use:
oc deploy datagrid --latestto rollout a new Infinispan clusteroc deploy nodejs-infinispan --latestto rollout a new nodejs cluster
Note that no data has been lost.