Hi,
I’m making some tests with Yugabyte to see what is capable of and I’m struggling to be able to connect it.
I’m following the Docker-compose doc and got blocked on “Connection refused”:
yb-client-n1 | 402762 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Complete logs
$ docker-compose up
Creating network “yugabyte_dbinternal” with the default driver
Creating network “yugabyte_dbnet” with the default driver
Creating volume “yugabyte_yb-master-data-1” with default driver
Creating volume “yugabyte_yb-tserver-data-1” with default driver
Creating yb-master-n1 … done
Creating yb-tserver-n1 … done
Creating yb-client-n1 … done
Attaching to yb-master-n1, yb-tserver-n1, yb-client-n1
yb-client-n1 | 0 [main] INFO com.yugabyte.sample.Main - Starting sample app…
yb-client-n1 | 62 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Using a randomly generated UUID : b4456950-1b17-4ecb-a05c-91d219755710
yb-client-n1 | 72 [main] INFO com.yugabyte.sample.common.CmdLineOpts - App: SqlInserts
yb-client-n1 | 72 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Run time (seconds): -1
yb-client-n1 | 72 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Adding node: yb-tserver-n1:5433
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num reader threads: 2, num writer threads: 2
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num unique keys to insert: 2000000
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num keys to update: 0
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Num keys to read: 1500000
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Value size: 0
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Restrict values to ASCII strings: false
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Perform sanity check at end of app run: false
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Table TTL (secs): -1
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Local reads: false
yb-client-n1 | 73 [main] INFO com.yugabyte.sample.common.CmdLineOpts - Read only load: false
yb-client-n1 | 151 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-tserver-n1 | The files belonging to this database system will be owned by user “root”.
yb-tserver-n1 | This user must also own the server process.
yb-tserver-n1 |
yb-tserver-n1 | In YugabyteDB, setting LC_COLLATE to C and all other locale settings to en_US.UTF-8 by default. Locale support will be enhanced as part of addressing [YSQL] Support locale-specific sort order in string keys · Issue #1557 · yugabyte/yugabyte-db · GitHub
yb-tserver-n1 | The database cluster will be initialized with locales
yb-tserver-n1 | COLLATE: C
yb-tserver-n1 | CTYPE: en_US.UTF-8
yb-tserver-n1 | MESSAGES: en_US.UTF-8
yb-tserver-n1 | MONETARY: en_US.UTF-8
yb-tserver-n1 | NUMERIC: en_US.UTF-8
yb-tserver-n1 | TIME: en_US.UTF-8
yb-tserver-n1 | The default database encoding has accordingly been set to “UTF8”.
yb-tserver-n1 | The default text search configuration will be set to “english”.
yb-tserver-n1 |
yb-tserver-n1 | Data page checksums are disabled.
yb-tserver-n1 |
yb-tserver-n1 | creating directory /mnt/tserver/pg_data … ok
yb-tserver-n1 | creating subdirectories … ok
yb-tserver-n1 | selecting default max_connections … 300
yb-tserver-n1 | selecting default shared_buffers … 128MB
yb-tserver-n1 | selecting dynamic shared memory implementation … posix
yb-tserver-n1 | creating configuration files … ok
yb-tserver-n1 | running bootstrap script … ok
yb-tserver-n1 | syncing data to disk … ok
yb-tserver-n1 | 2021-11-21 16:24:46.850 UTC [42] LOG: YugaByte is ENABLED in PostgreSQL. Transactions are enabled.
yb-tserver-n1 | 2021-11-21 16:24:46.854 UTC [42] LOG: pgaudit extension initialized
yb-tserver-n1 | 2021-11-21 16:24:46.856 UTC [42] LOG: listening on IPv4 address “192.168.176.3”, port 5433
yb-tserver-n1 | 2021-11-21 16:24:46.859 UTC [42] LOG: listening on Unix socket “/tmp/.yb.4439665844579941977/.s.PGSQL.5433”
yb-tserver-n1 | 2021-11-21 16:24:46.871 UTC [42] LOG: redirecting log output to logging collector process
yb-tserver-n1 | 2021-11-21 16:24:46.871 UTC [42] HINT: Future log output will appear in directory “/mnt/tserver/yb-data/tserver/logs”.
yb-client-n1 | 2155 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 4158 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 6164 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 8166 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 10169 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 12173 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 14179 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 16180 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 18184 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 20189 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 22191 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 24194 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 26195 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 28197 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 30203 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 32207 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 34212 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
yb-client-n1 | 36213 [main] INFO com.yugabyte.sample.apps.AppBase - Going to retrieve connection again: Connection to yb-tserver-n1:5433 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
docker-compose.yml
version: '2'
volumes:
yb-master-data-1:
yb-tserver-data-1:
networks:
dbinternal:
dbnet:
services:
yb-master:
image: yugabytedb/yugabyte:latest
container_name: yb-master-n1
networks:
- dbinternal
volumes:
- yb-master-data-1:/mnt/master
command: [ "/home/yugabyte/bin/yb-master",
"--fs_data_dirs=/mnt/master",
"--master_addresses=yb-master-n1:7100",
"--rpc_bind_addresses=yb-master-n1:7100",
"--replication_factor=1"]
ports:
- "7000:7000"
environment:
SERVICE_7000_NAME: yb-master
yb-tserver:
image: yugabytedb/yugabyte:latest
container_name: yb-tserver-n1
networks:
- dbinternal
- dbnet
volumes:
- yb-tserver-data-1:/mnt/tserver
command: [ "/home/yugabyte/bin/yb-tserver",
"--fs_data_dirs=/mnt/tserver",
"--start_pgsql_proxy",
"--rpc_bind_addresses=yb-tserver-n1:9100",
"--tserver_master_addrs=yb-master-n1:7100"
]
ports:
- "9042:9042"
- "5433:5433"
- "9000:9000"
environment:
SERVICE_5433_NAME: ysql
SERVICE_9042_NAME: ycql
SERVICE_6379_NAME: yedis
SERVICE_9000_NAME: yb-tserver
depends_on:
- yb-master
yb-client:
image: yugabytedb/yb-sample-apps:latest
container_name: yb-client-n1
networks:
- dbnet
command: [ "--workload", "SqlInserts", "--nodes", "yb-tserver-n1:5433" ]
depends_on:
- yb-tserver
I saw similar topics related to connection refused but nothing helped so far.
Any idea why the demo code is not working in my case?
Thank you