In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "the methods and steps of Linux shielding the kill function of storm ui". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
There are two ways:
1. Add nginx to the front end to do location
Analyze the ui page, and the action in the button,html of the corresponding kill is:
The code is as follows:
"input enabled="onclick=confirmAction ('xxxxxxxxxx',' xxxxxxxx', 'kill', true, 30)" type= "button" value= "Kill"
The confirmAction method of js is called, which exists in storm-core/src/ui/public/js/script.js and is defined as follows:
The code is as follows:
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;}
The method is mainly divided into two steps: generate the url of the post request in the format'/ topology/' + id +'/'+ action +'/'+ waitSecs, where action is the time when kill,waitSecs is manually entered when the kill is triggered, such as the 30s here, and the final url format is as follows:
The code is as follows:
/ topology/xxxxx/kill/xxxx
The second step is to trigger an ajax request based on this setting. Here, we only need to care about the first step. Set the nginx as follows:
The code is as follows:
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;
}
}
In this way, the front-end kill function can be blocked.
Note one detail: the default port for storm ui is 8080, which conflicts with nm (see bug https://github.com/yahoo/storm-yarn/issues/25). Set storm.yaml ui.port: 8888 and restart ui.
two。 Change the code to remove the button related to action
The code is as follows:
Storm-core/src/ui/public/topology.html
Remove the following:
The code is as follows:
Div id= "topology-actions"
"h3 class=" js-only "" Topology actions "/ h3"
"p id=" topology-actions "class=" js-only ""
"/ p"
"/ div"
This is the end of the content of "the method steps of Linux shielding the kill function of storm ui". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.