FAQ for Docker Swarm

This page provides answers to frequently asked questions related to Docker Swarm installations.

Containers keep restarting

You have installed the OpenIAM docker containers and they are continuously restarting and never entering into a 'healthy' state. In this situation, its very likely that your environment does not align with the minimum system requirements described here.

To check your settings, use the following commands:

  • To check memory - free -m
  • To check CPU - lscpu
  • To check free diskpace - df -h

Viewing the logs for a docker container

To see the logs for a docker container, use the command below:

docker logs [container id] --follow

Accidentally locked the sysadmin account

You have just installed OpenIAM and now accidentally locked the system admin preventing you from proceeding. In this case, if you do know the password, you can reset the account locked flag in the database using the following steps. The steps below assume that you are using the OTB MariaDB container, but the concepts apply to all databases.

  • SSH into your database container by first getting the CONTAINER ID using:
watch -n 5 'docker ps'
  • Connect to the container using the following command. You should copy the container id form the previous step
docker exec -it [database container id] bash

You will see a response like the example shown below

I have no name!@[container id]:/$
  • Connect to the openiam database on MariaDB using the command below
mysql -u IAMUSER -p openiam

You will be prompted for a password. This password can be found in the env.sh file.

Run the following sql commands to reset the account locked flag.

update USERS set SECONDARY_STATUS=null where USER_ID='3000';
update LOGIN set IS_LOCKED='0', AUTH_FAIL_COUNT='0', CHALLENGE_RESPONSE_FAIL_COUNT='0' where USER_ID='3000';
commit;

exit twice to leave MariaDB's commandline utility and the container. Restart OpenIAM uisng the steps below.

./shutdown.sh

Wait for all the containers to stop.

./startup.sh

Wait a few minutes for the contianers come up like you did earlier in the installation process.

Uninstalling your OpenIAM Docker Installation

There might be case where you want to uninstall your OpenIAM Docker install. In these cases, follow the steps below

  • Stop your application
cd /usr/local/openiam/openiam-docker-compose
./shutdown.sh
  • Tear down the application
./teardown.sh

if for you see that a volume is still being used, then run the following command:

docker system prune -a

The prune operation will remove all

  • All stopped containers

  • All networks not used by at least one container

  • All images without at least one container associated to them

  • All build cache

  • Remove your docker compose directory

rm -rf openiam-docker-compose/