What I’m trying to achieve:
I have a setup using docker-compose that consist of Redis and Postgresql, Geolocation-, Network- and Application-Server. Now I have a network server for Region A but want to add an additional Network server for region B.
What I’ve done so far:
Since I understand that the initdb files in the postgres configuration folder are only read once, I created a new postgres user by connecting as postgres user and executing the commands
create role chirpstack_ns_in with login password 'PASSWORD'; create database chirpstack_ns_in with owner chirpstack_ns_in;
The user creation seems to have been successful, issuing the “\l” command I see the new Database and owner:
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------------±-----------------±---------±-----------±-----------±----------------------
chirpstack_as | chirpstack_as | UTF8 | en_US.utf8 | en_US.utf8 |
chirpstack_ns | chirpstack_ns | UTF8 | en_US.utf8 | en_US.utf8 |
chirpstack_ns_in | chirpstack_ns_in | UTF8 | en_US.utf8 | en_US.utf8 |
After that, I added a new container in the docker-compose.yml file:
chirpstack-network-server-in: image: chirpstack/chirpstack-network-server:3 volumes: - ./configuration/chirpstack-network-server-in:/etc/chirpstack-network-server-in networks: ToolNetwork: ipv4_address: 172.23.0.26
and also copied the complete network server configuration folder. In the new folder, I updated the configuration file to match the different band and inserted the postgresql parameters:
[postgresql]
dsn=“postgres://chirpstack_ns_in:PASSWORD@postgresql/chirpstack_ns_in?sslmode=disable”
What the issue is:
When I now start the new container, I get an error that the connection to the postgresql database failed:
time=“2020-01-29T18:57:54Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“dial tcp 127.0.0.1:5432: connect: connection refused”
Actually I noticed https://github.com/brocaar/chirpstack-docker/issues/27 when debugging the described issue. I tried to login with the credentials which worked perfectly but then noticed also without password I could connect which makes it even more strange to me why I get this error.
Does anyone have an idea what is happening here or what I’m doing wrong? Thanks a lot for any hints.