Doris create table报错:
mysql> CREATE TABLE `test` (
-> `id` bigint(11) NOT NULL,
-> `name` varchar(255) DEFAULT NULL,
-> `score` bigint(11) DEFAULT NULL
-> ) ENGINE=olap
-> DISTRIBUTED BY HASH (id) BUCKETS 1
-> PROPERTIES (
-> "storage_medium" = "SSD",
-> "replication_allocation" = "tag.location.default: 1"
-> );
ERROR 1064 (HY000): errCode = 2, detailMessage = Failed to find enough host with storage medium and tag(SSD/{"location" : "default"}) in all backends. need: 1
错误原因:根据错误提示,是因为be配置文件里没有找到足够多的 storage medium导致的。
解决方法:
修改be.conf,然后配置多个storage_root_path:
storage_root_path = /data/doris/doris.HDD,50;/root/doris/doris.SSD,1;/root/doris-2
如果目录不存在,需要手动建立
# mkdir -p /data/doris/doris.HDD
# mkdir -p /root/doris/doris.SSD
# mkdir -p /root/doris-2
重启be后问题得到解决。
感谢大神分享!!!