Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to display IP that accesses an elasticsearch cluster

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to display the IP to access the elasticsearch cluster". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to display the IP to access the elasticsearch cluster".

There may be many groups of clusters in the R & D environment, some of which may be used improperly or perform onerous statistics, performance tests, etc., resulting in a lot of pressure on the cluster and affecting others. At this point, you need to find out who is using the cluster as soon as possible. Fabric is used for daily maintenance, and the interface is not used originally. The interface is an accident. Scanning is a port scan, which is used to help me judge each other, for example, port 80 is open, and I click there is an ETL, then I will know.

#! / usr/bin/env python# encoding: utf-8from collections import Counterfrom fabric.api import cd,run,execute,env Hostsfrom fabric.colors import * env.hosts= ['localhost'] env.password =' root'env.warn_only = Truedef source_task (ips): res = run ('netstat-nt | grep ": 9300\ |: 9200"') if res.strip () = "": return lines= [] for x in res.split ("\ n"): a = x.split () if " 9300 "in a [3] or": 9200 "in a [3]: lines.append (a [4] .split (": ") [3]) ips.extend (lines) def get_host (): ips= [] execute (source_task) Ips) return Counter (ips) def es_task (command): run ("/ opt/elasticsearch-1.3.2/bin/service/elasticsearch" + command) if _ _ name__== "_ _ main__": print get_host () Thank you for reading The above is the content of "how to display the IP of accessing elasticsearch cluster". After the study of this article, I believe you have a deeper understanding of how to display the IP of accessing elasticsearch cluster, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report