You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by GitBox <gi...@apache.org> on 2022/10/02 08:15:10 UTC

[GitHub] [ambari] smallyao opened a new pull request, #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA

smallyao opened a new pull request, #3378:
URL: https://github.com/apache/ambari/pull/3378

   ## What changes were proposed in this pull request?
   
   <pre>
   2022-10-02 13:25:04,065 - File['/var/lib/ambari-agent/tmp/checkWebUI.py'] {'content': StaticFile('checkWebUI.py'), 'mode': 0775}
   2022-10-02 13:25:04,067 - Execute['ambari-python-wrap /var/lib/ambari-agent/tmp/checkWebUI.py -m bigtop3,bigtop4,bigtop1 -p 8480 -s False -o PROTOCOL_TLSv1_2'] {'logoutput': True, 'tries': 5, 'user': 'ambari-qa', 'try_sleep': 3}
   Cannot access WEB UI on: http://bigtop3:8480
   2022-10-02 13:25:04,279 - Retrying after 3 seconds. Reason: Execution of 'ambari-python-wrap /var/lib/ambari-agent/tmp/checkWebUI.py -m bigtop3,bigtop4,bigtop1 -p 8480 -s False -o PROTOCOL_TLSv1_2' returned 1. Cannot access WEB UI on: http://bigtop3:8480
   Cannot access WEB UI on: http://bigtop3:8480
   2022-10-02 13:25:07,462 - Retrying after 3 seconds. Reason: Execution of 'ambari-python-wrap /var/lib/ambari-agent/tmp/checkWebUI.py -m bigtop3,bigtop4,bigtop1 -p 8480 -s False -o PROTOCOL_TLSv1_2' returned 1. Cannot access WEB UI on: http://bigtop3:8480
   Cannot access WEB UI on: http://bigtop3:8480
   2022-10-02 13:25:10,706 - Retrying after 3 seconds. Reason: Execution of 'ambari-python-wrap /var/lib/ambari-agent/tmp/checkWebUI.py -m bigtop3,bigtop4,bigtop1 -p 8480 -s False -o PROTOCOL_TLSv1_2' returned 1. Cannot access WEB UI on: http://bigtop3:8480
   Cannot access WEB UI on: http://bigtop3:8480
   2022-10-02 13:25:13,890 - Retrying after 3 seconds. Reason: Execution of 'ambari-python-wrap /var/lib/ambari-agent/tmp/checkWebUI.py -m bigtop3,bigtop4,bigtop1 -p 8480 -s False -o PROTOCOL_TLSv1_2' returned 1. Cannot access WEB UI on: http://bigtop3:8480
   Cannot access WEB UI on: http://bigtop3:8480
   </pre>
   
   The reason is that http response code is 302 when access to http://bigtop3:8480/.
   And the code in checkWebUI.py at line 81 will see the reponse code 302 as a failure.
   ## How was this patch tested?
   Tested in local vm cluster, including kerberos authentication
   
   hdfs service check before enableing kerberos authentication 
   ![image](https://user-images.githubusercontent.com/13212217/193444574-81d3c650-570e-4ca5-8b19-04f83a6878c8.png)
   
   hdfs service check after enabling kerberos authentication
   ![image](https://user-images.githubusercontent.com/13212217/193444593-9f37be5c-9748-4dfa-a870-ffac6a4e3dc8.png)
   
   
   
   
   Please review [Ambari Contributing Guide](https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute) before opening a pull request.


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] kevinw66 commented on a diff in pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
kevinw66 commented on code in PR #3378:
URL: https://github.com/apache/ambari/pull/3378#discussion_r990657793


##########
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/files/checkWebUI.py:
##########
@@ -67,19 +67,21 @@ def main():
   parser.add_option("-p", "--port", dest="port", help="Port of WEB UI to check it availability")
   parser.add_option("-s", "--https", dest="https", help="\"True\" if value of dfs.http.policy is \"HTTPS_ONLY\"")
   parser.add_option("-o", "--protocol", dest="protocol", help="Protocol to use when executing https request")
+  parser.add_option("-a", "--path", dest="path", help="Path of WEB UI")
 
   (options, args) = parser.parse_args()
   
   hosts = options.hosts.split(',')
   port = options.port
   https = options.https
   protocol = options.protocol
+  path = options.path
 
   for host in hosts:
-    httpCode = make_connection(host, port, https.lower() == "true", protocol)
+    httpCode = make_connection(host, port, https.lower() == "true", protocol, path)
 
     if httpCode != 200:

Review Comment:
   Hi @smallyao , after I take a deep look at this bug, I found the error only occurs when Kerberos is disabled and HA is enabled, it reports an error when http response code is not 200, but now it returns 302, which I think also should be healthy status.
   Can we simply add one more condition here to make 302 passed too?



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] smallyao commented on pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
smallyao commented on PR #3378:
URL: https://github.com/apache/ambari/pull/3378#issuecomment-1272277483

   > https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/service_check.py#L97 Can we remove this line? seems redundant.
   
   Done


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] smallyao commented on a diff in pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
smallyao commented on code in PR #3378:
URL: https://github.com/apache/ambari/pull/3378#discussion_r990591850


##########
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/service_check.py:
##########
@@ -81,12 +81,13 @@ def service_check(self, env):
     params.HdfsResource(None, action="execute")
 
     if params.has_journalnode_hosts:
+      journalnode_web_path = "/journalnode.html"
       if params.security_enabled:
         for host in params.journalnode_hosts:
           if params.https_only:
-            uri = format("https://{host}:{journalnode_port}")
+            uri = format("https://{host}:{journalnode_port}{journalnode_web_path}")

Review Comment:
   Because the variable journalnode_web_path starts with character /,  we don't need  put /  between {journalnode_port} and journalnode_web_path anymore. I will change this in a different way



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] smallyao commented on a diff in pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
smallyao commented on code in PR #3378:
URL: https://github.com/apache/ambari/pull/3378#discussion_r990590522


##########
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/service_check.py:
##########
@@ -81,12 +81,13 @@ def service_check(self, env):
     params.HdfsResource(None, action="execute")
 
     if params.has_journalnode_hosts:
+      journalnode_web_path = "/journalnode.html"

Review Comment:
   It's also okay if using index.html but in fact index.html will jump to journalnode.html



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] kevinw66 merged pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
kevinw66 merged PR #3378:
URL: https://github.com/apache/ambari/pull/3378


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] smallyao commented on a diff in pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
smallyao commented on code in PR #3378:
URL: https://github.com/apache/ambari/pull/3378#discussion_r990759181


##########
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/files/checkWebUI.py:
##########
@@ -67,19 +67,21 @@ def main():
   parser.add_option("-p", "--port", dest="port", help="Port of WEB UI to check it availability")
   parser.add_option("-s", "--https", dest="https", help="\"True\" if value of dfs.http.policy is \"HTTPS_ONLY\"")
   parser.add_option("-o", "--protocol", dest="protocol", help="Protocol to use when executing https request")
+  parser.add_option("-a", "--path", dest="path", help="Path of WEB UI")
 
   (options, args) = parser.parse_args()
   
   hosts = options.hosts.split(',')
   port = options.port
   https = options.https
   protocol = options.protocol
+  path = options.path
 
   for host in hosts:
-    httpCode = make_connection(host, port, https.lower() == "true", protocol)
+    httpCode = make_connection(host, port, https.lower() == "true", protocol, path)
 
     if httpCode != 200:

Review Comment:
   Hi @kevinw66  It's also okay to make http response code 302 pass if just simply resolve this issue.  I will modify it.



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] smallyao commented on a diff in pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
smallyao commented on code in PR #3378:
URL: https://github.com/apache/ambari/pull/3378#discussion_r990591850


##########
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/scripts/service_check.py:
##########
@@ -81,12 +81,13 @@ def service_check(self, env):
     params.HdfsResource(None, action="execute")
 
     if params.has_journalnode_hosts:
+      journalnode_web_path = "/journalnode.html"
       if params.security_enabled:
         for host in params.journalnode_hosts:
           if params.https_only:
-            uri = format("https://{host}:{journalnode_port}")
+            uri = format("https://{host}:{journalnode_port}{journalnode_web_path}")

Review Comment:
   Because the variable journalnode_web_path starts with character /,  we don't need  put /  between {journalnode_port} and journalnode_web_path anymore. I will change this iin a different way



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org


[GitHub] [ambari] kevinw66 commented on a diff in pull request #3378: AMBARI-25748: HDFS Service Check Fails in NameNode HA cluster

Posted by GitBox <gi...@apache.org>.
kevinw66 commented on code in PR #3378:
URL: https://github.com/apache/ambari/pull/3378#discussion_r990657793


##########
ambari-server/src/main/resources/stacks/BIGTOP/3.2.0/services/HDFS/package/files/checkWebUI.py:
##########
@@ -67,19 +67,21 @@ def main():
   parser.add_option("-p", "--port", dest="port", help="Port of WEB UI to check it availability")
   parser.add_option("-s", "--https", dest="https", help="\"True\" if value of dfs.http.policy is \"HTTPS_ONLY\"")
   parser.add_option("-o", "--protocol", dest="protocol", help="Protocol to use when executing https request")
+  parser.add_option("-a", "--path", dest="path", help="Path of WEB UI")
 
   (options, args) = parser.parse_args()
   
   hosts = options.hosts.split(',')
   port = options.port
   https = options.https
   protocol = options.protocol
+  path = options.path
 
   for host in hosts:
-    httpCode = make_connection(host, port, https.lower() == "true", protocol)
+    httpCode = make_connection(host, port, https.lower() == "true", protocol, path)
 
     if httpCode != 200:

Review Comment:
   Hi @smallyao , after I take a deep look at this bug, I found the error only occurs when Kerberos is disabled and HA is enabled, it reports an error when http response code is 200, but now it returns 302, which I think also should be healthy status.
   Can we simply add one more condition here to make 302 passed too?



-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ambari.apache.org
For additional commands, e-mail: dev-help@ambari.apache.org