Running the Example in Openshift
This code base was generated using the FIS 2.0 maven archetypes https://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/6.3/html/fuse_integration_services_2.0_for_openshift/ . Obviously to deploy to Openshift an Openshift environment is needed. The easiest way to do this in a local environment is to use minishift https://access.redhat.com/documentation/en-us/red_hat_jboss_fuse/6.3/html/fuse_integration_services_2.0_for_openshift/get-started-dev#get-started-prereq .
Firstly you will need to deploy an InfluxDB server and a Grafana instance into your Openshift instance.
git clone https://github.com/feedhenry/sync-metrics-openshift
export INFLUXDB_STORAGE=1Gi
cd sync-metrics-openshift/
oc new-app -p STORAGE_SIZE="$INFLUXDB_STORAGE" -f ./influxdb-template.yaml
export GRAFANA_STORAGE=2Gi
oc new-app -p STORAGE_SIZE="$GRAFANA_STORAGE" -f ./grafana-template.yaml
Then use
oc get pod
to find out the name of the influxdb pod. Then obtain a remote shell to that pod
oc rsh <pod name> bash
and then
influx
Connected to http://localhost:8086 version 1.5.1
InfluxDB shell version: 1.5.1
> CREATE DATABASE ttndb
> USE ttndb
Using database ttndb
> create retention policy "default" on ttndb duration 0d replication 1 default
The example can be built and run on OpenShift using a single goal (if you experience issues with missing image streams then follow instructions in the section 'Importing Image Streams'. Update the file
src/main/fabric8/deployment.yml
with values applicable to your TTN application, device:
mvn fabric8:deploy
When the example runs in OpenShift, you can use the OpenShift client tool to inspect the status
To list all the running pods:
oc get pod
Then find the name of the pod that runs this quickstart, and output the logs from the running pods with:
oc logs <pod name>
You can also use the openshift web console to manage the running pods, and view logs and much more.