1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
      如何解決Ambari自定義服務(wù)啟動(dòng)成功后依舊顯示停止?fàn)顟B(tài)問題

      如何解決Ambari 自定義服務(wù)啟動(dòng)成功后依舊顯示停止?fàn)顟B(tài)問題,針對(duì)這個(gè)問題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問題的小伙伴找到更簡(jiǎn)單易行的方法。

      創(chuàng)新互聯(lián)專注于揭陽網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供揭陽營(yíng)銷型網(wǎng)站建設(shè),揭陽網(wǎng)站制作、揭陽網(wǎng)頁設(shè)計(jì)、揭陽網(wǎng)站官網(wǎng)定制、小程序開發(fā)服務(wù),打造揭陽網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供揭陽網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。

      1、概述

      如果遇到該情況,首先前往 /var/log/ambari-agent/ambari-agent.log 查看日志輸出。

      服務(wù)安裝后,每隔大約 60s 會(huì)執(zhí)行 status() 方法。如果執(zhí)行 status() 方法的過程中報(bào)錯(cuò),則在 Ambari 頁面上會(huì)顯示服務(wù)已停止。如果執(zhí)行 status() 方法的過程中沒報(bào)錯(cuò),則在 Ambari 頁面上顯示服務(wù)正常。

      通常在 status() 方法中,我們會(huì)使用 Ambari 提供的 resource_management 模塊里的 check_process_status() 來判斷服務(wù)的狀態(tài)。

      check_process_status() 通過檢測(cè)一個(gè) pid 文件里面的進(jìn)程號(hào),來判斷服務(wù)的啟動(dòng)狀態(tài)。通常 pid 文件內(nèi)只有一個(gè)進(jìn)程號(hào),如 12168 。

       

      2、問題示例分析

       
      2.1、報(bào)錯(cuò)

      以自定義服務(wù) JanusGraph 為例,status() 方法是這樣寫的:

      from resource_management import *

      def status(self, env):
          import graphexp_params
          env.set_params(graphexp_params)
          check_process_status(graphexp_params.graphexp_nginx_pid_file)
       

      graphexp_params.py 文件的局部?jī)?nèi)容:

      from resource_management import *

      config = Script.get_config()
      # graphexp的nginx pid文件路徑
      graphexp_pid_dir = config['configurations']['graphexp-server']['graphexp_pid_dir']
      # graphexp的nginx pid文件路徑
      graphexp_nginx_pid_file = os.path.join(graphexp_pid_dir, 'graphexp_nginx.pid')
       

      上述代碼是動(dòng)態(tài)獲取 Ambari 頁面上的 graphexp_pid_dir 配置項(xiàng),然后拼湊成一個(gè) pid 文件路徑,這個(gè) pid 文件內(nèi)容只有 graphexp 組件的進(jìn)程號(hào)。

      結(jié)果出錯(cuò)了,根據(jù) /var/log/ambari-agent/ambari-agent.log 日志輸出,發(fā)現(xiàn)在 status_params.py 里面獲取 graphexp-server.xml 文件內(nèi)的參數(shù)值報(bào)錯(cuò),如下圖所示:

      如何解決Ambari 自定義服務(wù)啟動(dòng)成功后依舊顯示停止?fàn)顟B(tài)問題

       
      2.2、問題排查

      在 status() 方法下,輸出 config['configurations'] 發(fā)現(xiàn)只能打印出:

      ams-hbase-env,infra-solr-env,hbase-env,ams-env,elastic-env,janusgraph-env,ams-grafana-env,hadoop-env,zookeeper-env,cluster-env
       

      以上這些值,沒有 graphexp-server 項(xiàng)。

      而在 start() 方法里面打印有很多,所有的 configurations 的 xml 文件都被加載到了:

      ranger-hdfs-audit,ssl-client,infra-solr-log4j,ranger-hdfs-policymgr-ssl,ams-hbase-site,elastic-config,ranger-hbase-audit,hdfs-logsearch-conf,ams-grafana-env,ranger-hdfs-security,ams-ssl-client,infra-solr-env,ranger-hdfs-plugin-properties,hbase-policy,ams-logsearch-conf,ams-hbase-security-site,hdfs-site,ams-env,ams-site,ams-hbase-policy,janusgraph-env,hadoop-metrics2.properties,hadoop-policy,hdfs-log4j,hbase-site,infra-logsearch-conf,ranger-hbase-plugin-properties,ams-grafana-ini,graphexp-server,ams-ssl-server,infra-solr-xml,ams-log4j,ams-hbase-env,core-site,infra-solr-security-json,gremlin-server,janusgraph-hbase-solr,infra-solr-client-log4j,hbase-logsearch-conf,hadoop-env,zookeeper-log4j,hbase-log4j,postgresql,ssl-server,hbase-env,zoo.cfg,elastic-env,ranger-hbase-policymgr-ssl,zookeeper-logsearch-conf,cluster-env,zookeeper-env,ams-hbase-log4j,ranger-hbase-security
       

      所以猜測(cè)在 status() 方法里面,只能識(shí)別 xxx-env.xml 里面的配置內(nèi)容。但是 ambari2.7 的自定義服務(wù)沒有這個(gè)問題,只在 ambari2.6 上出現(xiàn)了。

       
      2.3、解決辦法

      新建 graphexp-env.xml 文件,將 graphexp_pid_dir 配置項(xiàng)添加到該文件內(nèi)。graphexp_params.py 文件的 graphexp_pid_dir 寫法修改為:

      # graphexp的nginx pid文件路徑
      graphexp_pid_dir = config['configurations']['graphexp-env']['graphexp_pid_dir']
      # graphexp的nginx pid文件路徑
      graphexp_nginx_pid_file = os.path.join(graphexp_pid_dir, 'graphexp_nginx.pid')
          在 status() 方法內(nèi),獲取 graphexp-env.xml 文件內(nèi)的配置,只有 xxx-env.xml 的內(nèi)容才可以被 status() 方法加載到。

      3、status()方法調(diào)試建議

      由于 status() 是輪詢調(diào)用,且目前還不知道日志輸出的具體位置(沒有輸出到 ambari-agent.log 里面),所以可以用 Execute("echo {0} >> /tmp/test.log".format(status_params.gtm_standby_pid_file)) 命令來輸出需要的參數(shù)值。同時(shí)也可以根據(jù)上述 Execute 語句位置來判斷代碼具體的報(bào)錯(cuò)行數(shù),方便定位代碼報(bào)錯(cuò)地點(diǎn)。 

      關(guān)于如何解決Ambari 自定義服務(wù)啟動(dòng)成功后依舊顯示停止?fàn)顟B(tài)問題問題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識(shí)。


      網(wǎng)站名稱:如何解決Ambari自定義服務(wù)啟動(dòng)成功后依舊顯示停止?fàn)顟B(tài)問題
      網(wǎng)頁鏈接:http://ef60e0e.cn/article/geciie.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        霍州市| 宜章县| 贺兰县| 松滋市| 富川| 太湖县| 淄博市| 东山县| 安顺市| 城固县| 镇康县| 宿松县| 扎囊县| 兴山县| 集贤县| 剑阁县| 涞源县| 全椒县| 焦作市| 民丰县| 嘉禾县| 宜章县| 东源县| 拉萨市| 永登县| 津市市| 收藏| 谷城县| 隆安县| 宝兴县| 黄大仙区| 万全县| 丽江市| 新乡县| 湘乡市| 武鸣县| 江津市| 灵璧县| 阜新| 黄骅市| 克拉玛依市|