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

What is the use of automatic operation and maintenance tool clip

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

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of automatic operation and maintenance tool clip, the article is very detailed, has a certain reference value, interested friends must read it!

Clip is an automated operation and maintenance tool, suitable for massive server management scenarios, can reduce the risk of system misoperation, improve work efficiency and so on.

Clip replaces the traditional IP management latitude with String management latitude. The change of management mode makes mass operation and maintenance more convenient, reliable and efficient. Clip is the Clip S architecture, which stores the IP relationship on the server side, and the client side can download SDK, traverse the IP and module relationship on the server side through SDK, and reorganize and rearrange the acquired IP module relationship locally, which is called Clip. On this basis, Clip also provides functions such as remote commands, file copy, IP organization tree traversal, historical command viewing, positive and negative parsing and import of String relations corresponding to IP. For the massive server operation and maintenance escort, lay the foundation.

The following is a detailed description of the following clip, an automatic exchange tool for operation and maintenance.

First of all, compared with String management, there are three advantages of String management:

1) the traditional management mode is IP. IP is composed of four groups of meaningless numbers, which is difficult to remember. Compared with the traditional way, String can see the name and meaning, and is convenient to remember.

2) when managing massive services, IP similarity often leads to operational failures, such as module A (10.131.24.37) and module B (10.117.24.37). The latter two digits are the same, and the two B modules are habitually considered to be module A, and sending configuration leads to online failure. This problem can be easily avoided through string management.

3) String can parse an IP or a set of IP, or reverse parse the String correspondence according to IP, which makes it more convenient for us to manage a group of services.

Let's take a look at the composition of String again. String is composed of (idc-product-modules-group) 4 segments. Students who know cmdb will find that its structure is very similar to that of cmdb. Level 4 module locates a service, but with the development of business, the author feels that level 4 service can no longer be located to a service. For example, when different business modules are mixed on a server, level 4 can only be located to the IP level of the service, but not to the real service. So Clip adds one level (idc-product-modules-group-port) on this basis, port port, through 5 segments to locate a service, which is also the advantage of Clip, flexible transformation to locate a group of services to meet business needs. Let's take another practical example. In the Shanghai computer room, module A uses port 80 to provide services, and module B uses port 8080 to provide services. At present, there are more than 100 machines, due to the decline in business traffic. In order to save resources, I currently want to merge the resources of the two modules, but the functions are not merged. We can represent two services into an impassable String, such as module A (sh-weixin-friend-a-80) and module B (sh-weixin-friend-b-8080). It is easy to separate the two services through String and deploy them on the same server to provide services.

We just introduced that Clip is Cramp S architecture. The IP relationship corresponding to String is stored in the server server. Client acquires IP through Clip's SDK. Its advantages are as follows:

1) after IP and String suggest a relationship, it can be called on all servers through SDK.

2) SDK provides other rich functions on the basis of parsing IP, such as scanning server, remote command, remote copy and so on.

3) Clip provides simple and clear API and SDK code structure and documentation, when Clip can not meet our needs, we can easily expand Clip through documentation to meet our needs.

Next, let's take a look at Clip SDK. Currently, there are eight subcommands in SDK:

The functions of each SDK subcommand are as follows:

◆ scan: used to scan the port survival status of the IP corresponding to String

◆ cstring: used to parse the IP corresponding to String and the String relationship corresponding to IP

◆ ssh: used to remotely execute system commands to IP corresponding to String

◆ scp: used to copy files remotely to IP corresponding to String

◆ tree: traversing child nodes under String

◆ history: displays commands executed in history

◆ import: import IP corresponding to String relationship

◆ lt: acquire IP relationships locally for management

◆ help: shows how many subcommands Clip has on the day.

*. Let's take a look at the application case to compare the differences of traditional vs clip management methods:

Traditional method: execute the uptime command on the 100servers of module A, the specific steps are as follows:

1) find the ip list of A modules to be synchronized

2) write a script to establish a connection with the server in the ip list

3) enter the account password when connecting to the server

4) copy files after successful account password verification

5) repeat the above steps for each IP.

Clip mode:

1) establish the correspondence between the ip list of module An and string, such as tj-qzone-qzoneini-access6

2) clip ssh-p password root@tj-qzone-qzoneini-access6 "execute command", the following is the structure.

Clip Server installation

1) install Apache\ PHP and MySQL

# yum install httpd php msyql mysql-server

2) install the Clip WEB interface program. (note: the Clip WEB program is developed by the Doitphp framework)

2.1) mkdir-p / data/webroot/ (create http virtual host release directory)

2.2) wget http://blog.puppeter.com/download/clip/clip_web.tar.gz

2.3) tar-xvzf clip_web.tar.gz-C (Apache Program release Directory / data/webroot/)

Configure httpd.conf and append virtual host configuration information.

NameVirtualHost *: 80

ServerAdmin wds@tencent.com

DocumentRoot / data/webroot/clip_server/

ServerName clip.puppeter.com

ErrorLog logs/clip.puppeter.com-error_log

CustomLog logs/clip.puppeter.com-access_log common

2.5) start httpd.

3) service mysqld start starts Mysql

3.1) wget http://blog.puppeter.com/download/clip/clip_db.tar.gz download table structure

Mysql-u root-p enter the mysql and import the table structure

Mysql- > create databases clip create clip library

Mysql- > mysql- u root-p clip

< clip.sql 导入数据表。    3.3 ) SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘newpass’); 设置mysql密码    3.4 ) FLUSH PRIVILEGES; 刷新mysql配置 4 ) 设置Clip WEB连接mysql 编辑 /data/webroot/clip_server/application/config/clip.ini.php Clip SDK安装 Cllip SDK 由Python开发,以下为Clip依赖环境安装过程: 1)下载安装Python (注:目前支持Python 2.6.* 和 2.7.*版本) && expect # yum install python expect # python源码安装,推荐2.6.6(下载页面:https://www.python.org/download/releases/2.6.6/) 2)下载Clip SDK # wget http://blog.puppeter.com/download/clip/clip_latest.tar.gz 3)安装Cllip SDK # tar -xvzf clip_p1.0.tar.gz -C /usr/local/servcers (注:指定安装目录) 4)设置Clip。 编辑 clip/conf/clip.ini 文件,变更server_ip选项为Clip_webIP 5)导入环境变量 export PATH=$PATH:/usr/local/services/clip/ (安装路径) 或者 echo ‘export PATH=$PATH:/usr/local/services/clip/ ‘ >

> / etc/profile & & source / etc/profile

6) execute the Cllip command (see screenshot)

Clip SDK usage

The Clip SDK function is used to obtain IP relationships on Server and to reorganize IP relationships on Client. (note: currently, clip also supports storing IP to local files for management.) Currently, Clip provides 8 subcommands, and the parameters of the following Clip SDK subcommands are explained and demonstrated (more case reference: Clipper case):

Clip scan (used to scan the port viability status of the IP corresponding to String)

◆-query_string (- Q) # scan the port of IP based on String

◆-ip (- I) # scan the port of the specified IP

◆-query_string (- Q) *-test-*-*,*-docker-*-* # multiple String scans are separated by commas

◆-append (- a) # append IP to the original String, and append multiple (192.168.0.1192.168.0.2) IP separated by commas

◆-remove_ip (- r) # Delete the IP of String's existing IP list

◆-limit (- l) # scan the IP range of the specified range in String

◆-port (- P) # specify a custom scan port (note: default is port 80)

◆-log_disable (- o) # the default log is reported to the server, and the history is checked through the history command. Log reporting can be turned off through this command. It is recommended to use clip frequently to disable clip.

Demonstration of clip scan usage:

Scan *-puppet-*-* corresponds to an open port

Clip cstring (IP relation between positive solution and inverse solution String)

◆-query_string (- Q) # parses the IP list corresponding to String

◆-ip (- I) # parsing String corresponding to IP

◆-query_string (- Q) *-test-*-*,*-docker-*-* # parses multiple String corresponding IP lists, and multiple String are separated by commas

◆-limit (- l) # parses the IP range of the specified range in String

◆-append (- a) # append IP to the original String, and append multiple (192.168.0.1192.168.0.2) IP separated by commas

◆-remove_ip (- r) # Delete the IP of String's existing IP list

◆-join (- j) # specifies the output format, which supports four output formats ("|", "\ n", space).

◆-log_disable (- o) # the default log is reported to the server, and the history is checked through the history command. Log reporting can be turned off through this command. It is recommended to use clip frequently to disable clip.

◆-count (- c) # Statistics the number of output IP

◆-dryrun (- d) # output call interface use case

Clip cstring demo:

Parse the IP relationship corresponding to *-qq-*-*.

Parse the corresponding String of 192.168.0.7.

Clip ssh (remote command execution tool)

◆-password (- p) # password

◆-append (- a) # append IP to the original String, and append multiple (192.168.0.1192.168.0.2) IP separated by commas

◆-remove_ip (- r) # Delete the IP of String's existing IP list

◆-limit (- l) # parses the IP range of the specified range in String

◆-port (- P) # specify custom port (note: default is port 22)

◆-dryrun (- d) # output call interface use case

◆-log_disable (- o) # the default log is reported to the server, and the history is checked through the history command. Log reporting can be turned off through this command. It is recommended to use clip frequently to disable clip.

Clip ssh demo:

Check the string (sh-docker-base_v1-*) corresponding to the load on the machine.

View the load corresponding to the * servers of string (sh-docker-base_v1-*).

Clip scp (remote command execution tool)

◆-password (- p) # password

◆-append (- a) # append IP to the original String, and append multiple (192.168.0.1192.168.0.2) IP separated by commas

◆-remove_ip (- r) # Delete the IP of cstring's existing IP list

◆-limit (- l) # parses the IP range of the specified range in String

◆-port (- P) # specify custom port (note: default is port 22)

◆-dryrun (- d) # output call interface use case

◆-log_disable (- o) # the default log is reported to the server, and the history is checked through the history command. Log reporting can be turned off through this command. It is recommended to use clip frequently to disable clip.

Clip scp demo:

Push the ip file to the / tmp directory of the machine corresponding to string (sh-docker-base_v1-*).

Tree (String Relational traversal tool)

◆-query_string (- p) # password

◆-json (- j) # specifies the format of the output

◆-dryrun (- d) # output call interface use case

◆-log_disable (- o) # the default log is reported to the server, and the history is checked through the history command. Log reporting can be turned off through this command. It is recommended to use clip frequently to disable clip.

Clip tree demo:

Traverse the nodes under *-*

Import (IP relationship Import tool)

◆-insert (- I) # Import the clip correspondence in the file into the database

◆-bulid (- b) # create clip import database, relational template file

◆-list_struct (- l) # shows the clip database structure

Clip import demo:

Clip import-b create import string and relationship template

Lt (Local tools Local acquisition IP relationship Management tool)

◆-password (- p) # password

◆-append (- a) # append IP with multiple IP separated by commas

◆-remove (- r) # # Delete the IP of the original IP list

◆-port (- P) # specify custom port (note: default is port 22)

Clip import demo:

Clip lt conducts remote ssh command based on the local file IP file, where root@ "local IP relation file name"

The above is all the content of this article "what is the use of automatic operation and maintenance tool clip". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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