Lisk Core Binary install returns error "A process is already listening on port 5432"

Problem:

After running installLisk.sh , the installation script is aborted with the following output:

Error: A process is already listening on port 5432 PostgreSQL by default listens on 127.0.0.1:5432 and attempting to run two instances at the same time will result in this installation failing To proceed anyway, use the -i flag to ignore the warning.

PostgreSQL is already installed on your system and listening to the PostgreSQL default port 5432. For example, this can happen when a second Lisk Core node is installed on the same server.

Solution 1:
If postgreSQL has been installed globally on the system, disable it using the following commands:

sudo systemctl stop postgresql
sudo systemctl disable postgresql

Possible data inside of databases remains stored in this case.

Solution 2:
If postgreSQL has been installed globally on the system and the data in it is not needed anymore, simply remove the already installed postgreSQL by running the following command:

sudo apt-get --purge remove postgresql postgresql-doc postgresql-common

With source install, you can also start a new cluster of psql on another port, as :
sudo pg_createcluster -p 5433 --locale en_US.UTF-8 --start 10 main
And then, define it in your config or env
LISK_DB_PORT=5433

Perhaps this could also be possible with binary and commander, i never tried yet

1 Like