Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Prerequisites

  1. A system with Docker or Docker Desktop installed

  2. Precompiled .tar files for the Edge Manager version you prefer

Basic Installation

For this example, the assumptions are:

  • Docker files names:

    • edgemanager3451_32.tar

    • postgres_32.tar

  • Image names:

    • edgemanager_32:3.4.5.1,

    • postgres_tar:latest

  • If the user is in a Linux system then their username is part of the docker user group. If not a member of that group, sudo will be required.

docker load -i ./postgres_32.tar
docker load -i ./edgemanager3451_32.tar
docker network create autosol
docker run -d --name database --network autosol --restart always -e POSTGRES_PASSWORD=postgres POSTGRES_DB="ASIServerDB" postgres_tar:latest
docker run -d --name edgemanager --network autosol -p 8080:8080 --restart always edgemanager_32:3.4.5.1

Note that with only port 8080 exposed for the Edge Manager container, only the web interface will be accessible. OPC UA and Priority Forward cannot be used.

Finding the Image Names

To find the name of the images created by the docker load command, use:

docker image ls

Advanced Installation Details

Optional Ports

The edgemanager container can be created with additional ports open. When opening ports in Docker, the format is: exposedPort:containerPort. For example, to have the Edge Manager website open on port 8880 use the flag “-p 8880:8080”

OPC UA “-p 4840:4840”

Priority Forward can use any port, but the default range is “-p 40000-40010:40000-40010”

Mounted Volumes

If you want data to be preserved when a container is recreated, you will need a mounted volume.

To preserve configuration data, the database needs a mounted drive, the name db-vol is arbitrary:

docker volume create db-vol
docker run -d --name database --network autosol --mount source=db-vol,target=/var/lib/postgresql/data --restart always -e POSTGRES_PASSWORD=postgres POSTGRES_DB="ASIServerDB" postgres_tar:latest

Warning: mounted volumes can preserve bad data as well as good; if a container is created with an error in database name or the wrong architecture .tar is restored, you will need to delete the volumes before a new container can successfully be run!

Full Creation Example

docker load -i ./postgres_32.tar
docker load -i ./edgemanager3451_32.tar
docker network create autosol
docker volume create db-vol
docker run -d --name database --network autosol --mount source=db-vol,target=/var/lib/postgresql/data --restart always -e POSTGRES_PASSWORD=postgres POSTGRES_DB="ASIServerDB" postgres_tar:latest
docker run -d --name edgemanager --network autosol -p 8080:8080 -p 4840:4840 -p 40000-40010:40000-40010 --restart always edgemanager_32:3.4.5.1

Troubleshooting

If a Docker Container fails to run, or continually restarts, you can check the logs to see what might be happening.

Current status of all docker containers can be listed using:

docker container ls -a

Docker logs can be read using:

docker logs containername

Container “edgemanager” Crashes

Often the logs will indicate issues communicating with postgres. Confirm that the “database” container is running and contains a database named “ASIServerDB”. You can access the postgres container using ‘exec’ to enter the terminal

docker exec -it database bash
psql -U postgres -d postgres
CREATE DATABASE “ASIServerDB”;
\q
exit

Container “database” Crashes

The .tar of postgres that we include is a snapshot that may not work with all environments. If the container can’t continue running and the log contains errors like:

popen failure: Cannot allocate memory
initdb: error: program "postgres" is needed by initdb but was not found in the same directory as "/usr/lib/postgresql/15/bin/initdb"

Then the .tar may not be compatible with your system. If you have internet access, you can resolve this by removing the container and image:

docker container rm database
docker image rm postgres_tar:latest

Then recreate the docker container from Dockerhub:

docker run -d --name database --network autosol --restart always -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=”ASIServerDB” postgres

In some cases, you may need to manually specify the Postgres build. For example, on a Debian 9 machine:

docker run -d --name database --network autosol --mount --restart always -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=”ASIServerDB” postgres:11.16-stretch
  • No labels