Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set password for distributed table in cluster discovery mode #58063

Closed
gogodjzhu opened this issue Dec 20, 2023 · 2 comments · Fixed by #58123
Closed

How to set password for distributed table in cluster discovery mode #58063

gogodjzhu opened this issue Dec 20, 2023 · 2 comments · Fixed by #58123
Assignees
Labels
comp-distributed Distributed tables experimental feature Bug in the feature that should not be used in production feature

Comments

@gogodjzhu
Copy link

I have a ck cluster with users.xml to specified password for users. But when I try to query a distributed table on it, I got exception:

10.132.174.22 :) select * from db1.table1_dist;                                                                                                                                                                      
                                                                                                                                                                                                                     
SELECT *                                                                                                                                                                                                             
FROM db1.table1_dist                                                                                                                                                                                                 
                                                                                                                                                                                                                     
Query id: 3a0269d4-6048-463c-b442-8e9861ab505d                                                                                                                                                                       
                                                                                                                                                                                                                     
Connecting to localhost:9000 as user default.                                                                                                                                                                        
Exception on client:                                                                                                                                                                                                 
Code: 516. DB::Exception: Received from localhost:9000. DB::Exception: default: Authentication failed: password is incorrect, or there is no user with such name.                                                    
                                                                                                                                                                                                                     
If you have installed ClickHouse and forgot password you can reset it in the configuration file.                                                                                                                     
The password for default user is typically located at /etc/clickhouse-server/users.d/default-password.xml                                                                                                            
and deleting this file will reset the password.                                                                                                                                                                      
See also /etc/clickhouse-server/users.xml on the server where ClickHouse is installed.                                                                                                                               
                                                                                                                                                                                                                     
. (AUTHENTICATION_FAILED)     

What I know is to config user and password in remote_servers.replica, just like #5823 discuss. But I am deploy mode in cluster discovery mode like this which seems no properties about username/password.

Thx.

@gogodjzhu gogodjzhu added the question Question? label Dec 20, 2023
@vdimir vdimir added feature comp-distributed Distributed tables experimental feature Bug in the feature that should not be used in production and removed question Question? labels Dec 21, 2023
@vdimir
Copy link
Member

vdimir commented Dec 21, 2023

Hi @gogodjzhu, thank you for the report!

Unfortunately, setting a password is not possible in the current implementation. (Link to the code if you are interested:

ClusterConnectionParameters params{
/* username= */ context->getUserName(),
/* password= */ "",
)

So, it's something that has to be implemented. I assume it's not too challenging, and I'll check if it's feasible to implement it quickly.

@UnamedRus
Copy link
Contributor

BTW, it would be nice to have support for secret instead of user/password (as it's newer alternative) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-distributed Distributed tables experimental feature Bug in the feature that should not be used in production feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants