婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > linux系統(tǒng)中 屏蔽storm ui的kill功能的兩種方法

linux系統(tǒng)中 屏蔽storm ui的kill功能的兩種方法

熱門標(biāo)簽:地圖標(biāo)注怎么兼職 滁州外呼系統(tǒng)接口對(duì)接 營(yíng)業(yè)廳外呼系統(tǒng)有錄音嗎 地圖標(biāo)注和視頻彩鈴制作生意 南通電銷外呼系統(tǒng)排名 信陽(yáng)智能外呼系統(tǒng)聯(lián)系方式 宿松百度地圖標(biāo)注 南京電銷外呼系統(tǒng)廠家 合力億捷外呼系統(tǒng)如何解壓安裝

  今天有個(gè)storm的topology被人kill掉了,但是找不到是誰(shuí)做的,storm的ui有kill topology的功能,但是沒有權(quán)限驗(yàn)證,這樣就導(dǎo)致知道ui地址的任何人都可以kill掉topology,比較危險(xiǎn),考慮把這個(gè)action disable掉。

  有兩種方法:

  1.前端增加nginx,做location

  分析ui頁(yè)面,對(duì)應(yīng)kill的button,html中的action為:


復(fù)制代碼
代碼如下:
  input enabled="" onclick="confirmAction('xxxxxxxxxx', 'xxxxxxxx', 'kill', true, 30)" type="button" value="Kill">

  調(diào)用了js的confirmAction方法,這個(gè)方法存在于storm-core/src/ui/public/js/script.js 中,方法的定義如下:


復(fù)制代碼
代碼如下:
  function confirmAction(id, name, action, wait, defaultWait) {var opts = {type:'POST',url:'/topology/' + id + '/' + action};
  if (wait) {
  var waitSecs = prompt('Do you really want to ' + action + ' topology "' + name + '"? ' +'If yes, please, specify wait time in seconds:',defaultWait);if (waitSecs != null waitSecs != "" ensureInt(waitSecs)) {opts.url += '/' + waitSecs;} else {return false;}
  } else if (!confirm('Do you really want to ' + action + ' topology "' + name + '"?')) {return false;}
  $("input[type=button]").attr("disabled", "disabled");$.ajax(opts).always(function () {window.location.reload();}).fail(function () {alert("Error while communicating with Nimbus.")});return false;}

  以看到方法主要分為兩步,生成post請(qǐng)求的url,格式為'/topology/' + id + '/' + action + '/' + waitSecs,這里action為kill,waitSecs為觸發(fā)kill時(shí)手動(dòng)填入的時(shí)間,比如這里的30s,最終的url格式如下:


復(fù)制代碼
代碼如下:
  /topology/xxxxx/kill/xxxx

  第二步就是根據(jù)這個(gè)設(shè)置觸發(fā)一個(gè)ajax請(qǐng)求,這里我們只需要關(guān)心第一步即可,設(shè)置nginx如下:


復(fù)制代碼
代碼如下:
  upstream storm {
  server 127.0.0.1:8888 weight=3 max_fails=3 fail_timeout=5s;}
  server {
  server_name storm.xxx.com;
  listen 80;
  proxy_set_header Host $host;
  proxy_read_timeout 3600;
  proxy_set_header X-Forwarded-For $remote_addr;access_log /var/log/nginx/storm.access.log main;error_log /var/log/nginx/storm.error.log debug;location ~* /topology/(.*)/kill/(.*) {return 403;}
  location / {
  proxy_pass http://storm;
  }
  }

  這樣,就可以屏蔽掉前端的kill功能了。

  注意一個(gè)細(xì)節(jié),storm ui的默認(rèn)端口時(shí)8080,這個(gè)端口和nm沖突(見bug https://github.com/yahoo/storm-yarn/issues/25),設(shè)置storm.yaml ui.port: 8888,并重啟ui即可.

  2.更改代碼,去掉action相關(guān)的button


復(fù)制代碼
代碼如下:
  storm-core/src/ui/public/topology.html

  去除掉下面的部分:


復(fù)制代碼
代碼如下:
  div id="topology-actions">
  h2 class="js-only">Topology actions/h2>
  p id="topology-actions" class="js-only">
  /p>
  /div>

  第二種方法需要重新編譯,還沒有做測(cè)試。。

  以上就是linux系統(tǒng)中屏蔽storm ui的kill功能的2種方法,在此感謝本文的原創(chuàng)作者 “菜光光的博客” ,請(qǐng)務(wù)必保留此出處http://caiguangguang.blog.51cto.com/1652935/1557514,謝謝閱讀,希望能幫到大家,請(qǐng)繼續(xù)關(guān)注腳本之家,我們會(huì)努力分享更多優(yōu)秀的文章。

標(biāo)簽:衢州 麗水 運(yùn)城 銅陵 新余 保定 山南 潛江

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《linux系統(tǒng)中 屏蔽storm ui的kill功能的兩種方法》,本文關(guān)鍵詞  linux,系統(tǒng),中,屏蔽,storm,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《linux系統(tǒng)中 屏蔽storm ui的kill功能的兩種方法》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于linux系統(tǒng)中 屏蔽storm ui的kill功能的兩種方法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 枣庄市| 尖扎县| 绥阳县| 崇阳县| 浠水县| 齐齐哈尔市| 信丰县| 靖宇县| 通河县| 宝坻区| 高雄市| 河西区| 寿宁县| 凭祥市| 宜春市| 且末县| 乌鲁木齐市| 晴隆县| 嵩明县| 二手房| 珲春市| 铜梁县| 阳东县| 云南省| 如东县| 芜湖市| 孟村| 根河市| 库伦旗| 古田县| 北流市| 东乌| 望奎县| 朝阳区| 抚远县| 霍林郭勒市| 来安县| 伊通| 古丈县| 柳州市| 高平市|