Skip to content

Issues bringing up local cluster #351

@sougou

Description

@sougou

I found some issues bringing up the local cluster:

  1. The first postgres instance tries to start on port 5432 and fails if I'm already running my own postgres. We need to make sure we choose an available port for them:
17:30:06 main .../multigres ❯ bat /Users/sougou/code/multigres/multigres_local/data/pooler_5zs59dpr/pg_data/postgresql.log
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /Users/sougou/code/multigres/multigres_local/data/pooler_5zs59dpr/pg_data/postgresql.log
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │  2025-12-14 11:34:11.154 UTC [94455] LOG:  starting PostgreSQL 17.6 (Homebrew) on aarch64-apple-darwin24.4.0, compiled by Apple clang version 17.0.0 (clang-1700.0.13.3), 64-bit
   2   │  2025-12-14 11:34:11.155 UTC [94455] LOG:  could not bind IPv6 address "::1": Address already in use
   3   │  2025-12-14 11:34:11.155 UTC [94455] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
   4   │  2025-12-14 11:34:11.155 UTC [94455] LOG:  could not bind IPv4 address "127.0.0.1": Address already in use
   5   │  2025-12-14 11:34:11.155 UTC [94455] HINT:  Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
   6   │  2025-12-14 11:34:11.155 UTC [94455] WARNING:  could not create listen socket for "localhost"
   7   │  2025-12-14 11:34:11.155 UTC [94455] FATAL:  could not create any TCP/IP sockets
   8   │  2025-12-14 11:34:11.155 UTC [94455] LOG:  database system is shut down
  1. The port numbers for multigateway seem odd:
17:35:01 main .../multigres ❯ pgrep -fl multigateway
42431 /Users/sougou/code/multigres/bin/multigateway --http-port 15102 --grpc-port 15172 --pg-port 5434 --topo-global-server-addresses localhost:2379 --topo-global-root /multigres/global --topo-implementation etcd2 --cell zone3 --log-level info --log-output /Users/sougou/code/multigres/multigres_local/logs/dbs/postgres/multigateway/krx8xjkb.log --hostname localhost
42432 /Users/sougou/code/multigres/bin/multigateway --http-port 15100 --grpc-port 15170 --pg-port 15432 --topo-global-server-addresses localhost:2379 --topo-global-root /multigres/global --topo-implementation etcd2 --cell zone1 --log-level info --log-output /Users/sougou/code/multigres/multigres_local/logs/dbs/postgres/multigateway/lj8wqmfb.log --hostname localhost
42438 /Users/sougou/code/multigres/bin/multigateway --http-port 15101 --grpc-port 15171 --pg-port 5433 --topo-global-server-addresses localhost:2379 --topo-global-root /multigres/global --topo-implementation etcd2 --cell zone2 --log-level info --log-output /Users/sougou/code/multigres/multigres_local/logs/dbs/postgres/multigateway/bsbtxsr8.log --hostname localhost

The first multigateway chooses a good port (15432), while the rest choose 5433 and 5434.

  1. I'm only able to connect to the multigateway at 15432. The others are asking for a password:
17:34:12 main .../multigres ❯ psql -h localhost -p 15432 -U postgres -d postgres
psql (17.6 (Homebrew), server 17.0 (multigres))
Type "help" for help.

postgres=> \d
Did not find any relations.
postgres=>
\q
took 23s
17:34:53 main .../multigres ❯ psql -h localhost -p 5433 -U postgres -d postgres
Password for user postgres:
took 2s

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions