Getting 'Password required for user default' while running a select query on a distributed table

2,319 views
Skip to first unread message

sparsh sidana

unread,
Jul 9, 2019, 1:15:11 PM7/9/19
to ClickHouse
I logged in one of the nodes in my cluster with appropriate user that has rights to the database.
I logged in using: clickhouse-client --user test --password
However, when I query the distributed table I've. I'm getting this error from the other nodes:

DB::Exception: Password required for user default.

What seems to be happening is that while trying to query the table, it's running on the select query on the nodes using the default user.  How do we write the query so that it we don't get this authentication error from the other nodes?

Denis Zhuravlev

unread,
Jul 9, 2019, 1:48:27 PM7/9/19
to ClickHouse
Distributed table uses a cluster description. The cluster description has user/password sections.


<remote_servers>
<test_cluster>
<shard>
<internal_replication>true</internal_replication>
<replica>
<host>node1</host>
<port>9000</port>
<user>awesome</user>
<password>awesomexxx</password>
</replica>
<yandex>

Or you can configure passwordless user in the cluster description and restrict access for this user to only from CH nodes.

<yandex>
    <users>
        <default>
            <networks>
                <ip>::1</ip>
                <ip>127.0.0.1</ip>
                 <ip>x</ip>
                 <ip>y</ip>

sparsh sidana

unread,
Jul 9, 2019, 2:00:56 PM7/9/19
to ClickHouse
Thanks for the response.
Just wondering how do i provide multiple users in the first approach? As I'll have more than one users with different access for each one.

Denis Zhuravlev

unread,
Jul 10, 2019, 8:40:38 PM7/10/19
to ClickHouse
 CH does not have table grants so if you granted RW or RO access to a user on database the user will get access to all tables.

Though row level security was added recenlty.
Reply all
Reply to author
Forward
0 new messages