From 2d9f66115fb36cd246cd41d88493c1b0b6c74616 Mon Sep 17 00:00:00 2001 From: proller Date: Mon, 12 Feb 2018 22:36:18 +0300 Subject: [PATCH] listen_try config option (#1892) * Docker wip * no tests * fixes * No tests * Fixes * Clean * listen_try config option * listen_try for tests --- dbms/src/Server/Server.cpp | 6 +++--- dbms/src/Server/config.xml | 2 ++ dbms/tests/server-test.xml | 3 +++ docker/builder/Makefile | 2 +- docker/server/docker_related_config.xml | 2 ++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dbms/src/Server/Server.cpp b/dbms/src/Server/Server.cpp index 0fe39f42ed..c31f054aaa 100644 --- a/dbms/src/Server/Server.cpp +++ b/dbms/src/Server/Server.cpp @@ -313,12 +313,12 @@ int Server::main(const std::vector & /*args*/) std::vector 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 & /*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 element of configuration " diff --git a/dbms/src/Server/config.xml b/dbms/src/Server/config.xml index 62936425cb..ca75025ac7 100644 --- a/dbms/src/Server/config.xml +++ b/dbms/src/Server/config.xml @@ -72,6 +72,8 @@ ::1 127.0.0.1 --> + + 4096 3 diff --git a/dbms/tests/server-test.xml b/dbms/tests/server-test.xml index e37bda9d0a..9d3baa5258 100644 --- a/dbms/tests/server-test.xml +++ b/dbms/tests/server-test.xml @@ -8,6 +8,9 @@ 10M 1 + 0.0.0.0 + :: + 1 58123 59000 59009 diff --git a/docker/builder/Makefile b/docker/builder/Makefile index b02d86373f..4a6df269e9 100644 --- a/docker/builder/Makefile +++ b/docker/builder/Makefile @@ -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 diff --git a/docker/server/docker_related_config.xml b/docker/server/docker_related_config.xml index 7171a8b5ff..ab6f82ad4c 100644 --- a/docker/server/docker_related_config.xml +++ b/docker/server/docker_related_config.xml @@ -1,4 +1,6 @@ 0.0.0.0 + :: + 1 -- GitLab