【已解决】创建物理表出现报错1105

Viewed 61

建表语句:

create table if not exists test.lsbv (
`id_`  int  comment '',
`name_`  varchar(384)  comment '名称',
`school_code_`  varchar(384)  comment '666',
`school_name_`  varchar(384)  comment '55',
`value_`  varchar(384)  comment '4',
data_source  varchar(500) comment '333',
insert_time  datetime comment '222'
)
unique key(`id_`)
comment "123"
distributed by hash(`id_`) buckets 10;

报错:

1105 - errCode = 2, detailMessage = Failed to find 3 backend(s) for policy: cluster=default_cluster | query=false | load=false | schedule=true | tags=[{"location" : "default"}] | medium=HDD

这个问题是什么导致的,怎么修改建表语句呢

1 Answers

doris 默认是3副本,如果节点数小于3,需要指定表的副本数量

create table if not exists test.lsbv (
id_ int comment '',
name_ varchar(384) comment '名称',
school_code_ varchar(384) comment '666',
school_name_ varchar(384) comment '55',
value_ varchar(384) comment '4',
data_source varchar(500) comment '333',
insert_time datetime comment '222'
)
unique key(id_)
comment "123"
distributed by hash(id_) buckets 10
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);