| 3304 | } |
| 3305 | |
| 3306 | Status ImpalaServer::Start(int32_t beeswax_port, int32_t hs2_port, |
| 3307 | int32_t hs2_http_port, int32_t external_fe_port) { |
| 3308 | exec_env_->SetImpalaServer(this); |
| 3309 | |
| 3310 | #ifdef CALLONCEHACK |
| 3311 | // Include this calloncehack call (which is a no-op) to make sure calloncehack |
| 3312 | // is required at link time when using it. |
| 3313 | calloncehack::InitializeCallOnceHack(); |
| 3314 | #endif |
| 3315 | |
| 3316 | // We must register the HTTP handlers after registering the ImpalaServer with the |
| 3317 | // ExecEnv. Otherwise the HTTP handlers will try to resolve the ImpalaServer through the |
| 3318 | // ExecEnv singleton and will receive a nullptr. |
| 3319 | http_handler_.reset(ImpalaHttpHandler::CreateImpaladHandler( |
| 3320 | this, exec_env_->admission_controller(), exec_env_->cluster_membership_mgr())); |
| 3321 | http_handler_->RegisterHandlers(exec_env_->webserver()); |
| 3322 | if (exec_env_->metrics_webserver() != nullptr) { |
| 3323 | http_handler_->RegisterHandlers( |
| 3324 | exec_env_->metrics_webserver(), /* metrics_only */ true); |
| 3325 | } |
| 3326 | |
| 3327 | if (!FLAGS_is_coordinator && !FLAGS_is_executor) { |
| 3328 | return Status("Impala does not have a valid role configured. " |
| 3329 | "Either --is_coordinator or --is_executor must be set to true."); |
| 3330 | } |
| 3331 | |
| 3332 | // Subscribe with the statestore. Coordinators need to subscribe to the catalog topic |
| 3333 | // then wait for the initial catalog update. |
| 3334 | RETURN_IF_ERROR(exec_env_->StartStatestoreSubscriberService()); |
| 3335 | |
| 3336 | kudu::Version target_schema_version; |
| 3337 | |
| 3338 | if (FLAGS_enable_workload_mgmt && !FLAGS_catalogd_deployed) { |
| 3339 | // TODO(IMPALA-13830): Enable workload management in lightweight deployments. |
| 3340 | return Status("Workload management needs CatalogD to be deployed."); |
| 3341 | } |
| 3342 | |
| 3343 | if (FLAGS_is_coordinator) { |
| 3344 | if (FLAGS_enable_workload_mgmt) { |
| 3345 | ABORT_IF_ERROR(workloadmgmt::ParseSchemaVersionFlag(&target_schema_version)); |
| 3346 | ABORT_IF_ERROR(workloadmgmt::StartupChecks(target_schema_version)); |
| 3347 | } |
| 3348 | |
| 3349 | exec_env_->frontend()->WaitForCatalog(); |
| 3350 | ABORT_IF_ERROR(UpdateCatalogMetrics()); |
| 3351 | } |
| 3352 | |
| 3353 | SSLProtocol ssl_version = SSLProtocol::TLSv1_0; |
| 3354 | if (IsExternalTlsConfigured() || IsInternalTlsConfigured()) { |
| 3355 | RETURN_IF_ERROR( |
| 3356 | SSLProtoVersions::StringToProtocol(FLAGS_ssl_minimum_version, &ssl_version)); |
| 3357 | } |
| 3358 | |
| 3359 | if (!FLAGS_is_coordinator) { |
| 3360 | LOG(INFO) << "Initialized executor Impala server on " |
| 3361 | << TNetworkAddressToString(exec_env_->configured_backend_address()); |
| 3362 | } else { |
| 3363 | // Load JWKS from file if validation for signature of JWT token is enabled. |