gianm commented on a change in pull request #8672: Druid Doctor
URL: https://github.com/apache/incubator-druid/pull/8672#discussion_r335254221
 
 

 ##########
 File path: web-console/src/dialogs/doctor-dialog/doctor-checks.tsx
 ##########
 @@ -0,0 +1,421 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import axios from 'axios';
+
+import { pluralIfNeeded, queryDruidSql } from '../../utils';
+import { deepGet } from '../../utils/object-change';
+import { postToSampler } from '../../utils/sampler';
+
+export interface CheckControls {
+  addSuggestion: (message: string) => void;
+  addIssue: (message: string) => void;
+  terminateChecks: () => void;
+}
+
+export interface DoctorCheck {
+  name: string;
+  check: (controls: CheckControls) => Promise<void>;
+}
+
+const RUNTIME_PROPERTIES_ALL_NODES_MUST_AGREE_ON: string[] = [
+  'user.timezone',
+  'druid.zk.service.host',
+];
+
+const RUNTIME_PROPERTIES_ALL_NODES_SHOULD_AGREE_ON: string[] = 
['java.version'];
+
+// In the future (when we can query other nodes) is will also be cool to check:
+// 'druid.storage.type' <=> historicals, overlords, mm
+// 'druid.indexer.logs.type' <=> overlord, mm, + peons
+
+const RUNTIME_PROPERTIES_MASTER_NODES_SHOULD_AGREE_ON: string[] = [
+  'druid.metadata.storage.type', // overlord + coordinator
+  'druid.metadata.storage.connector.connectURI',
+];
+
+export const DOCTOR_CHECKS: DoctorCheck[] = [
+  // -------------------------------------
+  // Self (router) checks
+  // -------------------------------------
+  {
+    name: 'Verify own status',
+    check: async controls => {
+      // Make sure that the router responds to /status and gives some valid 
info back
+      let status: any;
+      try {
+        status = (await axios.get(`/status`)).data;
+      } catch (e) {
+        controls.addIssue(
+          `Did not get a /status response, is the cluster running? Got: 
${e.message}`,
+        );
+        controls.terminateChecks();
+        return;
+      }
+
+      if (typeof status.version !== 'string') {
+        controls.addIssue('Could not get a valid /status response.');
 
 Review comment:
   "from the Router"?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to