为什么在分布式引擎表目录中创建的碎片目录中输入密码?

发布于 2025-01-28 05:02:55 字数 1216 浏览 4 评论 0原文

我已经设置了3个碎片,包括簇上的本地碎片,如下所示。

<log>
    <secret>users</secret>
    <shard>
         <replica>
             <host>127.0.0.1</host>
             <port>9000</port>
         </replica>
    </shard>
    <shard>
         <replica>
             <host>remote1</host>
             <port>9000</port>
         </replica>
    </shard>
    <shard>
         <replica>
             <host>remote2</host>
             <port>9000</port>
         </replica>
    </shard>
</log>

我创建了一个分布式引擎表,包括SHRDing密钥。

当在分布式表上执行插入查询时, 在“ ClickHouse Data Dilectory”中的“分布式表目录”中创建了包含密码的碎片目录。

例如,如果ClickHouse数据目录为

/etc/clickhouse-server/data/

,并且在本地DB中创建了名为log_total的分布式表。

当我执行时,将其插入local.log_total .....查询。

在此路径中 如下所示,创建了三个目录。

default:password@127%2E0%2E0%2E1:9000#dbname
default:password@remote1:9000#dbname
default:password@remote2:9000#dbname

我希望此目录不包含密码。

我认为使用秘密标签可以解决它,但事实并非如此。

有什么好方法吗?

请分享您的经验。

谢谢。

I have set up 3 shards including local shards on the cluster as shown below.

<log>
    <secret>users</secret>
    <shard>
         <replica>
             <host>127.0.0.1</host>
             <port>9000</port>
         </replica>
    </shard>
    <shard>
         <replica>
             <host>remote1</host>
             <port>9000</port>
         </replica>
    </shard>
    <shard>
         <replica>
             <host>remote2</host>
             <port>9000</port>
         </replica>
    </shard>
</log>

And I created a distributed engine table including the shrding key.

When INSERT Query is executed on a distributed table,
a directory of shards containing passwords is created in the 'distributed table directory' in the 'ClickHouse data directory'.

For example, if the ClickHouse data directory is

/etc/clickhouse-server/data/

and a distributed table named log_total is created in the local db.

When I execute INSERT INTO local.log_total ..... query.

In this path (/etc/clickhouse-server/data/local/log_total/)
three directories are created as shown below.

default:password@127%2E0%2E0%2E1:9000#dbname
default:password@remote1:9000#dbname
default:password@remote2:9000#dbname

I wish this directories didn't contain passwords.

I thought using the secret tag would solve it, but it wasn't.

Is there any good way?

Please share your experience.

thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黯淡〆 2025-02-04 05:02:55

有一个设置

 --use_compact_format_in_distributed_parts_names arg  
                              Changes format of directories names for distributed table insert parts.

,如果use_compact_in_in_distributed_pa​​rts_names = 1,则默认情况下启用了它,

SELECT
    name,
    value
FROM system.settings
WHERE name = 'use_compact_format_in_distributed_parts_names'

┌─name──────────────────────────────────────────┬─value─┐
│ use_compact_format_in_distributed_parts_names │ 1     │
└───────────────────────────────────────────────┴───────┘

然后文件夹名称变为shard_1_replica_1而没有用户名/密码。

您使用什么CH版本?

There is a setting for this

 --use_compact_format_in_distributed_parts_names arg  
                              Changes format of directories names for distributed table insert parts.

and it's enabled by default

SELECT
    name,
    value
FROM system.settings
WHERE name = 'use_compact_format_in_distributed_parts_names'

┌─name──────────────────────────────────────────┬─value─┐
│ use_compact_format_in_distributed_parts_names │ 1     │
└───────────────────────────────────────────────┴───────┘

If use_compact_format_in_distributed_parts_names=1 then folder name became shard_1_replica_1 without username/password.

What CH version do you use?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文