This option is recommended for those users who want to deploy the Context Broker Healthy Leisure in a local environment or in a cloud environment that have Windows or Linux operating systems.
The steps for the deployment are the following:
-
Clone the repo if you don't have in the installation step. For cloning the repo execute the following command in the folder that you decide to build the Context Broker Healthy Leisure.
cd workspace/ git clone https://github.com/ConnectingEurope/Context-Broker-Healthy-Leisure.git
-
Check if Docker is running on the computer.
-
Open a terminal and go to the folder: workspace/src
cd workspace/src
-
Edit the .env file and changes the parameters with your configuration. In the file you can change the paths, the version of the base image and the ports.
-
Edit the docker-compose.yml file and changes the parameters with your configuration.
-
Edit the config.py file in code > src > config for change the users, passwords, routes and GeoJSON.
-
In the volumes folder, create the MySQL folder.
-
Inside MySQL volume folder create a folder named "init".
-
In the "init" folder, copy the init.sql file. This file is in the templates folder (link)
-
In case of Windows run the script called deploy_windows.bat:
deploy_windows.bat
In case of Linux run the script called deploy_linux.sh
sh deploy_linux.sh
-
Now, the needed images are being downloaded from DockerHub and the Docker Compose will be able to build the containers. The containers will be started after the download and build.
-
Execute the following command in the terminal:
docker ps
-
There should be twelve new containers in Docker:
-
cbenabler-client-container
-
context-providers-container
-
modbus-providers-container
-
flask-server-container
-
db-mysql-container
-
cbenabler-server-container
-
fiware-orion-ld-container
-
kibana-container
-
nifi-container
-
elasticsearch-container
-
zookeeper-container
-
mongo-db-container
Illustration 1. Docker images of Local/Cloud environment tutorial
-
-
At the beginning the Apache Nifi interface is empty, so we have to upload the custom execution flow.
- Upload template: Click on the button to upload the template on the left panel and choose the template "orionld-nifi-elastic.xml". This template is inside the volume of nifi, you have to download it, and you must have it in local in order to be able to upload it.
Illustration 2. Nifi template
- Create template module: Drag the template module from the top menu to the centre of the screen, when you stop dragging a new window will appear, and you will have to select the template uploaded in the previous step.
- Run the process: Finally, when the module "OrionLD-Nifi-Elastic" is loaded, you can start the process by clicking on the play button on the left menu.
Illustration 3. Nifi Start flow process
-
Go to the web browser and try to access the Context Broker Healthy Leisure using the following URL:
Local environment:
localhost
Cloud environment:
http://public IP address //example: http://172.167.80.195
If the deployment was done succesfully, you should see the Context Broker Healthy Leisure.