The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
There are two clusters, A and B, both in a storage-compute separation mode
The machines in cluster A are 192.168.1.67 (FE follower + CN,starrocks-cn), 192.168.1.139 (FE leader + CN,starrocks-fe-2), and 192.168.1.148 (FE Observer,starrocks-fe-4).I enabled FQDN.
The machine in cluster B is 192.168.1.149 (FE leader + CN)
Both clusters can be used for tasks including but not limited to creating databases, creating regular tables and external tables. In regular tables, data can be inserted, deleted, queried, and updated(CRUD)
Implementation process
I want to try StarRocks' external tables, especially between two StarRocks clusters, to see if what's mentioned in the documentation about achieving inter-cluster synchronization and read-write separation works。
I will create an external table in cluster B, and there will be a regular table in cluster A。Just as mentioned in the documentation, but to be honest, the wording in the documentation is a bit convoluted; it would be better to have specific references.
中文版本
背景
操作过程
create database myDB; use myDB; CREATE TABLE
t(
idbigint(20) NOT NULL COMMENT "",
warehouse_idvarchar(10) NULL COMMENT "",
warehouse_namevarchar(255) NULL COMMENT "",
spu_idvarchar(16) NULL COMMENT "",
spu_namevarchar(255) NULL COMMENT "",
sku_idbigint(20) NULL COMMENT "",
sku_namevarchar(255) NULL COMMENT "",
batch_idvarchar(16) NULL COMMENT "",
batch_namevarchar(255) NULL COMMENT "",
stock_countbigint(20) NULL COMMENT "",
pricedecimal(10, 2) NULL COMMENT "",
create_timedatetime NULL COMMENT "",
create_namevarchar(64) NULL COMMENT "",
create_bybigint(20) NULL COMMENT "",
update_timedatetime NULL COMMENT "",
update_namevarchar(64) NULL COMMENT "",
update_bybigint(20) NULL COMMENT "" ) ENGINE=OLAP PRIMARY KEY(
id) COMMENT "OLAP" DISTRIBUTED BY HASH(
id);
create database external; use external; CREATE EXTERNAL TABLE
external_t_1(
idbigint(20) NOT NULL COMMENT "",
warehouse_idvarchar(10) NULL COMMENT "",
warehouse_namevarchar(255) NULL COMMENT "",
spu_idvarchar(16) NULL COMMENT "",
spu_namevarchar(255) NULL COMMENT "",
sku_idbigint(20) NULL COMMENT "",
sku_namevarchar(255) NULL COMMENT "",
batch_idvarchar(16) NULL COMMENT "",
batch_namevarchar(255) NULL COMMENT "",
stock_countbigint(20) NULL COMMENT "",
pricedecimal(10, 2) NULL COMMENT "",
create_timedatetime NULL COMMENT "",
create_namevarchar(64) NULL COMMENT "",
create_bybigint(20) NULL COMMENT "",
update_timedatetime NULL COMMENT "",
update_namevarchar(64) NULL COMMENT "",
update_bybigint(20) NULL COMMENT "" ) ENGINE=OLAP PRIMARY KEY(
id) COMMENT "OLAP" DISTRIBUTED BY HASH(
id) PROPERTIES ( "host" = "192.68.1.139", "port" = "9020", "user" = "insert_user", "password" = "insert_password", "database" = "myDB", "table" = "t" );
5.我现在有一个插入语句:INSERT INTO external.external_t_1 (id, warehouse_id, warehouse_name, spu_id, spu_name, sku_id, sku_name, batch_id, batch_name, stock_count, price, create_time, create_name, create_by, update_time, update_name, update_by) VALUES (1844260193068781575, '3300001', '杭州主仓', '1101', '一年级上学期语文', 11010101, '一年级上学期语文人民出版社简体中文', '1949009', '1949009', 313, 44.00, '2024-10-10 15:45:15', 'admin', 1, '2024-10-10 15:45:15', 'admin', 1);
6.执行后,报错但没有明显的原因。 7.查询告警日志后,我发现了空指针异常。fe/log/fe.warn.log
8.我觉得这可能是一个代码层面的问题。我们看看如何解决?会在下个版本中修复吗?
English Version
Background
There are two clusters, A and B, both in a storage-compute separation mode
The machines in cluster A are 192.168.1.67 (FE follower + CN,starrocks-cn), 192.168.1.139 (FE leader + CN,starrocks-fe-2), and 192.168.1.148 (FE Observer,starrocks-fe-4).I enabled FQDN.
The machine in cluster B is 192.168.1.149 (FE leader + CN)
Both clusters can be used for tasks including but not limited to creating databases, creating regular tables and external tables. In regular tables, data can be inserted, deleted, queried, and updated(CRUD)
Implementation process
create database myDB; use myDB; CREATE TABLE
t(
idbigint(20) NOT NULL COMMENT "",
warehouse_idvarchar(10) NULL COMMENT "",
warehouse_namevarchar(255) NULL COMMENT "",
spu_idvarchar(16) NULL COMMENT "",
spu_namevarchar(255) NULL COMMENT "",
sku_idbigint(20) NULL COMMENT "",
sku_namevarchar(255) NULL COMMENT "",
batch_idvarchar(16) NULL COMMENT "",
batch_namevarchar(255) NULL COMMENT "",
stock_countbigint(20) NULL COMMENT "",
pricedecimal(10, 2) NULL COMMENT "",
create_timedatetime NULL COMMENT "",
create_namevarchar(64) NULL COMMENT "",
create_bybigint(20) NULL COMMENT "",
update_timedatetime NULL COMMENT "",
update_namevarchar(64) NULL COMMENT "",
update_bybigint(20) NULL COMMENT "" ) ENGINE=OLAP PRIMARY KEY(
id) COMMENT "OLAP" DISTRIBUTED BY HASH(
id);
create database external; use external; CREATE EXTERNAL TABLE
external_t_1(
idbigint(20) NOT NULL COMMENT "",
warehouse_idvarchar(10) NULL COMMENT "",
warehouse_namevarchar(255) NULL COMMENT "",
spu_idvarchar(16) NULL COMMENT "",
spu_namevarchar(255) NULL COMMENT "",
sku_idbigint(20) NULL COMMENT "",
sku_namevarchar(255) NULL COMMENT "",
batch_idvarchar(16) NULL COMMENT "",
batch_namevarchar(255) NULL COMMENT "",
stock_countbigint(20) NULL COMMENT "",
pricedecimal(10, 2) NULL COMMENT "",
create_timedatetime NULL COMMENT "",
create_namevarchar(64) NULL COMMENT "",
create_bybigint(20) NULL COMMENT "",
update_timedatetime NULL COMMENT "",
update_namevarchar(64) NULL COMMENT "",
update_bybigint(20) NULL COMMENT "" ) ENGINE=OLAP PRIMARY KEY(
id) COMMENT "OLAP" DISTRIBUTED BY HASH(
id) PROPERTIES ( "host" = "192.68.1.139", "port" = "9020", "user" = "insert_user", "password" = "insert_password", "database" = "myDB", "table" = "t" );
7.I now have an insert statement:INSERT INTO external.external_t_1 (id, warehouse_id, warehouse_name, spu_id, spu_name, sku_id, sku_name, batch_id, batch_name, stock_count, price, create_time, create_name, create_by, update_time, update_name, update_by) VALUES (1844260193068781575, '3300001', '杭州主仓', '1101', '一年级上学期语文', 11010101, '一年级上学期语文人民出版社简体中文', '1949009', '1949009', 313, 44.00, '2024-10-10 15:45:15', 'admin', 1, '2024-10-10 15:45:15', 'admin', 1);
8.After execution, it reports an error with no obvious reason.
11.After querying the alert logs, I found a null pointer exception