# OneNet Deployment guide on Users Premisses
The hardware and operating system prerequisites are:
The software prerequisites include:
Onenet software and its components will be delivered utilizing the Docker containers functionalities. Firstly, the Docker platform has to be downloaded and installed accordingly to the OS of the server to host the deployment.
Figure 1. Launching Docker (Windows Server)
Figure 2. Docker Successfully Started (Windows Server)
Troubleshooting:
For 64-bit version of CentOS type:
$ sudo yum update
$ sudo yum install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
For 64-bit version of one of Ubuntu versions (Groovy 20.10, Focal 20.04 (LTS), Bionic 18.04 (LTS), Xenial 16.04 (LTS)) type:
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint <last 8 characters of the fingerprint >
For 64-bit version of CentOS type:
$sudo yum install -y yum-utils
$sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
For 64-bit version of Ubuntu use the following command to set up the stable repository:
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
For 64-bit version of CentOS type:
$sudo yum install docker-ce docker-ce-cli containerd.io
For 64-bit versions of Ubuntu type:
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
$sudo systemctl start docker
$sudo systemctl enable docker
$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits
$ curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$sudo chmod +x /usr/local/bin/docker-compose
To proceed with the installation of ONENET, the user must use the docker folder of this repository that contains all the necessary configuration.
The first step is to clone this repository https://github.com/european-dynamics-rnd/OneNet , by typing:
cd /opt/onenet-true-connector/
git clone https://github.com/european-dynamics-rnd/OneNet.git
There is the docker-compose.yml file located under /opt/onenet-true-connector/docker that contains all the configuration of the onenet fiware true connector containers. Go to that file by typing the command
cd /opt/onenet-true-connector/docker
:warning: At this step you must request from us a file with ".env" name and put it on the same folder /opt/onenet-true-connector/docker. Email us on the helias.karagozidis@eurodyn.com to get the ".env" file.
:information_source: Replace the following environment variables values with "your_ip_where_the_containers_will_be_installed":
After puting the ".env" file in position you can start the containers with the below commands
$docker-compose up –d
$docker-compose logs -f
For this step you must open the Onenet User Interface.
The user interface is in a container that was installed on your premisses on the previous step.
It can be accessed through the url http://the_ip_where_the_containers_are_installed:30003
, so
username
& password
that you received from the onenet administrator.Local Api Url
, Data App Url
, Ecc Url
& Broker Url
.Those 4 onenet applications are running on the containers that you installed, so the urls must be configured accordingly as shown below
The url must be http://your_ip_where_the_containers_are_installed:30001/api
The Data App is also located on the http://your_ip_where_the_containers_are:8484
but it cannot be used this way.
Data App Must Be Publicly Exposed In A Static Ip Via Https, before saved on the connection settings.
This happens because Data App is served as an endpoint for peer to peer file transfer between you and other Onenet users.
So the url must be the https://your_static_url_that_points_to_dataapp_container
The Ecc Url is also located on the https://your_ip_where_the_containers_are:8889/data
but it cannot be used this way.
Ecc Url Must Be Publicly Exposed In A Static Ip Via Https, before saved on the connection settings.
This happens because Ecc Url is served as an endpoint for peer to peer file transfer between you and other Onenet users.
So the url must be the https://your_static_url_that_points_to_ecc_url_container
The url must be http://your_ip_where_the_containers_are:1026
Optionally you can use nginx as web server.
The folder docker/nginx-connector-config/ contains a docker-compose.yml file and an example of nginx configuration (nginx.conf).
The docker-compose.yml defines the nginx service to start (from the official image), the exposed ports and the volumes to mount.
version: "3"
services:
nginx:
image : nginx:latest
ports :
- "8080:8080"
- "80:80"
- "443:443"
volumes:
- ./ssl:/etc/nginx/ssl
- ./nginx.conf:/etc/nginx/conf.d/default.conf
The (nginx.conf) contains header management, SSL configuration and location directives necessary for the correct functioning of the connector.
In particular, for each service to be exposed, a location type directive must be defined with the following configurations (please replace the path and uri placeholders with your own values):
location /<path> {
proxy_pass <uri>;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header X-Forwarded-Proto https;
rewrite ^/<path>/(.*)$ /$1 break;
}
For further information, refer to the Official Nginx Guide.