This folder containes a GATE-NODE platform composition, using Docker Compose as tool for orchestrating all services.
- On linux edit the daemon.json file and follow these steps:
# go to /etc/docker ant create the file deamon.json and edit:
{
"insecure-registries" : ["156.148.132.82:5000","192.168.193.139:5000"]
}
- Reboot the machine from shell:
reboot
- For other platforms follow these steps https://docs.docker.com/registry/insecure
Before starting the platform you have to init the environment variables both for single container execution and for orchestration purposes. This repo provides you two default environment files called:
-
env_file.default containing the variables for docker images configuration
-
.env.default containing the variables for docker compose configuration
You have just to rename and set the proper variables' values:
# copy and rename the environment files
cp env_file.default env_file
cp .env.default .env
# set variables values
nano env_file
nano .env
In the .env file change the variables:
- GATENODE_IMAGE
- MEDIANODE_IMAGE
put gate-node/media-node or gate-node_arm/media-node_arm depending on whether you have an arm architecture or not.
In the .env_file file change the variable:
- NODE_NAME
In order to execute the GATE-NODE platform in a single machine mode, it is necessary to install the following tools in the machine:
-
Docker Engine (>= 19.03.1) to execute the container services
-
Docker Compose (>= 1.24.1) to orchestrate the container execution
To run FIRST time the composed/orchestrated services you have just to run the following command:
/bin/bash init.sh
Now the GATE-NODE and whole plugins are runnning.
To stop and remove all service containers you have to run the following command:
/bin/bash stop.sh
When you want restart the services you have to run the following command:
/bin/bash start.sh
- On shell execute
/bin/sh start.sh
IMPORTANT: Every time the init.sh is launched the system is reset and a new node will be created, for this reason it is important not to use it more than once. Then always use start.sh to restart the system.
- On shell execute
/bin/sh uninstall.sh
Once that gate-node is turn on, another application could send message by socket.io with this kind configuration:
- hostname: localhost
- port: 3002
- channel/topic/room: "gatenode"
{ "destination": [node1,node2,node3,...], payload:{...}}
IMPORTANT:
- these message is a JSON format file and not a STRING;
- in the destination "node" represent the names of the nodes to which to send json messages.