【问题标题】:How to change users.xml from being readonly?如何将 users.xml 从只读更改?
【发布时间】:2021-03-28 02:44:34
【问题描述】:

我已经使用 docker-compose 设置了 ClickHouse 服务器的工作实例。现在我正在尝试向 users.xml 中定义的用户授予权限(写权限),如下所示:

<users>
        <deep>
            <access_management>1</access_management>
            <password>xxx</password>
            <networks incl="networks" replace="replace">
                <ip>::/1</ip>
                <ip>192.168.65.155</ip>
            </networks>
            <profile>default</profile>
            <quota>default</quota>
        </deep>
</users>

我正在使用这个命令

在 registry.simple_people 上授予插入权限

这给了我这个错误信息:

Code: 495, e.displayText() = DB::Exception: Cannot update user `deep` in users.xml because this storage is readonly: Couldn't update user `deep`. Successfully updated: none (version 20.12.3.3 (official build))

我在这里https://clickhouse.tech/docs/en/sql-reference/statements/grant/ 阅读了来自 ch 的文档,并且我一直将 readonly 选项设置为 2 和 0,而输出没有任何区别。 你们中的任何人都可以看到我可能遗漏了什么或者我应该做些什么才能使 users.xml 成为“非只读”吗?

注意:

用户“深”可以从数据库中读取。

我在 WSL:Ubuntu-20.04

【问题讨论】:

    标签: clickhouse wsl-2


    【解决方案1】:

    您很可能正在使用 HTTP GET 而不是 POST 执行插入。

    https://clickhouse.tech/docs/en/interfaces/http/#http-interface

    使用 GET 方法时,设置为“只读”。也就是说,对于修改数据的查询,只能使用POST方法。您可以在 POST 正文或 URL 参数中发送查询本身。



    有两种管理用户的方法。

    旧的 XML 方式和新的 create/grant/RBAC。

    无法授予 XML 创建的用户。它们使用 XML 设置进行管理。

    默认情况下,XML 用户可以完全访问所有内容。

    您可以使用 XML + 配置文件设置 READONLY,并将此配置文件设置为 XML 用户。

        <profiles>
            <roprofile>
                <readonly>1</readonly>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-04
      • 2020-03-07
      • 2016-07-02
      • 2011-09-21
      • 1970-01-01
      • 2017-01-29
      相关资源
      最近更新 更多