From f20110d72ec1fb4d22c02c47561ca49dc6041d49 Mon Sep 17 00:00:00 2001 From: jackwener <30525741+jackwener@users.noreply.github.com> Date: Thu, 13 Jan 2022 14:53:43 +0800 Subject: [PATCH] remove h2 --- conf/nebula-graphd.conf.default | 2 -- conf/nebula-graphd.conf.production | 2 -- conf/nebula-metad.conf.default | 2 -- conf/nebula-metad.conf.production | 2 -- conf/nebula-standalone.conf.default | 4 ---- conf/nebula-storaged-listener.conf.production | 2 -- conf/nebula-storaged.conf.default | 2 -- conf/nebula-storaged.conf.production | 2 -- src/common/http/test/HttpClientTest.cpp | 1 - src/meta/http/test/MetaHttpDownloadHandlerTest.cpp | 1 - src/meta/http/test/MetaHttpIngestHandlerTest.cpp | 1 - src/webservice/WebService.cpp | 12 +++--------- src/webservice/WebService.h | 9 +++------ src/webservice/test/FlagsAccessTest.cpp | 1 - src/webservice/test/StatsReaderTest.cpp | 1 - src/webservice/test/StatusHandlerTest.cpp | 1 - tests/common/nebula_service.py | 1 - 17 files changed, 6 insertions(+), 40 deletions(-) diff --git a/conf/nebula-graphd.conf.default b/conf/nebula-graphd.conf.default index dacf79fc9a7..a7b89602482 100644 --- a/conf/nebula-graphd.conf.default +++ b/conf/nebula-graphd.conf.default @@ -67,8 +67,6 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19669 -# HTTP2 service port ---ws_h2_port=19670 # storage client timeout --storage_client_timeout_ms=60000 # Port to listen on Meta with HTTP protocol, it corresponds to ws_http_port in metad's configuration file diff --git a/conf/nebula-graphd.conf.production b/conf/nebula-graphd.conf.production index aed8350b1f6..3fb6f70d81c 100644 --- a/conf/nebula-graphd.conf.production +++ b/conf/nebula-graphd.conf.production @@ -66,8 +66,6 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19669 -# HTTP2 service port ---ws_h2_port=19670 # storage client timeout --storage_client_timeout_ms=60000 # Port to listen on Meta with HTTP protocol, it corresponds to ws_http_port in metad's configuration file diff --git a/conf/nebula-metad.conf.default b/conf/nebula-metad.conf.default index 42966116ef4..ce9903200a8 100644 --- a/conf/nebula-metad.conf.default +++ b/conf/nebula-metad.conf.default @@ -36,8 +36,6 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19559 -# HTTP2 service port ---ws_h2_port=19560 # Port to listen on Storage with HTTP protocol, it corresponds to ws_http_port in storage's configuration file --ws_storage_http_port=19779 diff --git a/conf/nebula-metad.conf.production b/conf/nebula-metad.conf.production index 1aa2d116211..84b18f831d4 100644 --- a/conf/nebula-metad.conf.production +++ b/conf/nebula-metad.conf.production @@ -36,8 +36,6 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19559 -# HTTP2 service port ---ws_h2_port=19560 # Port to listen on Storage with HTTP protocol, it corresponds to ws_http_port in storage's configuration file --ws_storage_http_port=19779 diff --git a/conf/nebula-standalone.conf.default b/conf/nebula-standalone.conf.default index b356ef21691..a735ab3cf3a 100644 --- a/conf/nebula-standalone.conf.default +++ b/conf/nebula-standalone.conf.default @@ -68,16 +68,12 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19669 -# HTTP2 service port ---ws_h2_port=19670 # storage client timeout --storage_client_timeout_ms=60000 # Port to listen on Meta with HTTP protocol, it corresponds to ws_http_port in metad's configuration file --ws_meta_http_port=19559 # HTTP service port --ws_storage_http_port=19779 -# HTTP2 service port ---ws_storage_h2_port=19780 # heartbeat with meta service --heartbeat_interval_secs=10 diff --git a/conf/nebula-storaged-listener.conf.production b/conf/nebula-storaged-listener.conf.production index 6dff785502b..cdfd608411f 100644 --- a/conf/nebula-storaged-listener.conf.production +++ b/conf/nebula-storaged-listener.conf.production @@ -37,8 +37,6 @@ --ws_ip=192.168.2.4 # HTTP service port --ws_http_port=19789 -# HTTP2 service port ---ws_h2_port=19790 # heartbeat with meta service --heartbeat_interval_secs=10 diff --git a/conf/nebula-storaged.conf.default b/conf/nebula-storaged.conf.default index b5e9019a52b..65970d6dde2 100644 --- a/conf/nebula-storaged.conf.default +++ b/conf/nebula-storaged.conf.default @@ -38,8 +38,6 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19779 -# HTTP2 service port ---ws_h2_port=19780 # heartbeat with meta service --heartbeat_interval_secs=10 diff --git a/conf/nebula-storaged.conf.production b/conf/nebula-storaged.conf.production index 18a71133731..44abf1e3acf 100644 --- a/conf/nebula-storaged.conf.production +++ b/conf/nebula-storaged.conf.production @@ -38,8 +38,6 @@ --ws_ip=0.0.0.0 # HTTP service port --ws_http_port=19779 -# HTTP2 service port ---ws_h2_port=19780 # heartbeat with meta service --heartbeat_interval_secs=10 diff --git a/src/common/http/test/HttpClientTest.cpp b/src/common/http/test/HttpClientTest.cpp index ed8b28407dc..bfceec9fb1e 100644 --- a/src/common/http/test/HttpClientTest.cpp +++ b/src/common/http/test/HttpClientTest.cpp @@ -46,7 +46,6 @@ class HttpClientTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; LOG(INFO) << "Starting web service..."; webSvc_ = std::make_unique(); diff --git a/src/meta/http/test/MetaHttpDownloadHandlerTest.cpp b/src/meta/http/test/MetaHttpDownloadHandlerTest.cpp index c29e7be79c4..5661cbc10c5 100644 --- a/src/meta/http/test/MetaHttpDownloadHandlerTest.cpp +++ b/src/meta/http/test/MetaHttpDownloadHandlerTest.cpp @@ -28,7 +28,6 @@ class MetaHttpDownloadHandlerTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; VLOG(1) << "Starting web service..."; rootPath_ = std::make_unique("/tmp/MetaHttpDownloadHandler.XXXXXX"); diff --git a/src/meta/http/test/MetaHttpIngestHandlerTest.cpp b/src/meta/http/test/MetaHttpIngestHandlerTest.cpp index 167466df2b2..083cc4c1c69 100644 --- a/src/meta/http/test/MetaHttpIngestHandlerTest.cpp +++ b/src/meta/http/test/MetaHttpIngestHandlerTest.cpp @@ -26,7 +26,6 @@ class MetaHttpIngestHandlerTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; VLOG(1) << "Starting web service..."; rootPath_ = std::make_unique("/tmp/MetaHttpIngestHandler.XXXXXX"); diff --git a/src/webservice/WebService.cpp b/src/webservice/WebService.cpp index 393bc47fe4a..01066c7ffca 100644 --- a/src/webservice/WebService.cpp +++ b/src/webservice/WebService.cpp @@ -18,7 +18,6 @@ #include "webservice/StatusHandler.h" DEFINE_int32(ws_http_port, 11000, "Port to listen on with HTTP protocol"); -DEFINE_int32(ws_h2_port, 11002, "Port to listen on with HTTP/2 protocol"); DEFINE_string(ws_ip, "0.0.0.0", "IP/Hostname to bind to"); DEFINE_int32(ws_threads, 4, "Number of threads for the web service."); @@ -61,7 +60,7 @@ WebService::~WebService() { wsThread_->join(); } -Status WebService::start(uint16_t httpPort, uint16_t h2Port) { +Status WebService::start(uint16_t httpPort) { if (started_) { LOG(INFO) << "Web service has been started."; return Status::OK(); @@ -92,7 +91,6 @@ Status WebService::start(uint16_t httpPort, uint16_t h2Port) { std::vector ips = { {SocketAddress(FLAGS_ws_ip, httpPort, true), HTTPServer::Protocol::HTTP}, - {SocketAddress(FLAGS_ws_ip, h2Port, true), HTTPServer::Protocol::HTTP2}, }; CHECK_GT(FLAGS_ws_threads, 0) << "The number of webservice threads must be greater than zero"; @@ -118,16 +116,12 @@ Status WebService::start(uint16_t httpPort, uint16_t h2Port) { server_->start( [&]() { auto addresses = server_->addresses(); - CHECK_EQ(addresses.size(), 2UL); + CHECK_EQ(addresses.size(), 1UL); if (FLAGS_ws_http_port == 0) { FLAGS_ws_http_port = addresses[0].address.getPort(); } - if (FLAGS_ws_h2_port == 0) { - FLAGS_ws_h2_port = addresses[1].address.getPort(); - } LOG(INFO) << "Web service started on " - << "HTTP[" << FLAGS_ws_http_port << "], " - << "HTTP2[" << FLAGS_ws_h2_port << "]"; + << "HTTP[" << FLAGS_ws_http_port << "], "; { std::lock_guard g(mut); serverStartedDone = true; diff --git a/src/webservice/WebService.h b/src/webservice/WebService.h index a6b760f486c..c48d738681b 100644 --- a/src/webservice/WebService.h +++ b/src/webservice/WebService.h @@ -9,13 +9,11 @@ #include "common/base/Status.h" DECLARE_int32(ws_http_port); -DECLARE_int32(ws_h2_port); DECLARE_string(ws_ip); DECLARE_int32(ws_threads); #ifdef BUILD_STANDALONE DECLARE_int32(ws_storage_http_port); -DECLARE_int32(ws_storage_h2_port); DECLARE_int32(ws_storage_threads); #endif @@ -44,11 +42,10 @@ class WebService final { } // To start the global web server. - // Two ports would be bound, one for HTTP, another one for HTTP2. - // If FLAGS_ws_http_port or FLAGS_ws_h2_port is zero, an ephemeral port + // Two ports would be bound, one for HTTP. + // If FLAGS_ws_http_port is zero, an ephemeral port // would be assigned and set back to the gflag, respectively. - NG_MUST_USE_RESULT Status start(uint16_t httpPort = FLAGS_ws_http_port, - uint16_t h2Port = FLAGS_ws_h2_port); + NG_MUST_USE_RESULT Status start(uint16_t httpPort = FLAGS_ws_http_port); // Check whether web service is started bool started() const { diff --git a/src/webservice/test/FlagsAccessTest.cpp b/src/webservice/test/FlagsAccessTest.cpp index a9773d17111..5cad55c83e4 100644 --- a/src/webservice/test/FlagsAccessTest.cpp +++ b/src/webservice/test/FlagsAccessTest.cpp @@ -24,7 +24,6 @@ class FlagsAccessTestEnv : public ::testing::Environment { public: void SetUp() override { FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; VLOG(1) << "Starting web service..."; webSvc_ = std::make_unique(); auto status = webSvc_->start(); diff --git a/src/webservice/test/StatsReaderTest.cpp b/src/webservice/test/StatsReaderTest.cpp index 7789c65ea6b..6dbe6b8574b 100644 --- a/src/webservice/test/StatsReaderTest.cpp +++ b/src/webservice/test/StatsReaderTest.cpp @@ -19,7 +19,6 @@ class StatsReaderTestEnv : public ::testing::Environment { public: void SetUp() override { FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; VLOG(1) << "Starting web service..."; webSvc_ = std::make_unique(); auto status = webSvc_->start(); diff --git a/src/webservice/test/StatusHandlerTest.cpp b/src/webservice/test/StatusHandlerTest.cpp index fd41e1a0de1..6a0482ae3cb 100644 --- a/src/webservice/test/StatusHandlerTest.cpp +++ b/src/webservice/test/StatusHandlerTest.cpp @@ -20,7 +20,6 @@ class StatusHandlerTestEnv : public ::testing::Environment { public: void SetUp() override { FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; VLOG(1) << "Starting web service..."; webSvc_ = std::make_unique(); diff --git a/tests/common/nebula_service.py b/tests/common/nebula_service.py index 1958ca15086..1e8371cdbd0 100644 --- a/tests/common/nebula_service.py +++ b/tests/common/nebula_service.py @@ -50,7 +50,6 @@ def _format_nebula_command(self): 'pid_file': 'pids{}/nebula-{}.pid'.format(self.suffix_index, self.name), 'port': self.tcp_port, 'ws_http_port': self.http_port, - 'ws_h2_port': self.https_port, } # data path if self.name.upper() != 'GRAPHD':