|
| 1 | += Nitrite DataGate |
| 2 | + |
| 3 | +If you are using Nitrite Database in your applications and want to synchronize the data in |
| 4 | +real-time across the devices, you need DataGate. |
| 5 | + |
| 6 | +Nitrite DataGate is the replication server for Nitrite database. It comes as a separate product. |
| 7 | +It is available as a binary distribution or as a docker image. |
| 8 | + |
| 9 | +To get the latest binary distribution please visit the |
| 10 | +https://github.com/dizitart/nitrite-database/releases[Release] page of Github. |
| 11 | +The docker image is available at docker hub |
| 12 | + |
| 13 | +[source,bash] |
| 14 | +-- |
| 15 | +docker pull dizitart/nitrite-datagate |
| 16 | +-- |
| 17 | + |
| 18 | +*Configuration* |
| 19 | + |
| 20 | +DataGate server needs a MongoDb instance to run. To configure Mongo details, edit the file |
| 21 | +*datagate.properties* inside the *conf* directory of the binary distribution and set the below |
| 22 | +properties |
| 23 | + |
| 24 | +[source,properties] |
| 25 | +-- |
| 26 | +# Mongo Config |
| 27 | +datagate.mongo.host= |
| 28 | +datagate.mongo.port= |
| 29 | +datagate.mongo.user= |
| 30 | +datagate.mongo.password= |
| 31 | +datagate.mongo.database= |
| 32 | +-- |
| 33 | + |
| 34 | +And run the server, execute the below command from bin folder |
| 35 | + |
| 36 | +[source,bash] |
| 37 | +-- |
| 38 | +./datagate.sh |
| 39 | +-- |
| 40 | + |
| 41 | +To configure and run the docker image, some details like MongoDb connection |
| 42 | +needs to be provided. Create some docker file like below and build it for |
| 43 | +the desired result. |
| 44 | + |
| 45 | +[source,docker] |
| 46 | +-- |
| 47 | +FROM dizitart/nitrite-datagate |
| 48 | + |
| 49 | +COPY keystore.jks / |
| 50 | + |
| 51 | +## Connection details (Replace with your own values) |
| 52 | +ENV DATAGATE_HOST "0.0.0.0" |
| 53 | +ENV DATAGATE_HTTP_PORT "8080" |
| 54 | +ENV DATAGATE_HTTPS_PORT "8443" |
| 55 | +ENV DATAGATE_MONITOR_PORT "9090" |
| 56 | +ENV DATAGATE_KEY_STORE "keystore.jks" |
| 57 | +ENV DATAGATE_KEY_PASSWORD "s3cret" |
| 58 | + |
| 59 | +## Mongo connection details (Replace with your own values) |
| 60 | +ENV DATAGATE_MONGO_HOST "192.168.0.100" |
| 61 | +ENV DATAGATE_MONGO_PORT "2706" |
| 62 | +ENV DATAGATE_MONGO_USER "demo" |
| 63 | +ENV DATAGATE_MONGO_PASSWORD "demoPass" |
| 64 | +ENV DATAGATE_MONGO_DATABASE "demo" |
| 65 | + |
| 66 | +## Starts the server |
| 67 | +RUN ["chmod", "+x", "./datagate.sh"] |
| 68 | +ENTRYPOINT [ "./datagate.sh" ] |
| 69 | +-- |
| 70 | + |
| 71 | +Once the server is up and running, access the admin portal using the url |
| 72 | +-- |
| 73 | + http(s)://<ip>:<port>/datagate |
| 74 | +-- |
0 commit comments