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/clients/meta/MetaClient.cpp b/src/clients/meta/MetaClient.cpp index bd169e84e40..048e86f55f2 100644 --- a/src/clients/meta/MetaClient.cpp +++ b/src/clients/meta/MetaClient.cpp @@ -29,7 +29,6 @@ #include "webservice/Common.h" DECLARE_int32(ws_meta_http_port); -DECLARE_int32(ws_meta_h2_port); DEFINE_uint32(expired_time_factor, 5, "The factor of expired time based on heart beat interval"); DEFINE_int32(heartbeat_interval_secs, 10, "Heartbeat interval in seconds"); 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/daemons/MetaDaemonInit.cpp b/src/daemons/MetaDaemonInit.cpp index 87166ada3b8..4ed4d3e3f25 100644 --- a/src/daemons/MetaDaemonInit.cpp +++ b/src/daemons/MetaDaemonInit.cpp @@ -46,7 +46,6 @@ DEFINE_int32(meta_num_worker_threads, 32, "Number of workers"); DEFINE_string(meta_data_path, "", "Root data path"); DECLARE_string(meta_server_addrs); // use define from grap flags. DECLARE_int32(ws_meta_http_port); -DECLARE_int32(ws_meta_h2_port); #endif using nebula::web::PathParams; @@ -185,6 +184,6 @@ nebula::Status initWebService(nebula::WebService* svc, #ifndef BUILD_STANDALONE return svc->start(); #else - return svc->start(FLAGS_ws_meta_http_port, FLAGS_ws_meta_h2_port); + return svc->start(FLAGS_ws_meta_http_port); #endif } diff --git a/src/daemons/StandAloneDaemon.cpp b/src/daemons/StandAloneDaemon.cpp index c1929f1af6c..5a8c2fe17aa 100644 --- a/src/daemons/StandAloneDaemon.cpp +++ b/src/daemons/StandAloneDaemon.cpp @@ -292,7 +292,7 @@ int main(int argc, char *argv[]) { nebula::HostAddr localhost{FLAGS_local_ip, FLAGS_port}; LOG(INFO) << "Starting Graph HTTP Service"; auto webSvc = std::make_unique(); - status = webSvc->start(FLAGS_ws_http_port, FLAGS_ws_h2_port); + status = webSvc->start(FLAGS_ws_http_port); if (!status.ok()) { LOG(WARNING) << "Failed to start graph HTTP service"; return; diff --git a/src/meta/http/MetaHttpIngestHandler.cpp b/src/meta/http/MetaHttpIngestHandler.cpp index 680e4745021..27f76a890c3 100644 --- a/src/meta/http/MetaHttpIngestHandler.cpp +++ b/src/meta/http/MetaHttpIngestHandler.cpp @@ -18,7 +18,6 @@ #include "webservice/WebService.h" DECLARE_int32(ws_storage_http_port); -DECLARE_int32(ws_storage_h2_port); namespace nebula { namespace meta { 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/meta/http/test/MetaHttpReplaceHandlerTest.cpp b/src/meta/http/test/MetaHttpReplaceHandlerTest.cpp index c078d35e1db..1cd1b6782cd 100644 --- a/src/meta/http/test/MetaHttpReplaceHandlerTest.cpp +++ b/src/meta/http/test/MetaHttpReplaceHandlerTest.cpp @@ -30,7 +30,6 @@ class MetaHttpReplaceHandlerTestEnv : public ::testing::Environment { public: void SetUp() override { FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; LOG(INFO) << "Starting web service..."; rootPath_ = std::make_unique("/tmp/MetaHttpReplaceHandler.XXXXXX"); kv_ = MockCluster::initMetaKV(rootPath_->path()); diff --git a/src/storage/StorageServer.cpp b/src/storage/StorageServer.cpp index b12632b4111..4ccdc2307c8 100644 --- a/src/storage/StorageServer.cpp +++ b/src/storage/StorageServer.cpp @@ -127,7 +127,7 @@ bool StorageServer::initWebService() { #ifndef BUILD_STANDALONE auto status = webSvc_->start(); #else - auto status = webSvc_->start(FLAGS_ws_storage_http_port, FLAGS_ws_storage_h2_port); + auto status = webSvc_->start(FLAGS_ws_storage_http_port); #endif return status.ok(); } diff --git a/src/storage/test/StorageHttpAdminHandlerTest.cpp b/src/storage/test/StorageHttpAdminHandlerTest.cpp index 2a7a3e098b4..d484fa361bf 100644 --- a/src/storage/test/StorageHttpAdminHandlerTest.cpp +++ b/src/storage/test/StorageHttpAdminHandlerTest.cpp @@ -24,7 +24,6 @@ class StorageHttpAdminHandlerTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; rootPath_ = std::make_unique("/tmp/StorageHttpAdminHandler.XXXXXX"); cluster_ = std::make_unique(); cluster_->initStorageKV(rootPath_->path()); diff --git a/src/storage/test/StorageHttpDownloadHandlerTest.cpp b/src/storage/test/StorageHttpDownloadHandlerTest.cpp index 28d4dbde891..ec88273affc 100644 --- a/src/storage/test/StorageHttpDownloadHandlerTest.cpp +++ b/src/storage/test/StorageHttpDownloadHandlerTest.cpp @@ -28,7 +28,6 @@ class StorageHttpDownloadHandlerTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; rootPath_ = std::make_unique("/tmp/StorageHttpDownloadHandler.XXXXXX"); cluster_ = std::make_unique(); diff --git a/src/storage/test/StorageHttpIngestHandlerTest.cpp b/src/storage/test/StorageHttpIngestHandlerTest.cpp index 389a65f7705..0c18c19741e 100644 --- a/src/storage/test/StorageHttpIngestHandlerTest.cpp +++ b/src/storage/test/StorageHttpIngestHandlerTest.cpp @@ -23,7 +23,6 @@ class StorageHttpIngestHandlerTestEnv : 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/StorageHttpIngestHandler.XXXXXX"); diff --git a/src/storage/test/StorageHttpPropertyHandlerTest.cpp b/src/storage/test/StorageHttpPropertyHandlerTest.cpp index 4bc387f6dc7..9a7aaaf0016 100644 --- a/src/storage/test/StorageHttpPropertyHandlerTest.cpp +++ b/src/storage/test/StorageHttpPropertyHandlerTest.cpp @@ -24,7 +24,6 @@ class StorageHttpStatsHandlerTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; FLAGS_enable_rocksdb_statistics = true; rootPath_ = std::make_unique("/tmp/StorageHttpPropertyHandler.XXXXXX"); cluster_ = std::make_unique(); diff --git a/src/storage/test/StorageHttpStatsHandlerTest.cpp b/src/storage/test/StorageHttpStatsHandlerTest.cpp index 286950ee48d..98bc65f7f50 100644 --- a/src/storage/test/StorageHttpStatsHandlerTest.cpp +++ b/src/storage/test/StorageHttpStatsHandlerTest.cpp @@ -24,7 +24,6 @@ class StorageHttpStatsHandlerTestEnv : public ::testing::Environment { void SetUp() override { FLAGS_ws_ip = "127.0.0.1"; FLAGS_ws_http_port = 0; - FLAGS_ws_h2_port = 0; FLAGS_enable_rocksdb_statistics = true; rootPath_ = std::make_unique("/tmp/StorageHttpStatsHandler.XXXXXX"); cluster_ = std::make_unique(); diff --git a/src/webservice/Common.cpp b/src/webservice/Common.cpp index 2dd15c911cc..f73f8907bff 100644 --- a/src/webservice/Common.cpp +++ b/src/webservice/Common.cpp @@ -8,9 +8,7 @@ #include DEFINE_int32(ws_meta_http_port, 11000, "Port to listen on Meta with HTTP protocol"); -DEFINE_int32(ws_meta_h2_port, 11002, "Port to listen on Meta with HTTP/2 protocol"); DEFINE_int32(ws_storage_http_port, 12000, "Port to listen on Storage with HTTP protocol"); -DEFINE_int32(ws_storage_h2_port, 12002, "Port to listen on Storage with HTTP/2 protocol"); namespace nebula { diff --git a/src/webservice/WebService.cpp b/src/webservice/WebService.cpp index 393bc47fe4a..93331967ea3 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 352448322ba..f8e4729ac7f 100644 --- a/tests/common/nebula_service.py +++ b/tests/common/nebula_service.py @@ -59,7 +59,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, } else: process_params = { @@ -67,13 +66,10 @@ 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, 'meta_port': self.meta_port, 'ws_meta_http_port': self.meta_http_port, - 'ws_meta_h2_port': self.meta_https_port, 'storage_port': self.storage_port, 'ws_storage_http_port': self.storage_http_port, - 'ws_storage_h2_port': self.storage_https_port, } # data path if self.name.upper() != 'GRAPHD':