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 use external clickhouse with auth? #3076

Open
1 task done
serrrios opened this issue Jul 17, 2024 · 2 comments
Open
1 task done

How to use external clickhouse with auth? #3076

serrrios opened this issue Jul 17, 2024 · 2 comments
Assignees
Labels
bug Bug report

Comments

@serrrios
Copy link

Description

How to use external clickhouse with auth?

Expected Results

I try with PERCONA_TEST_PMM_CLICKHOUSE_ADDR: "pmm:[email protected]:9000"
In /usr/sbin/percona-qan-api2:
stdlog: Connection: code: 516, message: default: Authentication failed: password is incorrect, or there is no user with such name.
In Grafana datasource config i see on address "pmm" and user/pass is empty.

Actual Results

Version

helm, image: "percona/pmm-server:2.42.0"

Steps to reproduce

No response

Relevant logs

No response

Code of Conduct

  • I agree to follow Percona Community Code of Conduct
@serrrios serrrios added the bug Bug report label Jul 17, 2024
@BupycHuk
Copy link
Member

BupycHuk commented Aug 7, 2024

Hi @serrrios, it's not supported yet, we will work on implementing it in PMM 3.X releases.

@ddkozyreva
Copy link

ddkozyreva commented Feb 19, 2025

Hi!

Some workaround for me is adding ch_username and ch_password in dsn string in clickhouse external vars.

For example, in v3 it will look like PMM_CLICKHOUSE_ADDR: "{{ ch_username }}:{{ ch_password }}@{{ ch_host }}:9000" (and PMM_CLICKHOUSE_DATABASE: "{{ ch_db }}").

But in v2 there is another format of clickhouse dsn, for example for version 2.43.2 it will look like PERCONA_TEST_PMM_CLICKHOUSE_DATABASE: "{{ ch_db }}&username={{ ch_username }}&password={{ ch_password }}" (and PERCONA_TEST_PMM_CLICKHOUSE_ADDR: "{{ ch_host }}:9000")

As I found out, it depends from which version of github.com/ClickHouse/clickhouse-go is used here https://github.com/percona/pmm/blob/v3/go.mod#L18. There are different versions of clickhouse-go in different pmm versions and the dsn format may vary.

See also https://github.com/percona/pmm/blob/v3/managed/cmd/pmm-managed/main.go#L771, where clickhouse dsn string is formed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants