无法以只读模式插入 table

Cannot insert into table in readonly mode

当我尝试在 clickhouse 数据库中插入记录时出现异常:

异常:

Code: 164, e.displayText() = DB::Exception: Cannot insert into table in readonly mode, e.what() = DB::Exception

节点包:

https://www.npmjs.com/package/clickhouse

连接码:

const clickhouse = new ClickHouse({
url: 'http://localhost',
port: 8123,
debug: true,
database: 'mydb',
basicAuth: 'default',
username: '',
password: '',
isUseGzip: false,
config: {
    session_timeout                         : 60,
    output_format_json_quote_64bit_integers : 0,
    enable_http_compression                 : 0
},

});

Table 架构:

CREATE TABLE logs_1 ( trid UInt64,  date UInt32,  email String) ENGINE = Log;

可能的原因:

  • 您使用设置了只读标志的用户连接到 ClickHouse 用户设置/用户配置文件。
  • 您正在尝试使用 GET 插入数据 request 而不是 POST (如果你使用它,可能不是你的情况 图书馆)
  • 您正在插入到已复制的 tabled 并且服务器没有 连接到动物园管理员(不是你插入的情况 非复制 table 使用日志引擎)

所以请检查默认用户和配置文件的设置。它很可能包含只读标志。