Summary of the invention
The object of the present invention is to provide a kind of login method of multi-node cluster, device, equipment and computer-readable deposit
Storage media, to solve to need in the prior art to step on each node of cluster server by the support realization of domain control server
The problem of record causes hardware cost to waste.
In order to solve the above technical problems, the present invention provides a kind of login method of multi-node cluster, comprising: be utilized respectively collection
The user agent and user group agent in group resource management library create the user resources and user group in cluster resource management library
Resource;The constraint condition that the user resources depend on the user group resource is set;According to the constraint condition, collecting respectively
Identical user group and user are created in each node of group, in order to realize by same user to each section in the cluster
The login of point.
Preferably, described according to the constraint condition, created in each node of cluster respectively identical user group and
User includes:
Using the monitoring order of the user group agent, the user group monitored on each node of the cluster respectively is
It is no to change;
When monitoring that the user group in the cluster on first node changes, then utilize the user group agent's
More newer command updates the user group on the first node.
Preferably, described when monitoring that the user group in the cluster on first node changes, then utilize the use
The user group that the more newer command of family group agent updates on the first node includes:
When monitoring that the user group in the cluster on first node changes, in cluster starting, utilize
The user group agent executes more newer command;
By in the user group resource information and local file in save the user group on the first node and compare
Compared with;
The user group that will exist in the user group resource and be not present in the local file, is added to the first segment
Point in;
It deletes on the first node, is present in the local file use that may be not present with the user group resource
Family group.
Preferably, described according to the constraint condition, created in each node of cluster respectively identical user group and
User includes:
Using the monitoring order of the user agent, monitor whether the user on each node of the cluster sends out respectively
Changing;
When monitoring that the user in the cluster on second node changes, then the update of the user agent is utilized
Order updates the user on the second node.
Preferably, described when monitoring that the user in the cluster on second node changes, then utilize the user
The user that the more newer command of agent updates on the second node includes:
When monitoring that the user in the cluster on second node changes, in cluster starting, institute is utilized
It states user agent and executes more newer command;
By in the user resources information and local file in save the user on the second node and be compared;
The user that will exist in the user resources and be not present in the local file, is added to the first node
In;
It deletes on the second node, being present in the local file may be not present and the use in the user resources
Family.
The present invention also provides a kind of entering devices of multi-node cluster, comprising:
Creation module, user agent and user group agent for being utilized respectively cluster resource management library create the collection
The user resources and user group resource in group resource management library;
Setup module depends on the constraint condition of the user group resource for the user resources to be arranged;
Login module, for creating identical user group in each node of cluster respectively according to the constraint condition
And user, in order to realize the login to each node in the cluster by same user.
Preferably, the login module is specifically used for:
Using the monitoring order of the user group agent, the user group monitored on each node of the cluster respectively is
It is no to change;
When monitoring that the user group in the cluster on first node changes, then utilize the user group agent's
More newer command updates the user group on the first node.
Preferably, described when monitoring that the user group in the cluster on first node changes, then utilize the use
The user group that the more newer command of family group agent updates on the first node includes:
When monitoring that the user group in the cluster on first node changes, in cluster starting, utilize
The user group agent executes more newer command;
By in the user group resource information and local file in save the user group on the first node and compare
Compared with;
The user group that will exist in the user group resource and be not present in the local file, is added to the first segment
Point in;
It deletes on the first node, is present in the local file use that may be not present with the user group resource
Family group.
The present invention also provides a kind of logging devices of multi-node cluster, comprising:
Memory, for storing computer program;Processor realizes above-mentioned one kind when for executing the computer program
The step of login method of multi-node cluster.
The present invention also provides a kind of computer readable storage medium, meter is stored on the computer readable storage medium
The step of calculation machine program, the computer program realizes a kind of login method of above-mentioned multi-node cluster when being executed by processor.
The login method of multi-node cluster provided by the present invention is created using the user agent in cluster resource management library
The user resources in cluster resource management library create the more piece point set using the user group agent that the cluster logs in library
The user group resource of group.And the constraint condition that the user resources depend on the user group resource is set.According to the constraint
Condition creates identical user group and user in each node of multi-node cluster server respectively, logical so as to realize
Same user is crossed to log in each node in the cluster.The present invention manages the user agent in library using cluster resource
The user resources and user group resource in cluster resource management library are created with user group agent, thus convenient in the cluster
Each node in create identical user group and user.In the case where being added without domain to each node in the cluster
The login that each node in the cluster is realized by same user, has saved hardware cost.And it is not required in the present invention
Identical user group and user are created in each node of the cluster manually, simplify the operation of clustered node login, mention
High login efficiency.Correspondingly, a kind of entering device of multi-node cluster provided by the present invention, equipment and computer-readable
Storage medium has above-mentioned beneficial effect.
Specific embodiment
Core of the invention is to provide a kind of multi-node cluster login method, device, equipment and computer-readable storage
Medium is managed the user agent and user group agent in library by addition cluster resource, passes through wound in each node of cluster
Identical user group and user are built, each node of cluster is stepped on to be realized in the case where clustered node does not need to be added domain
Record.
In order to enable those skilled in the art to better understand the solution of the present invention, with reference to the accompanying drawings and detailed description
The present invention is described in further detail.Obviously, described embodiments are only a part of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Referring to FIG. 1, Fig. 1 is the first specific embodiment of the login method of multi-node cluster provided by the present invention
Flow chart;Specific steps are as follows:
Step S101: the user agent and user group agent for being utilized respectively cluster resource management library create the cluster money
The user resources and user group resource in source control library;
Using the user agent and user group agent of cluster resource management library Pacemaker, the use of Pacemaker is created
Family resource and user group resource.
Step S102: the constraint condition that the user resources depend on the user group resource is set;
Due to needing designated user's group when adding user in the node of the cluster, it is therefore desirable to when guaranteeing addition user
Specified user group has existed, and setting user resources is needed to depend on the constraint condition of user group resource thus;I.e. first starting is used
Family group resource, restarts user resources.
Step S103: according to the constraint condition, identical user group and use are created in each node of cluster respectively
Family, in order to realize the login to each node in the cluster by same user.
By the synchronization of resource, according to constraint condition, identical user is created in each node of the cluster respectively
Group and user, to realize that the same user can log in all nodes in the cluster, will not be in the cluster
The case where node addition domain, is write, by having saved cluster with the login realized with a user to all nodes in the cluster
The hardware cost of system.
Based on the above embodiments, in the present embodiment, by taking user group as an example, the user group of Pacemaker will be utilized
After the user group source synchronous to each node of the cluster of agent creation, the monitoring order of the user group agent is utilized
Whether the user group resource monitored on each node respectively changes.If monitoring, the user group resource of a certain node becomes
Change, then updates the user group resource on the node using the more newer command of the user group agent.Referring to FIG. 2, Fig. 2 is this
The flow chart of second of specific embodiment of the login method of multi-node cluster provided by inventing;Specific steps are as follows:
Step S201: the user agent and user group agent for being utilized respectively Pacemaker create the cluster resource pipe
Manage the user resources and user group resource in library;
Step S202: the constraint condition that the user resources depend on the user group resource is set;
Step S203: according to the constraint condition, identical user group and use are created in each node of cluster respectively
Family;
Step S204: by the information preservation of the user group agent of the Pacemaker user group resource created to local
In file;
Step S205: it using the monitoring order of the user group agent, is monitored on each node of the cluster respectively
Whether user group changes;
Monitor the user group on each node of the cluster respectively using the Monitor order of the user group agent
Whether change.
Step S206: it when monitoring that the user group in the cluster on first node changes, is opened in the cluster
When dynamic, more newer command is executed using the user group agent;
The user group on the first node is updated using the Update order of the user group agent.
Step S207: by the user group resource information and local file in save user on the first node
Group is compared;
Step S208: the user group that will exist in the user group resource and be not present in the local file is added to
In the first node;
Step S209: deleting on the first node, and being present in the local file may be not present and the user group
User group in resource, in order to create identical user group resource in each node of the cluster, thus using local
The mode of certification logs in each node of the cluster.
Based on the above embodiment, it in other embodiments provided by the present invention, is created in each node of cluster respectively
After building identical user group and user, it can use the monitoring order of the user agent, monitor each of the cluster respectively
Whether the user on node changes;When monitoring that the user in the cluster on second node changes, then institute is utilized
The more newer command for stating user agent updates user on the second node.When adding or deleting user, user resources are updated,
After monitoring in user agent detects that user resources information is inconsistent on some node in the cluster, execution is described more
New operation, updates the user resources on the node, so that making to create on all nodes in the cluster has identical user
Resource realizes the login realized by a user to all nodes in the cluster.The present embodiment is saving cluster login
The hardware cost of system;The operation for simplifying clustered node login, improves login efficiency.
Referring to FIG. 3, Fig. 3 is a kind of structural block diagram of the entering device of multi-node cluster provided in an embodiment of the present invention;
Specific device may include:
Creation module 100, user agent and user group agent for being utilized respectively cluster resource management library create institute
State the user resources and user group resource in cluster resource management library;
Setup module 200 depends on the constraint condition of the user group resource for the user resources to be arranged;
Login module 300, for creating identical user in each node of cluster respectively according to the constraint condition
Group and user, in order to realize the login to each node in the cluster by same user.
The entering device of the multi-node cluster of the present embodiment for realizing multi-node cluster above-mentioned login method, therefore
The embodiment of the login method of the visible multi-node cluster hereinbefore of specific embodiment in the entering device of multi-node cluster
Part, for example, creation module 100, setup module 200, login module 300, are respectively used to realize stepping on for above-mentioned multi-node cluster
Step S101, S102 and S103 in recording method, so, specific embodiment is referred to corresponding various pieces embodiment
Description, details are not described herein.
The specific embodiment of the invention additionally provides a kind of logging device of multi-node cluster, comprising: memory, for storing
Computer program;Processor realizes a kind of login method of above-mentioned multi-node cluster when for executing the computer program
Step.
The specific embodiment of the invention additionally provides a kind of computer readable storage medium, the computer readable storage medium
On be stored with computer program, the computer program realizes a kind of login side of above-mentioned multi-node cluster when being executed by processor
The step of method.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with it is other
The difference of embodiment, same or similar part may refer to each other between each embodiment.For being filled disclosed in embodiment
For setting, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part
Explanation.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
Above to the login method of multi-node cluster provided by the present invention, device, equipment and computer-readable storage
Medium is described in detail.It is used herein that a specific example illustrates the principle and implementation of the invention, with
The explanation of upper embodiment is merely used to help understand method and its core concept of the invention.It should be pointed out that being led for this technology
For the those of ordinary skill in domain, without departing from the principle of the present invention, can also to the present invention carry out it is several improvement and
Modification, these improvements and modifications also fall within the scope of protection of the claims of the present invention.