分布式引擎 DBException
Distributed Engine DBException
我在我的本地系统中创建了一个 table:
CREATE TABLE default.test_distributed (a Int8) ENGINE = Distributed(logs, default, test_remote)
并在 IP 为 10.121.21.33 的远程系统中创建了一个 table:
创建 table test_remote (一个 Int8) Engine=Log
然后我在本地系统中插入数据:
插入 test_distributed 值 (1011)
然后我触发了 Select 查询:
select * 来自 test_distributed
并出现以下异常:
2017.05.02 18:49:36.155606 [ 14 ] ConnectionPoolWithFailover:尝试 1 时连接失败,原因:代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33: 9000), e.what() = DB::NetException
2017.05.02 18:49:36.155982 [ 14 ] ConnectionPoolWithFailover:尝试 2 时连接失败,原因:代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33: 9000), e.what() = DB::NetException
2017.05.02 18:49:36.156316 [ 14 ] ConnectionPoolWithFailover:尝试 3 时连接失败,原因:代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33: 9000), e.what() = DB::NetException
2017.05.02 18:49:36.162780 [ 4 ] executeQuery:代码:279,e.displayText() = DB::NetException:所有连接尝试均失败。日志:
代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33:9000),e.what() = DB::NetException
代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33:9000),e.what() = DB::NetException
代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33:9000),e.what() = DB::NetException
, e.what() = DB::NetException (from 127.0.0.1:33590) (in query: select * from test_distributed), Stack trace:
- clickhouse 服务器(StackTrace::StackTrace()+0x16)[0x17c6e76]
- clickhouse-server(DB::Exception::Exception(std::string const&, int)+0x1f) [0xfdd9ff]
- clickhouse-server(PoolWithFailoverBase::getMany(DB::Settings const*, PoolMode)+0x773) [0x17615f3]
- clickhouse-server(DB::ConnectionPoolWithFailover::doGetMany(DB::Settings const*, PoolMode)+0x33) [0x17617f3]
- clickhouse-server(DB::MultiplexedConnections::initFromShard(DB::IConnectionPool*)+0x26d) [0x19afcad]
- clickhouse-server(DB::MultiplexedConnections::MultiplexedConnections(DB::IConnectionPool*, DB::Settings const*, std::shared_ptr, bool, PoolMode)+0x138) [0x19b0a38]
- clickhouse-server(DB::RemoteBlockInputStream::createMultiplexedConnections()+0x3fb) [0x1665e8b]
- clickhouse-server(DB::RemoteBlockInputStream::readPrefix()+0x23) [0x166b043]
- clickhouse-server(DB::AsynchronousBlockInputStream::calculate(MemoryTracker*)+0x60) [0xfe8ea0]
- clickhouse-server(ThreadPool::worker()+0x141) [0x17d2d91]
- clickhouse-server() [0x33d4faf]
- /lib/x86_64-linux-gnu/libpthread.so.0(+0x8182) [0x7f8fe38aa182]
- /lib/x86_64-linux-gnu/libc.so.6(克隆+0x6d) [0x7f8fe2ec530d]
检查本地系统的设置
SELECT * FROM system.clusters
并检查以下文件 /etc/clickhouse-server/config.xml 的 remote_servers 部分
请参阅 https://clickhouse.yandex/reference_en.html#Distributed 了解 remote_servers 示例配置
我在我的本地系统中创建了一个 table: CREATE TABLE default.test_distributed (a Int8) ENGINE = Distributed(logs, default, test_remote)
并在 IP 为 10.121.21.33 的远程系统中创建了一个 table: 创建 table test_remote (一个 Int8) Engine=Log
然后我在本地系统中插入数据: 插入 test_distributed 值 (1011)
然后我触发了 Select 查询: select * 来自 test_distributed
并出现以下异常: 2017.05.02 18:49:36.155606 [ 14 ] ConnectionPoolWithFailover:尝试 1 时连接失败,原因:代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33: 9000), e.what() = DB::NetException 2017.05.02 18:49:36.155982 [ 14 ] ConnectionPoolWithFailover:尝试 2 时连接失败,原因:代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33: 9000), e.what() = DB::NetException 2017.05.02 18:49:36.156316 [ 14 ] ConnectionPoolWithFailover:尝试 3 时连接失败,原因:代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33: 9000), e.what() = DB::NetException 2017.05.02 18:49:36.162780 [ 4 ] executeQuery:代码:279,e.displayText() = DB::NetException:所有连接尝试均失败。日志:
代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33:9000),e.what() = DB::NetException 代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33:9000),e.what() = DB::NetException 代码:210,e.displayText() = DB::NetException:连接被拒绝:(10.121.21.33:9000),e.what() = DB::NetException
, e.what() = DB::NetException (from 127.0.0.1:33590) (in query: select * from test_distributed), Stack trace:
- clickhouse 服务器(StackTrace::StackTrace()+0x16)[0x17c6e76]
- clickhouse-server(DB::Exception::Exception(std::string const&, int)+0x1f) [0xfdd9ff]
- clickhouse-server(PoolWithFailoverBase::getMany(DB::Settings const*, PoolMode)+0x773) [0x17615f3]
- clickhouse-server(DB::ConnectionPoolWithFailover::doGetMany(DB::Settings const*, PoolMode)+0x33) [0x17617f3]
- clickhouse-server(DB::MultiplexedConnections::initFromShard(DB::IConnectionPool*)+0x26d) [0x19afcad]
- clickhouse-server(DB::MultiplexedConnections::MultiplexedConnections(DB::IConnectionPool*, DB::Settings const*, std::shared_ptr, bool, PoolMode)+0x138) [0x19b0a38]
- clickhouse-server(DB::RemoteBlockInputStream::createMultiplexedConnections()+0x3fb) [0x1665e8b]
- clickhouse-server(DB::RemoteBlockInputStream::readPrefix()+0x23) [0x166b043]
- clickhouse-server(DB::AsynchronousBlockInputStream::calculate(MemoryTracker*)+0x60) [0xfe8ea0]
- clickhouse-server(ThreadPool::worker()+0x141) [0x17d2d91]
- clickhouse-server() [0x33d4faf]
- /lib/x86_64-linux-gnu/libpthread.so.0(+0x8182) [0x7f8fe38aa182]
- /lib/x86_64-linux-gnu/libc.so.6(克隆+0x6d) [0x7f8fe2ec530d]
检查本地系统的设置
SELECT * FROM system.clusters
并检查以下文件 /etc/clickhouse-server/config.xml 的 remote_servers 部分
请参阅 https://clickhouse.yandex/reference_en.html#Distributed 了解 remote_servers 示例配置