CN106815132A - A kind of cluster server formation gathering method - Google Patents
A kind of cluster server formation gathering method Download PDFInfo
- Publication number
- CN106815132A CN106815132A CN201710024824.6A CN201710024824A CN106815132A CN 106815132 A CN106815132 A CN 106815132A CN 201710024824 A CN201710024824 A CN 201710024824A CN 106815132 A CN106815132 A CN 106815132A
- Authority
- CN
- China
- Prior art keywords
- node
- information
- cluster server
- script
- copy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3466—Performance evaluation by tracing or monitoring
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4482—Procedural
- G06F9/4484—Executing subprograms
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computer And Data Communications (AREA)
- Stored Programmes (AREA)
Abstract
本发明公开一种集群服务器信息收集方法,涉及集群服务器管理领域;选取集群服务器的某一个节点,将各节点的参数信息保存在配置文档里,拷贝信息收集脚本到选取的节点下,执行信息收集脚本提取配置文档里的各节点的参数信息,并调用expect工具实现各节点的参数信息的自动输入,执行信息收集脚本将所有节点的日志信息拷贝到选取的节点下并按照序号命名。
The invention discloses a cluster server information collection method, which relates to the cluster server management field; select a certain node of the cluster server, save the parameter information of each node in a configuration file, copy the information collection script to the selected node, and execute the information collection The script extracts the parameter information of each node in the configuration document, and calls the expect tool to realize the automatic input of the parameter information of each node, and executes the information collection script to copy the log information of all nodes to the selected node and name them according to the serial number.
Description
技术领域technical field
本发明公开一种信息收集方法,涉及集群服务器管理领域,具体的说是一种集群服务器信息收集方法。The invention discloses an information collection method, relates to the field of cluster server management, in particular to a cluster server information collection method.
背景技术Background technique
电脑的各种信息保存在服务器中,服务器的管理和维护至关重要。服务器在管理和维护时需要获取服务器的各种文件,比如系统的日志信息来分析服务器的状况,对于小型集群,这还不是很费时费力,然而对于较大集群,服务器的节点很多,如果使用通常方法通过U盘或者scp命令对逐个节点的信息进行拷贝则需要耗费大量时间精力,进行很多重复工作。本发明提供一种集群服务器信息收集方法,该方法通过expect工具和shell脚本一起实现scp远程拷贝过程中输入ip地址,用户名和密码的操作,之后执行该脚本即可完成拷贝操作,执行过程中无需手动输入其他的系统命令和进行其他操作。本发明方法使用方便,操作简单,无需掌握专业知识也可完成,节省人力和时间,提高工作效率。Various information of the computer is stored in the server, and the management and maintenance of the server are very important. The server needs to obtain various files of the server during management and maintenance, such as system log information to analyze the status of the server. For small clusters, this is not very time-consuming and laborious. However, for larger clusters, the server has many nodes. If you use the usual Method It takes a lot of time and energy to copy the information of each node through the U disk or the scp command, and a lot of repetitive work. The present invention provides a kind of cluster server information collection method, this method realizes the operation of inputting IP address, user name and password in scp remote copying process together through expect tool and shell script, executes this script afterwards and can finish copying operation, does not need in the execution process Manually enter other system commands and perform other operations. The method of the invention is convenient to use, simple to operate, can be completed without professional knowledge, saves manpower and time, and improves work efficiency.
expect for Windows是一款Windows平台下功能强大的expect工具,用于系统管理和自动化测试。expect使用Tcl作为语言核心。Tcl实际上是一个子程序库,这些子程序库可以嵌入到程序里从而提供语言服务.不仅如此,不管程序是交互和还是非交互的,Expect都能运用。expect for Windows is a powerful expect tool under the Windows platform for system management and automated testing. expect uses Tcl as the language core. Tcl is actually a library of subroutines that can be embedded in programs to provide language services. Not only that, Expect can be used regardless of whether the program is interactive or non-interactive.
发明内容Contents of the invention
本发明针对目前技术发展的需求和不足之处,提供一种集群服务器信息收集方法,使用该方法只需选取一个节点,将该脚本拷贝到该节点上,然后执行该脚本即可将所有节点的日志信息拷贝到该节点下并按照序号命名。Aiming at the needs and deficiencies of the current technological development, the present invention provides a cluster server information collection method, using this method only needs to select a node, copy the script to the node, and then execute the script to collect the information of all nodes The log information is copied to this node and named according to the serial number.
一种集群服务器信息收集方法:A method for collecting cluster server information:
选取集群服务器的某一个节点,将各节点的参数信息保存在配置文档里,拷贝信息收集脚本到选取的节点下,执行信息收集脚本提取配置文档里的各节点的参数信息,并调用expect工具实现各节点的参数信息的自动输入,执行信息收集脚本将所有节点的文件信息拷贝到选取的节点下并按照序号命名。Select a node of the cluster server, save the parameter information of each node in the configuration file, copy the information collection script to the selected node, execute the information collection script to extract the parameter information of each node in the configuration file, and call the expect tool to realize The parameter information of each node is automatically input, and the information collection script is executed to copy the file information of all nodes to the selected node and name it according to the serial number.
所述信息收集脚本使用shell脚本编辑。The information collection script is edited using a shell script.
执行所述信息收集脚本中的scp命令,利用远程操作将所有节点的文件信息拷贝到选取的节点下并按照序号命名。Execute the scp command in the information collection script, use remote operation to copy the file information of all nodes to the selected node and name them according to the serial number.
各节点的参数信息包括ip地址、用户名和密码、待拷贝的文件名。The parameter information of each node includes an ip address, a user name and a password, and a file name to be copied.
所述一种集群服务器信息收集方法具体操作步骤为:The specific operation steps of the cluster server information collection method are as follows:
S1选取集群服务器的某一个节点,S1 selects a node of the cluster server,
S2编辑配置文档,将各节点的参数信息保存在配置文档里;S2 edits the configuration file, and saves the parameter information of each node in the configuration file;
S3拷贝信息收集脚本到选取的节点下,S3 copies the information collection script to the selected node,
S4信息收集脚本自动执行,获取配置文档信息,并调用expect工具自动输入各节点的参数信息,The S4 information collection script is automatically executed to obtain the configuration document information, and call the expect tool to automatically input the parameter information of each node.
S5执行信息收集脚本将所有节点的文件信息拷贝到选取的节点下并按照序号命名。S5 executes the information collection script to copy the file information of all nodes to the selected node and name it according to the serial number.
在所述配置文档中节点的参数信息写成以下的格式:IP username password。The parameter information of the node in the configuration file is written in the following format: IP username password.
执行信息收集脚本时按照以下方式输入命令:./copy.sh配置文档路径节点目标文件路径/本地保存路径。Enter the command as follows when executing the information collection script: ./copy.sh configuration file path node target file path/local save path.
本发明与现有技术相比具有的有益效果是:The beneficial effect that the present invention has compared with prior art is:
利用本发明方法选取集群服务器的某一个节点,将各节点的参数信息保存在配置文档里,拷贝信息收集脚本到选取的节点下,执行信息收集脚本提取配置文档里的各节点的参数信息,并调用expect工具实现各节点的参数信息的自动输入,执行信息收集脚本将所有节点的文件信息拷贝到选取的节点下并按照序号命名;本方法进一步借用shell脚本和expect工具实现集群服务器的文件拷贝操作,可应用于所有linux系统的集群服务器产品,方便集群服务器的维护管理,大大简化了操作流程,特别是对于没有相关经验的人员,使用该方法可以轻松完成任务,用在集群服务器的管理维护时,节省时间提高效率。Utilize the method of the present invention to select a certain node of the cluster server, save the parameter information of each node in the configuration file, copy the information collection script to the selected node, execute the information collection script to extract the parameter information of each node in the configuration file, and Call the expect tool to automatically input the parameter information of each node, execute the information collection script to copy the file information of all nodes to the selected node and name them according to the serial number; this method further uses the shell script and the expect tool to realize the file copy operation of the cluster server , can be applied to cluster server products of all linux systems, facilitates the maintenance and management of cluster servers, and greatly simplifies the operation process, especially for personnel without relevant experience, this method can easily complete the task, and is used in the management and maintenance of cluster servers , save time and improve efficiency.
附图说明Description of drawings
图1本发明方法的流程示意图。Fig. 1 is a schematic flow chart of the method of the present invention.
具体实施方式detailed description
本发明提供一种集群服务器信息收集方法:选取集群服务器的某一个节点,将各节点的参数信息保存在配置文档里,拷贝信息收集脚本到选取的节点下,执行信息收集脚本提取配置文档里的各节点的参数信息,并调用expect工具实现各节点的参数信息的自动输入,执行信息收集脚本将所有节点的文件信息拷贝到选取的节点下并按照序号命名。The present invention provides a cluster server information collection method: select a certain node of the cluster server, save the parameter information of each node in the configuration file, copy the information collection script to the selected node, execute the information collection script to extract the configuration file The parameter information of each node, and call the expect tool to realize the automatic input of the parameter information of each node, execute the information collection script to copy the file information of all nodes to the selected node and name it according to the serial number.
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,对本发明进一步详细说明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with specific examples.
以某一集群服务器为例,选取其中一台服务器作为拷贝文件信息的节点,将各节点的节点ip地址、用户名和密码、待拷贝的文件名等参数信息保存在配置文档里;Take a cluster server as an example, select one of the servers as the node for copying file information, and save the parameter information such as node ip address, user name and password, and file name to be copied in the configuration file of each node;
拷贝shell脚本到选取的节点下,执行shell脚本提取配置文档里的各节点的参数信息,并调用expect工具实现各节点的ip地址、用户名和密码的自动输入,执行shell脚本中scp命令,远程操作将所有节点的文件信息拷贝到选取的节点下并按照序号命名。Copy the shell script to the selected node, execute the shell script to extract the parameter information of each node in the configuration file, and call the expect tool to realize the automatic input of the ip address, user name and password of each node, and execute the scp command in the shell script for remote operation Copy the file information of all nodes to the selected node and name it according to the serial number.
具体操作步骤为:The specific operation steps are:
S1选取集群服务器的某一个节点,S1 selects a node of the cluster server,
S2编辑配置文档configure.list,将各节点的ip地址、用户名和密码、待拷贝的文件名等参数信息保存在配置文档里;其中参数信息写成以下的格式:IP usernamepassword,中间用空格或tab键来分隔,多台主机的信息需要写多行内容,如:S2 Edit the configuration file configure.list, save the parameter information such as the ip address of each node, user name and password, and the file name to be copied in the configuration file; wherein the parameter information is written in the following format: IP usernamepassword, with spaces or tab keys in the middle To separate, the information of multiple hosts needs to write multiple lines, such as:
192.168.0.10root 12345678192.168.0.10root 12345678
192.168.0.20user passw0rd192.168.0.20user passw0rd
S3拷贝shell脚本到选取的节点下,S3 copies the shell script to the selected node,
S4shell脚本自动执行,获取配置文档信息,并调用expect工具自动输入各节点的参数信息,The S4shell script is automatically executed to obtain the configuration document information, and call the expect tool to automatically input the parameter information of each node.
执行时按照以下方式输入命令:./copy.sh/配置文档路径/节点目标文件路径/本地保存路径,例如:./copy.sh./configure.list/var/log/messages/tmpEnter the command in the following way during execution: ./copy.sh/configuration document path/node target file path/local save path, for example: ./copy.sh./configure.list/var/log/messages/tmp
S5执行shell脚本将所有节点的文件信息拷贝到选取的节点下并按照序号命名。S5 executes the shell script to copy the file information of all nodes to the selected node and names them according to the serial number.
上述过程的脚本部分代码如下:The code of the script part of the above process is as follows:
执行脚本:Execute the script:
expect脚本,用来执行用户名、密码的自动输入如下:The expect script is used to execute the automatic input of user name and password as follows:
使用本方法利用shell脚本和expect工具实现集群服务器的文件拷贝操作,可应用于所有linux系统的集群服务器产品,方便集群服务器的维护管理,大大简化了操作流程,特别是对于没有相关经验的人员,使用该方法可以轻松完成任务,用在集群服务器的管理维护时,节省时间提高效率。Use this method to use shell script and expect tool to realize the file copy operation of the cluster server, which can be applied to the cluster server products of all linux systems, facilitates the maintenance and management of the cluster server, and greatly simplifies the operation process, especially for those who have no relevant experience. Using this method can easily complete tasks, and when used in the management and maintenance of cluster servers, it saves time and improves efficiency.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710024824.6A CN106815132A (en) | 2017-01-13 | 2017-01-13 | A kind of cluster server formation gathering method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710024824.6A CN106815132A (en) | 2017-01-13 | 2017-01-13 | A kind of cluster server formation gathering method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106815132A true CN106815132A (en) | 2017-06-09 |
Family
ID=59110831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710024824.6A Pending CN106815132A (en) | 2017-01-13 | 2017-01-13 | A kind of cluster server formation gathering method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106815132A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760650A (en) * | 2021-07-28 | 2021-12-07 | 北京思特奇信息技术股份有限公司 | Method and system for uniformly pre-burying and collecting service logs of distributed system |
CN114064063A (en) * | 2020-07-30 | 2022-02-18 | 中移(苏州)软件技术有限公司 | Information collection method, device, equipment and computer readable storage medium |
CN116346484A (en) * | 2023-04-03 | 2023-06-27 | 上海中通吉网络技术有限公司 | Linux system login method, device and equipment |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6335927B1 (en) * | 1996-11-18 | 2002-01-01 | Mci Communications Corporation | System and method for providing requested quality of service in a hybrid network |
CN1848787A (en) * | 2006-04-30 | 2006-10-18 | 西安交通大学 | An automated rapid deployment method for cluster server system nodes |
CN105487943A (en) * | 2015-12-09 | 2016-04-13 | 浪潮电子信息产业股份有限公司 | Method for automatically copying files to each node of cluster server |
-
2017
- 2017-01-13 CN CN201710024824.6A patent/CN106815132A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6335927B1 (en) * | 1996-11-18 | 2002-01-01 | Mci Communications Corporation | System and method for providing requested quality of service in a hybrid network |
CN1848787A (en) * | 2006-04-30 | 2006-10-18 | 西安交通大学 | An automated rapid deployment method for cluster server system nodes |
CN105487943A (en) * | 2015-12-09 | 2016-04-13 | 浪潮电子信息产业股份有限公司 | Method for automatically copying files to each node of cluster server |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114064063A (en) * | 2020-07-30 | 2022-02-18 | 中移(苏州)软件技术有限公司 | Information collection method, device, equipment and computer readable storage medium |
CN113760650A (en) * | 2021-07-28 | 2021-12-07 | 北京思特奇信息技术股份有限公司 | Method and system for uniformly pre-burying and collecting service logs of distributed system |
CN116346484A (en) * | 2023-04-03 | 2023-06-27 | 上海中通吉网络技术有限公司 | Linux system login method, device and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110928772B (en) | A test method and device | |
CN103092650B (en) | Method and system is generated based on the virtual machine image of software pre-installation under cloud environment | |
CN108647883B (en) | Business approval method, device, equipment and medium | |
WO2018036342A1 (en) | Csar-based template design visualization method and device | |
CN108268377A (en) | A kind of service test method of server, device and medium | |
CN105094851A (en) | Method for realizing code release at any time based on Git | |
CN110888818A (en) | Test case configuration system and method, automatic test system and method | |
CN108845940A (en) | A kind of enterprise information system automated function test method and system | |
CN104375934B (en) | Method for testing reliability of Android mobile phone software | |
CN103631590A (en) | Method for editing automated testing script | |
JP7477572B2 (en) | AUTOMATED CONTROL OF DISTRIBUTED COMPUTING DEVICES - Patent application | |
CN105487943A (en) | Method for automatically copying files to each node of cluster server | |
CN105320589A (en) | Automatic analysis system for testing scripts in cloud testing environments and realization method thereof | |
CN106815132A (en) | A kind of cluster server formation gathering method | |
US11256608B2 (en) | Generating test plans for testing computer products based on product usage data | |
CN102609472A (en) | Method and system for implementing performance test of distributed database system | |
CN104268083A (en) | Software automatic testing method and device | |
CN111240968A (en) | A kind of automatic test management method and system | |
CN114048188A (en) | A system and method for data migration across databases | |
CN104965741A (en) | Method and apparatus for installing real-time application clusters | |
CN105630634B (en) | Application system calamity is for switching method and apparatus | |
CN114372259B (en) | Method and system for marking object tags and generating security policies in operating system | |
CN107622131A (en) | A file collection method, device and system | |
CN111208993B (en) | Flow data analysis processing system | |
CN116185826A (en) | Test method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170609 |
|
RJ01 | Rejection of invention patent application after publication |