A kind of quickly configuration method of distributed system
Technical field
The present invention relates to distributed computing technology field, refer to a kind of quickly configuration method of distributed system especially.
Background technology
A distributed system is made up of different node multiple on network usually, and the service difference to some extent that each node is installed, therefore, distributed system installation also needs to experience loaded down with trivial details layoutprocedure later, after general distributed system installation, or when needing to adjust the configuration of certain or certain several node, all need manually to complete following configuration step:
1, use KVM or directly operate to node, after logging in one by one, carrying out network configuration, after network configuration success, concentrating and use ssh client or RDP client logs to node;
2, according to the assembly installed, existing service is stopped one by one;
3, the configuration of original assembly is emptied;
4, for arrangement of components item is adjusted to new value;
5, for arrangement of components in need serves starting up.
There is following drawback in said method:
1, depend on manual configuration, and the configuration of each assembly is nearly all repeated labor, allocative efficiency is low, and when system scale is larger, the time that this mode expends is long, depends on human configuration simultaneously and easily makes mistakes, and mistake is also not easy investigation;
2, the reusability of arrangement of components is low, and often newly increasing an assembly all needs to upgrade the configuration instruction of assembly, gives training attendant, lacks the configuration mode that can fixedly follow.
Summary of the invention
The technical problem that the present invention solves is the quickly configuration method providing distributed system; Solve and too rely on manual configuration at present, consuming time long, allocative efficiency is low, easily makes mistakes, and the problem that arrangement of components reusability is low.
The technical scheme that the present invention solves the problems of the technologies described above is:
Described method clears up module and component configuration module realization by Configuration Control Unit, Network conf iotag. module, configuration; After system configuration starts, Configuration Control Unit starts, and the configuration informations such as the network information of computing node of reading user input and the configuration item of node type information and node, generate configured list; Then controller is by calling configuration cleaning module, the configuration of original assembly is environmentally all emptied, carries out initialization to environment; Then Configuration Control Unit is according to network control message, starts network control module, carries out network configuration and startup; Configuration Control Unit receives after network configuration successfully feeds back, and controller is configured by component configuration module, feedback configuration information after configuration successful.
By the original arrangement of components of configuration cleaning module check, if originally there is assembly, first stop the service of original assembly, the configuration of original assembly is all emptied simultaneously; Then the result of process is returned to configuration manager.
The order of described Network conf iotag. module executive operating system this locality completes the configuration of host name, IP address, DNS and network type; Then the result of process is returned to configuration manager.
Described component configuration module comprises component profile module, assembly option configuration module and Component service configuration module; Wherein assembly option configuration module coupling unit profile module, module configuration information complete the configuration of all config options; Component service configuration module is responsible for the service registry of Component service, initialization, daily record are redirected.
The arrangement of components list information of described generation comprises Joint Enterprise type, nodename, node i p information, shares storage information, node virtual type, node virtual machine remote access style and node storage class.
Described configuration cleaning module needs the information of cleaning to comprise the relevant service of node, the relevant configuration of node, the data of backup node, timed task and domain name.
The assembly option configuration module of described component configuration module comprises management node and realization end and the service end full lectotype at same node, and the management end pattern of management end and service end, realizes the realization end pattern of end and service end.
The beneficial effect of the present invention program is as follows:
1, the configurator that the inventive method realizes only needs the disposable configuration information importing network and assembly into before configuration, then can, when without any the configuration completing a complicated distributed system when artificial the intervention, be just a kind of Configuration Framework of automation;
2, method of the present invention has very high durability, and the configuration that distributed system newly increases module only needs a small amount of exploitation namely can support the configuration of automation, and the person that can reduce Development of Distributed System is in the workload of system configuration aspect developing.
Accompanying drawing explanation
Below in conjunction with accompanying drawing, the present invention is further described:
Fig. 1 is the flow chart of the inventive method.
Embodiment
As shown in the figure, the inventive method realizes in accordance with the following steps.
(1) information that the node that Configuration Control Unit reads user's input configures about network, assembly etc., formation component configured list, the present invention uses shell script to describe:
Controller passes through implementation controller script config.sh, such as following example:
./config.sh?all?gcloud44150?20.251.44.150?255.255.255.0?20.251.44.254?8.8.8.820.251.44.150?300?20.251.44.150?20.251.44.150?kvm?vnc?qcow2?SYSTEM″
By Parameter transfer to controller, and generate configured list.
export?GCLOUD_NODETYPE=$1
export?GCLOUD_HOSTNAME=$2
export?GCLOUD_IPADDR=$3
export?GCLOUD_NETMASK=$4
export?GCLOUD_GATEWAY=$5
export?GCLOUD_DNS1=$6
export?GCLOUD_NFSIP=$7
export?GCLOUD_LVSIZE=$8
export?GCLOUD_MGIP=$9
export?GCLOUD_NODEIP=${10}
#set?kvm?or?xen,default?is?kvm
export?GCLOUD_HYPERVISOR=${11}
#set?vnc?or?spice,default?is?vnc
export?REMOTE_TYPE=${12}
#set?lvm?or?qcow2,default?is?lvm
export?VOL_TYPE=${13}
#set?SYSTEM?or?SYSTEM-VLAN,default?is?SYSTEM
export?GCLOUD_NETTYPE=${14}
Execfile=config-after-install_standard # controller catalogue
Execfiledir=/root/config-after-install_standard # location of controls
execfiledir_sh=/root/config-after-install_standard/sh
Argesfile=$ { execfiledir}/getarges.txt # configuration list list
#argesfile=/backup/config-after-install_standard/getarges.txt
echo″″>$argesfile
echo″gcloud_nodetype=$GCLOUD_NODETYPE″>>$argesfile
echo″GCLOUD_HOSTNAME=$GCLOUD_HOSTNAME″>>$argesfile
echo″GCLOUD_IPADDR=$GCLOUD_IPADDR″>>$argesfile
echo″GCLOUD_NETMASK=$GCLOUD_NETMASK″>>$argesfile
echo″GCLOUD_GATEWAY=$GCLOUD_GATEWAY″>>$argesfile
echo″GCLOUD_DNS1=$GCLOUD_DNS1″>>$argesfile
echo″GCLOUD_NFSIP=$GCLOUD_NFSIP″>>$argesfile
echo″GCLOUD_LVSIZE=$GCLOUD_LVSIZE″>>$argesfile
echo″GCLOUD_MGIP=$GCLOUD_MGIP″>>$argesfile
echo″GCLOUD_NODEIP=$GCLOUD_NODEIP″>>$argesfile
echo″GCLOUD_HYPERVISOR=$GCLOUD_HYPERVISOR″>>$argesfile
echo″REMOTE_TYPE=$REMOTE_TYPE″>>$argesfile
echo″VOL_TYPE=$VOL_TYPE″>>$argesfile
echo″GCLOUD_NETTYPE=$GCLOUD_NETTYPE″>>$argesfile
else
echo″you?should?install${execfile}first″
exit${RETVAL}
fi
(2) call configuration cleaning module, if originally there is assembly, first stop the service of original assembly, the configuration of original assembly is all emptied simultaneously, and clear up shared storage, the data of backup node, cleaning timed task and domain name; Then the result of process is returned to configuration manager:
Configuration cleaning block code is as follows:
(3) controller plc calls network control module, carries out the configuration of the basic network of node, and the information wherein configured comprises: the title of node server; Network ip address; Detection intranet and extranet communicate.
Network control module is that gcloud-base.sh block code content is as follows:
(4) configuration manager is according to the module configuration information read, invocation component configuration module completes the configuration of assembly in list, component configuration module is divided three classes, executive module configuration file configuration simultaneously in the middle of three classes, and sets up service configuration and the configuration of assembly timed task:
Component configuration module code is as follows:
Type one: configuration management end, realize end, service end is at same node
Type two: management end is at a node
Type three: realize end separately at a node
(5) all configurations are completed, and feedback configuration information.
Produced problem is checked by the journal file exported, and the configuration information of feedback.