· 7 years ago · Jan 16, 2019, 04:06 PM
1create database test
2
3create table if not exists test.ontime_local (
4 ipS String,
5 ipD String,
6 status String,
7 time DateTime,
8 id UInt32
9) ENGINE = Log
10
11create table if not exists test.ontime_all AS test.ontime_local ENGINE = Distributed(test, '', ontime_local, rand())
12
13<remote_servers>
14 <test>
15 <shard>
16 <replica>
17 <host>192.168.75.129</host>
18 <port>9000</port>
19 <default_database>test</default_database>
20 </replica>
21 </shard>
22 </test>
23</remote_servers>
24
25create database test
26
27create table test.ontime_local(
28 ipS String,
29 ipD String,
30 status String,
31 time DateTime,
32 id UInt32
33 ) ENGINE = Log;
34
35select * from test.ontime_all