提交 2d9f6611 编写于 作者: P proller 提交者: alexey-milovidov

listen_try config option (#1892)

* Docker wip

* no tests

* fixes

* No tests

* Fixes

* Clean

* listen_try config option

* listen_try for tests
上级 ce03a8e4
......@@ -313,12 +313,12 @@ int Server::main(const std::vector<std::string> & /*args*/)
std::vector<std::string> listen_hosts = DB::getMultipleValuesFromConfig(config(), "", "listen_host");
bool try_listen = false;
bool listen_try = config().getUInt("listen_try", false);
if (listen_hosts.empty())
{
listen_hosts.emplace_back("::1");
listen_hosts.emplace_back("127.0.0.1");
try_listen = true;
listen_try = true;
}
auto make_socket_address = [&](const std::string & host, UInt16 port)
......@@ -452,7 +452,7 @@ int Server::main(const std::vector<std::string> & /*args*/)
}
catch (const Poco::Net::NetException & e)
{
if (try_listen && (e.code() == POCO_EPROTONOSUPPORT || e.code() == POCO_EADDRNOTAVAIL))
if (listen_try && (e.code() == POCO_EPROTONOSUPPORT || e.code() == POCO_EADDRNOTAVAIL))
LOG_ERROR(log, "Listen [" << listen_host << "]: " << e.what() << ": " << e.message()
<< " If it is an IPv6 or IPv4 address and your host has disabled IPv6 or IPv4, then consider to "
"specify not disabled IPv4 or IPv6 address to listen in <listen_host> element of configuration "
......
......@@ -72,6 +72,8 @@
<listen_host>::1</listen_host>
<listen_host>127.0.0.1</listen_host>
-->
<!-- Don't exit if ipv6 or ipv4 unavailable, but listen_host with this protocol specified -->
<!-- <listen_try>0</listen_try> -->
<max_connections>4096</max_connections>
<keep_alive_timeout>3</keep_alive_timeout>
......
......@@ -8,6 +8,9 @@
<size>10M</size>
<count>1</count>
</logger>
<listen_host>0.0.0.0</listen_host>
<listen_host>::</listen_host>
<listen_try>1</listen_try>
<http_port>58123</http_port>
<tcp_port>59000</tcp_port>
<interserver_http_port>59009</interserver_http_port>
......
......@@ -8,4 +8,4 @@ image:
docker build -t yandex/clickhouse-builder .
image_push:
docker push yandex/clickhouse-builder
\ No newline at end of file
docker push yandex/clickhouse-builder
<yandex>
<!-- Listen wildcard address to allow accepting connections from other containers and host network. -->
<listen_host>0.0.0.0</listen_host>
<listen_host>::</listen_host>
<listen_try>1</listen_try>
</yandex>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册