Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clickhouse && Docker Connection refused

Error 'Connection refused'

I tried a lot, but to no avail.

My configs.

docker-compose.yml

gc-clickhouse:
    image: yandex/clickhouse-server:21.7.4.18
    container_name: clickhouse
    ulimits:
        nofile:
            soft: 262144
            hard: 262144
    volumes:
        - ${GC_CLICKHOUSE_DATA_PATH:-../data/clickhouse}:/var/lib/clickhouse:cached
        - /etc/localtime:/etc/localtime:ro
        - /etc/timezone:/etc/timezone:ro
        - ./docker/clickhouse/config.xml:/etc/clickhouse-server/config.xml
        - ./docker/clickhouse/users.xml:/etc/clickhouse-server/users.xml
    ports:
        - 8123:8123
        - 9000:9000
    networks:
        - bridge

Config listen config.xml

<listen_host>::</listen_host>
<!-- Same for hosts with disabled ipv6:-->
<listen_host>0.0.0.0</listen_host>
<!-- Default values - try listen localhost on ipv4 and ipv6: -->

<!--<listen_host>::1</listen_host>
<listen_host>127.0.0.1</listen_host> -->

Added default user in users.xml

<users>
    <default>
        <password>password</password>
        <networks>
            <ip>::/0</ip>
        </networks>
        <!-- Settings profile for user. -->
        <profile>default</profile>
        <!-- Quota for user. -->
        <quota>default</quota>
        <!-- User can create other users and grant rights to them. -->
        <!-- <access_management>1</access_management> -->
    </default>

Where did I go wrong?

like image 602
Роман Avatar asked Feb 25 '26 17:02

Роман


1 Answers

I found the problem. My configuration files were not loaded because there was no access to the "/var/log/clickhouse-server" folder. I specified it to save the logs. Fixed access and everything worked

like image 80
Роман Avatar answered Feb 28 '26 16:02

Роман



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!