CN106909456A - A kind of information acquisition method and device - Google Patents

A kind of information acquisition method and device Download PDF

Info

Publication number
CN106909456A
CN106909456A CN201510975345.3A CN201510975345A CN106909456A CN 106909456 A CN106909456 A CN 106909456A CN 201510975345 A CN201510975345 A CN 201510975345A CN 106909456 A CN106909456 A CN 106909456A
Authority
CN
China
Prior art keywords
configuration information
zookeeper
server
process configuration
lock
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
Application number
CN201510975345.3A
Other languages
Chinese (zh)
Inventor
冯所范
王超
朱超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510975345.3A priority Critical patent/CN106909456A/en
Publication of CN106909456A publication Critical patent/CN106909456A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Abstract

The invention discloses a kind of information acquisition method and device, the mode for solving to obtain in the prior art process configuration information brings larger load, has a strong impact on the problem of the process performance of zookeeper to zookeeper.The method includes:Each process that service is provided on server robs lock, and lock is the lock between default process;Rob the successful process of lock and set up long connection with the zookeeper, the shared drive of the server is monitored by the connection long set up, when the process configuration information in the process configuration information in monitoring shared drive with the zookeeper is inconsistent, obtain the process configuration information in the zookeeper, and be updated in the shared drive, so that the process for robbing lock failure obtains process configuration information according to the shared drive.

Description

A kind of information acquisition method and device
Technical field
The present invention relates to internet arena, more particularly to a kind of information acquisition method and device.
Background technology
As the application on internet is using popularizing, the number of users of application is also greatly increased, single server It is remote not enough for large-scale user provides service, therefore, for any application on internet, generally can be with Using distributed system, service is provided together using multiple servers.
Specifically, can have multiple processes for providing service, the process of each server on each server What configuration information was generally just as, when needing to update certain process configuration information, it is necessary to manually to each The process configuration information in server is all updated.
At present, generally using zookeeper to multiple servers in all process configuration informations concentrate Management.Zookeeper is a reliable coordination system for large-scale distributed system, there is provided function bag Include:Configuring maintenance, name Service, distributed synchronization, group service etc..
In the prior art, each process sets up a connection long with zookeeper respectively in each server, Each process monitors the process configuration information of itself by calling the interface of zookeeper, once find Process configuration information on zookeeper updates compared to the process configuration information of itself, then process can To get the process configuration information after updating from zookeeper, to the process configuration information of itself correspondingly It is updated, and then the process configuration information operation after updating can be based on.Based on such scheme, when need When updating certain process configuration information, it is only necessary to update on zookeeper corresponding process configuration information i.e. Can.
But, due to being typically many server common services in actual applications, each server is usual Many processes that service is provided of operation, such as:If there is 100 servers to provide service together, each clothes When running 128 processes on business device, each process in each server sets up one with zookeeper Connection long, needs to set up 12800 connections long altogether, for obtaining process configuration information from zookeeper. As can be seen here, the mode of this acquisition process configuration information brings larger load to zookeeper, seriously Influence the process performance of zookeeper.
The content of the invention
In view of the above problems, it is proposed that the present invention overcomes above mentioned problem or at least in part to provide one kind The information acquisition method and device for solving the above problems.
According to an aspect of the present invention, a kind of information acquisition method, server and zookeeper phases are proposed Connect, there are multiple processes that service is provided on the server, there is process to configure in the zookeeper Information, methods described includes:
Each process robs lock, and the lock is the lock between default process;
Rob the successful process of lock to be connected with zookeeper foundation length, by the connection long of foundation to described The shared drive of server is monitored, the process configuration information in shared drive is monitored with it is described When process configuration information in zookeeper is inconsistent, the process configuration information in the zookeeper is obtained, And be updated in the shared drive, so that the process for robbing lock failure obtains process and matches somebody with somebody according to the shared drive Confidence ceases;
Wherein, the shared drive is shared by each process that service is provided on the server.
Alternatively, set up length with the zookeeper to be connected, specifically include:
Start an asynchronous thread;
By the asynchronous thread for starting, set up length with the zookeeper and be connected.
Alternatively, after being updated in the shared drive, methods described also includes:
Local disk of the process configuration information update in the zookeeper to the server will be obtained In.
Alternatively, configuration information is obtained according to the shared drive, is specifically included:
Judge whether there is process configuration information in the shared drive;
If so, then obtaining the process configuration information in the shared drive;
Otherwise, the local disk according to the server obtains process configuration information.
Alternatively, the local disk according to the server obtains process configuration information, specifically includes:
Judge whether there is process configuration information in the local disk of the server;
If so, then obtaining the process configuration information in the local disk;
Otherwise, short connection is set up with the zookeeper, by the short connection set up, obtains zookeeper In process configuration information, and the short connection is closed after process configuration information is got.
Alternatively, it is described after obtaining the process configuration information in zookeeper by the short connection set up Method also includes:
In process configuration information update to the shared drive and the local disk that will be obtained.
Alternatively, each process of service is provided on the server according to the process configuration information operation for obtaining.
According to another aspect of the present invention, a kind of information acquisition device, server and zookeeper are proposed It is connected with each other, there are multiple processes that service is provided on the server, has process to match somebody with somebody in the zookeeper Confidence is ceased, and described device is located on the server, and described device includes:
Lock module is robbed, for making each process rob lock, the lock is the lock between default process;
Acquisition module, sets up length for making to rob the successful process of lock and is connected, by building with the zookeeper Vertical connection long is monitored to the shared drive of the server, the process in shared drive is monitored When process configuration information in configuration information and the zookeeper is inconsistent, the zookeeper is obtained In process configuration information, and be updated in the shared drive, so as to rob the process of lock failure according to Shared drive obtains process configuration information;
Wherein, the shared drive is shared by each process that service is provided on the server.
Alternatively, the acquisition module specifically for:Make to rob successful one asynchronous thread of process initiation of lock; By the asynchronous thread for starting, set up length with the zookeeper and be connected.
Alternatively, described device also includes:
First update module, for the process in the zookeeper that the successful process of lock will be obtained is robbed After in configuration information update to the shared drive, the process configuration information in the zookeeper will be obtained It is updated in the local disk of the server.
Alternatively, the acquisition module specifically for:The process for making to rob lock failure judges the shared drive Whether process configuration information is had;If so, then obtaining the process configuration information in the shared drive;Otherwise, Local disk according to the server obtains process configuration information.
Alternatively, the acquisition module specifically for:The process for robbing lock failure is set to judge the sheet of the server Whether process configuration information is had in local disk;If so, then obtaining the process configuration information in the local disk; Otherwise, short connection is set up with the zookeeper, by the short connection set up, in acquisition zookeeper Process configuration information, and the short connection is closed after process configuration information is got.
Alternatively, described device also includes:
Second update module, for making the process for robbing lock failure pass through the short connection set up, obtains zookeeper In process configuration information after, the process configuration information update that will be obtained to the shared drive and/or described In local disk.
Alternatively, described device also includes:
Operation module, for making each process that service is provided on the server match somebody with somebody confidence according to the process for obtaining Breath operation.
Scheme of the invention, each process that service is provided on server robs lock, between lock is default process Lock;Rob the successful process of lock to be connected with zookeeper foundation length, by the connection long of foundation to institute The shared drive for stating server is monitored, the process configuration information in shared drive is monitored with it is described When process configuration information in zookeeper is inconsistent, the process configuration information in the zookeeper is obtained, And be updated in the shared drive, so that the process for robbing lock failure obtains process and matches somebody with somebody according to the shared drive Confidence ceases;Wherein, the shared drive is shared by each process that service is provided on the server.Due to every Need to only there is a process to keep length to be connected with zookeeper on individual server, you can to cause on the server Each process for providing service can get newest process configuration information, therefore, it can effectively mitigate The load of zookeeper, and reduce the influence to the process performance of zookeeper.Moreover, due to The process for robbing lock failure is that newest process configuration information is obtained from shared drive, and shared drive is read and write Speed quickly, it is thus possible to improve process obtains the real-time of newest process configuration information.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are for ability Domain those of ordinary skill will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and simultaneously It is not considered as limitation of the present invention.And in whole accompanying drawing, identical is denoted by the same reference numerals Part.In the accompanying drawings:
Fig. 1 is the process according to the information acquisition method of one embodiment of the invention;
Fig. 2 is, based on a kind of practical application scene, to be built when each process obtains process configuration information in the prior art Vertical connection diagram long;
Fig. 3 is that, based on a kind of practical application scene, each process obtains process configuration information in the solution of the present invention The connection diagram long of Shi Jianli;
Fig. 4 is according to the information acquisition device structural representation of one embodiment of the invention.
Specific embodiment
Exemplary embodiment disclosed by the invention is more fully described below with reference to accompanying drawings.Although showing in accompanying drawing Exemplary embodiment disclosed by the invention is shown, it being understood, however, that may be realized in various forms the present invention Without that should be limited by embodiments set forth here.Conversely, there is provided these embodiments are able to more thorough Ground understand the present invention, and can by scope disclosed by the invention it is complete convey to those skilled in the art Member.
Below in conjunction with accompanying drawing, the technical scheme that various embodiments of the present invention are provided is described in detail.
Fig. 1 is the process according to the information acquisition method of the embodiment of the present invention, and the executive agent of the process can be with Server, more specifically, should during the step of can be on server process perform.The clothes Business device can be Web server, application server etc., and the process can specifically be to provide the process of service, By taking Web server as an example, its process for providing service can be fast page mode (fast page mode, fpm) Process etc..The present invention is not limited the type of server.
Server is connected with each other (connection herein refers to physical connection) with zookeeper, there is one on server Or multiple processes that service is provided, there is process configuration information in zookeeper, configured when renewal process is needed During information, can be updated by the process configuration information in zookeeper, realized on server The process configuration information of each process is automatically updated.It should be noted that with zookeeper be connected with each other Server can be with more than one, and each server can respectively perform the process in Fig. 1.Below in Fig. 1 Process illustrate.
Process in Fig. 1 may comprise steps of:
S101:Each process robs lock, and the lock is the lock between default process.
In the embodiment of the present invention, process may need related configuration information in the process of running, by these phases The configuration information of pass is referred to as process configuration information.When each process will obtain process configuration information, Ke Yikai Begin to perform step S101.
The lock is lock between process, including but not limited to file lock, System V signals amount lock, Read-Write Locks, Mutual exclusion lock etc..The lock may be used at most to have in each process a process to get specific operation to be weighed Limit, in embodiments of the present invention, specific operation authority can set up the authority that length is connected with zookeeper.
S202:Rob the successful process of lock to be connected with zookeeper foundation length, by the connection long set up Shared drive to the server is monitored, the process configuration information in shared drive is monitored with When process configuration information in the zookeeper is inconsistent, the process configuration in the zookeeper is obtained Information, and be updated in the shared drive, so that the process for robbing lock failure is obtained according to the shared drive Process configuration information;Wherein, the shared drive is shared by each process that service is provided on the server.
In embodiments of the present invention, server local can also preserve process configuration information, server local Process configuration information can be it is being pre-configured with by the keeper of server, or by process from What zookeeper was preserved again after obtaining.Process configuration information in zookeeper is that newest process matches somebody with somebody confidence Breath, when will to update process configuration information when, it is possible, firstly, to the process configuration information in zookeeper It is updated, then, for the process configuration information of server local, then can be according in zookeeper Process configuration information after renewal is correspondingly updated, so that, each server being connected with zookeeper Local process configuration information can realize synchronization.
Server local can specifically refer to the shared drive of server and/or the local disk of server.In shared The advantage deposited is fast read or write speed, is easy to rob each process quick obtaining process configuration information of lock failure, locally The advantage of disk can be power-off storage, and reliability is higher.As can be seen here, in order to improve acquisition configuration information Real-time, can preferentially in shared drive preserve and update process configuration information.
In actual applications, if not having process configuration information when initial in shared drive, lock is robbed successful Process can immediately obtain the process configuration information in zookeeper after long connection is set up with zookeeper, And preserve to shared drive, hereafter, process configuration information and zookeeper in shared drive is monitored In process configuration information it is inconsistent when, it is believed that the process configuration information in zookeeper there occurs more Newly (the process configuration information in zookeeper is always newest process configuration information), and then, can obtain The process configuration information in zookeeper is taken, is correspondingly carried out with to the process configuration information in shared drive Update, it is thus possible to realize that shared drive is synchronous with the process configuration information in zookeeper.
In embodiments of the present invention, connection long is such communication connection:Can be continuous in the communication connection Multiple packets are sent, if temporarily sent without packets need, can be detected with transmission link and wrapped, with The communication connection is set to remain in that connection rather than disconnection.Relative with connection long is short connection, and short connection is Such communication connection:Multiple packets can be continuously transmitted in the communication connection, if temporarily without data When bag needs to send, then the communication connection is disconnected.
According to explanation above, due to robbing the successful process of lock during monitoring, it may be necessary to more than once Ground obtains newest process configuration information from zookeeper, therefore, rob the successful process of lock and zookeeper The connection of foundation can grow connection, successfully enter in order to rob lock by this within long period of time Journey is responsible for obtaining newest process configuration information from zookeeper.Certainly, in actual applications, more long A period of time in, it is also possible to the process in Fig. 1 is performed a plurality of times, in this case, robs lock successfully every time Process be likely to difference.
By the above method, connected due to need to only there is a process to keep long with zookeeper on each server Connect, you can to cause that each process that service is provided on the server can get newest process with confidence Breath, and to be kept with zookeeper respectively without each process on each server as prior art One connection long, therefore, it can effectively mitigate the load of zookeeper, and reduce to zookeeper Process performance influence.
In order to make it easy to understand, further being illustrated to the step in Fig. 1 below.
For step S102, robbing the successful process of lock can start a thread, or start a process, so Afterwards by the thread for starting or the process, set up length with zookeeper and be connected.The advantage of former scheme It is to be started without extra process, smaller is born to server;The advantage of latter scheme is entering for new startup Journey and to rob the successful process of lock be separate, not shared resource, therefore, the new process for starting will not The efficiency that the successful process of lock provides service is robbed in influence, the new process for starting with rob the successful process of lock can phase The newest process configuration information that mutually transmission is obtained.In actual applications, selection can be needed more according to scene Suitable scheme.In inventive embodiments, it is specifically described mainly for former scheme.
According to one embodiment of the present of invention, when using above-mentioned former scheme, for step S102 Length is set up with the zookeeper to be connected, can specifically include:Start an asynchronous thread;By starting Asynchronous thread, with the zookeeper set up length be connected.Wherein, had the advantage that using asynchronous thread: Length is set up in the asynchronous thread with zookeeper to be connected and the follow-up mistake for monitoring and obtaining process configuration information Cheng Zhong, the asynchronous thread whenever send an operation requests, be not necessarily required to wait zookeeper response after, Corresponding operating or other operations could be performed, and can be during waiting zookeeper to respond, i.e., Other operations can be performed, it can be seen that, the operating efficiency of asynchronous thread is higher, and then is also beneficial to improve The execution efficiency of the solution of the present invention.
It should be noted that asynchronous thread is based only on one kind that thread realizes the implementation method of step S102 Example, step S102 can also be equally realized using synchronizing thread.
According to one embodiment of the present of invention, it has been mentioned hereinbefore that rob the successful process of lock from After zookeeper gets newest process configuration information, the process configuration information that will preferentially can be obtained is more It is new in the shared drive of server.Because compared to shared drive, the reliability of disk is higher can be powered off Storage, therefore, in order to further improve the reliability of the solution of the present invention, for step S102, rob lock After in process configuration information update to the shared drive of server that successful process will be obtained, can also carry out Following steps:Will obtain zookeeper in process configuration information update to the local disk of server in. Like this, the process configuration information in the process configuration information and shared drive in local disk can be each other Backup, reliability is higher.
Rob lock failure each process can be got from the local disk of server and/or shared drive it is newest Process configuration information, specifically, process configuration information preferentially can be obtained from shared drive, works as shared drive In the presence of it is abnormal (process configuration information is not preserved in shared drive such as, or, preserved process configuration letter Breath by by mistake delete, etc.) lead to not from shared drive obtain process configuration information when, then can according to this Local disk obtains process configuration information.
According to one embodiment of the present of invention, for step S102, each process of lock failure is robbed according to described common Enjoy internal memory and obtain configuration information, can include:For each process for robbing lock failure, the process may determine that Whether process configuration information is had in shared drive, if so, the process configuration information in shared drive is then obtained, Otherwise, the local disk according to server obtains process configuration information.
In actual applications, not only shared drive may occur exception, local disk it can also happen that exception, Such as, the data on local disk are by deletion etc. by mistake.When each process for robbing lock failure both cannot be from shared drive Acquisition process configuration information, when also cannot obtain process configuration information from local disk, then can be by robbing lock The part or all of process of failure directly from zookeeper servers or is robbed the successful process of lock and obtains process and match somebody with somebody Confidence ceases.
Continue to use upper one embodiment of the invention to go on to say, rob the process of lock failure according to the local of server Disk obtains process configuration information, can specifically include:The process for robbing lock failure judges this earth magnetism of server Whether process configuration information is had in disk;If so, then obtaining the process configuration information in local disk;Otherwise, Short connection is set up with zookeeper, by the short connection set up, the process obtained in zookeeper matches somebody with somebody confidence Breath, and the short connection is closed after process configuration information is got.
Due to set up the short process configuration information of getting that is connected to can immediately close off, i.e., it is short connection maintain when Between it is shorter, therefore, even if each process sets up a short connection with zookeeper, compared to prior art, The burden brought to zookeeper is smaller.
Further, if any process for robbing lock failure is got by the short connection set up from zookeeper Process configuration information, then the process configuration information update that the process will can get to shared drive and/or sheet In local disk.Like this, other processes for not yet getting process configuration information can be from server local Acquisition process configuration information, without obtaining process configuration information by way of short connection setting up again.
According to one embodiment of the present of invention, for each process that server is provided on server, process initiation Afterwards at any time in, whenever process get process configuration information (usually newest process match somebody with somebody confidence Breath), the process configuration information operation that the process can get according to this.
By the above method, the process of process configuration information, server local in zookeeper matches somebody with somebody confidence The process configuration information of breath and each process operation foundation can realize synchronization, and synchronous real-time is preferable.
According to one embodiment of the present of invention, in the implementation process of the solution of the present invention, may have simultaneously More than one process carries out the read-write operation for process configuration information to shared drive or local disk, in order to The situation for preventing these parallel read-write operations from process configuration information may be caused to malfunction, can be to this earth magnetism Process configuration information in disk and shared drive is also plus the lock (such as Read-Write Locks) between process so that same Moment, most only one of which processes (are occupied the process of the Read-Write Locks, can be the connections long by setting up The process of the process configuration information for getting, or the process got by the short connection set up are configured The process of information) write operation can be performed, and in the implementation procedure of write operation, do not allow other processes to hold Row read operation, occupy the Read-Write Locks process performed write operation after, the Read-Write Locks can be discharged.
Fig. 1 has been described in detail above.In order to make it easy to understand, the present invention is also based on a kind of practical application Scene, is contrasted, as shown in Figure 2 and Figure 3 to the solution of the present invention with the scheme of prior art.
The practical application scene is illustrated first.In the practical application scene, Web server (can be with Have one or more, one be shown in which in this embodiment) it is connected with each other with zookeeper, Web service There are multiple fpm processes on device, there is the process configuration information that fpm processes can be used on zookeeper.
Fig. 2 is that each fpm processes obtain the connection diagram long set up during process configuration information in the prior art.
In figure 2 it can be seen that each the fpm process on Web server is set up with zookeeper respectively One connection long, for obtaining newest process configuration information from zookeeper.Therefore, zookeeper A large amount of connections long, heavy load, influence treatment will be for a long time maintained between server and each Web server Performance.
Fig. 3 is the connection signal long set up when each fpm processes obtain process configuration information in the solution of the present invention Figure.
It is seen in figure 3 that only one of which fpm processes (are robbed in i.e. each fpm processes on Web server Lock successful fpm processes) establish connection long with zookeeper.During this is within the survival time of connection long, Can be responsible for obtaining newest process configuration information from zookeeper by fpm processes always, and will obtained Process configuration information update enters to the shared drive and local disk of Web server in order to other fpm Journey is obtained.When initial, process configuration information can be preserved in shared drive and local disk, it is also possible to not Preserve process configuration information.Obviously, in compared to the prior art in Fig. 2, the side of the invention in Fig. 3 Case each Web server only need to set up a connection long with zookeeper, effectively alleviate The burden of zookeeper, reduces the influence to the process performance of zookeeper.
It is above a kind of information acquisition method provided in an embodiment of the present invention, based on same invention thinking, this Inventive embodiments also provide a kind of information acquisition device, as shown in Figure 4.
Fig. 4 is the information acquisition device structural representation according to one embodiment of the invention, server with Zookeeper is connected with each other, and has multiple processes for providing service on server, has process to match somebody with somebody in zookeeper Confidence is ceased, and described device is located on server, and described device includes:
Lock module 401 is robbed, for making each process rob lock, the lock is the lock between default process;
Acquisition module 402, sets up length for making to rob the successful process of lock and be connected with the zookeeper, logical Cross the connection long set up to be monitored the shared drive of the server, in shared drive is monitored When process configuration information in process configuration information and the zookeeper is inconsistent, obtain described Process configuration information in zookeeper, and be updated in the shared drive, so as to rob entering for lock failure Journey obtains process configuration information according to the shared drive;
Wherein, the shared drive is shared by each process that service is provided on the server.
Alternatively, the acquisition module 402 specifically for:Make to rob successful one asynchronous line of process initiation of lock Journey;By the asynchronous thread for starting, set up length with the zookeeper and be connected.
Alternatively, described device also includes:
First update module 403, in the zookeeper that the successful process of lock will be obtained is robbed After in process configuration information update to the shared drive, the process configuration in the zookeeper will be obtained In information updating to the local disk of the server.
Alternatively, the acquisition module 402 specifically for:Judge the process for robbing lock failure described shared interior Whether process configuration information is had in depositing;If so, then obtaining the process configuration information in the shared drive;It is no Then, the local disk according to the server obtains process configuration information.
Alternatively, the acquisition module 402 specifically for:The process for robbing lock failure is set to judge the server Local disk in whether have process configuration information;If so, then obtaining the process configuration in the local disk Information;Otherwise, short connection is set up with the zookeeper, by the short connection set up, obtains zookeeper In process configuration information, and the short connection is closed after process configuration information is got.
Alternatively, described device also includes:
Second update module 404, for making the process for robbing lock failure pass through the short connection set up, obtains After process configuration information in zookeeper, the process configuration information update that will be obtained to the shared drive And/or in the local disk.
Alternatively, described device also includes:
Operation module 405, for making each process that service is provided on the server be matched somebody with somebody according to the process for obtaining Confidence breath operation.
Algorithm and display be not intrinsic with any certain computer, virtual system or miscellaneous equipment provided herein It is related.Various general-purpose systems can also be used together with based on teaching in this.As described above, structure It is obvious to make the structure required by this kind of system.Additionally, the present invention is not also directed to any certain programmed Language.It is understood that, it is possible to use various programming languages realize the content of invention described herein, and The description done to language-specific above is to disclose preferred forms of the invention.
In specification mentioned herein, numerous specific details are set forth.It is to be appreciated, however, that this hair Bright embodiment can be put into practice in the case of without these details.In some instances, not in detail Known method, structure and technology are shown, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one in each inventive aspect or Multiple, in above to the description of exemplary embodiment of the invention, each feature of the invention is sometimes by one Rise and be grouped into single embodiment, figure or descriptions thereof.However, should not be by the method for the disclosure It is construed to reflect following intention:I.e. the present invention for required protection requirement ratio institute in each claim is clear and definite The more features of feature of record.More precisely, as the following claims reflect, hair Bright aspect is all features less than single embodiment disclosed above.Therefore, it then follows specific embodiment Claims be thus expressly incorporated in the specific embodiment, wherein each claim conduct in itself Separate embodiments of the invention.
Those skilled in the art be appreciated that the module in the equipment in embodiment can be carried out it is adaptive Change to answering property and they are arranged in one or more equipment different from the embodiment.Can be reality Apply module or unit or component in example and be combined into a module or unit or component, and in addition can be it Be divided into multiple submodule or subelement or sub-component.Except in such feature and/or process or unit It is at least some exclude each other outside, can using any combinations to this specification (including adjoint right will Ask, make a summary and accompanying drawing) disclosed in all features and so disclosed any method or equipment it is all Process or unit are combined.Unless expressly stated otherwise, this specification (including adjoint claim, Summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer alternative features To replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other Some included features are rather than further feature, but the combination meaning of the feature of different embodiments in embodiment Taste and is within the scope of the present invention and is formed different embodiments.For example, in following claim In book, the one of any of embodiment required for protection mode can use in any combination.
All parts embodiment of the invention can realize with hardware, or with one or more processor The software module of upper operation is realized, or is realized with combinations thereof.It will be understood by those of skill in the art that Can be realized using microprocessor or digital signal processor (DSP) in practice according to of the invention real Apply some or all parts in the equipment of the implantation information in the interception application program of example some or Repertoire.The present invention is also implemented as performing some or all of method as described herein Equipment or program of device (for example, computer program and computer program product).It is such to realize this The program of invention can be stored on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, or be provided on carrier signal, or Person provides in any other form.
It should be noted that above-described embodiment the present invention will be described rather than limiting the invention, and And those skilled in the art can design replacement implementation without departing from the scope of the appended claims Example.In the claims, any reference symbol being located between bracket should not be configured to claim Limitation.Word "comprising" or " including " do not exclude the presence of element or step not listed in the claims. Word "a" or "an" before element does not exclude the presence of element as multiple.The present invention can To be realized by means of the hardware for including some different elements and by means of properly programmed computer. If in listing the unit claim of equipment for drying, several in these devices can be by same hard Part is embodied.The use of word first, second, and third does not indicate that any order.Can be by These words are construed to title.
Present invention could apply to computer system/server, it can be with numerous other universal or special calculating System environment or configuration are operated together.It is suitable to the well-known calculating being used together with computer system/server The example of system, environment and/or configuration is included but is not limited to:Personal computer system, server computer system System, thin client, thick client computer, hand-held or laptop devices, the system based on microprocessor, Set Top Box, Programmable consumer electronics, NetPC Network PC, little types Ji calculate machine Xi Tong ﹑ large computer systems and bag Include distributed cloud computing technology environment of any of the above described system, etc..
Computer system/server can be (all in the computer system executable instruction performed by computer system Such as program module) describe under linguistic context.Generally, program module can include routine, program, target Program, component, logic, data structure etc., they perform specific task or realize specific abstract Data type.Computer system/server can be implemented in distributed cloud computing environment, distributed cloud computing In environment, task is performed by the remote processing devices by communication network links.In distributed cloud computing In environment, program module may be located on the Local or Remote computing system storage medium including storage device.

Claims (10)

1. a kind of information acquisition method, it is characterised in that server is connected with each other with zookeeper, described There are multiple processes that service is provided on server, there is process configuration information, the side in the zookeeper Method includes:
Each process robs lock, and the lock is the lock between default process;
Rob the successful process of lock to be connected with zookeeper foundation length, by the connection long of foundation to described The shared drive of server is monitored, the process configuration information in shared drive is monitored with it is described When process configuration information in zookeeper is inconsistent, the process configuration information in the zookeeper is obtained, And be updated in the shared drive, so that the process for robbing lock failure obtains process and matches somebody with somebody according to the shared drive Confidence ceases;
Wherein, the shared drive is shared by each process that service is provided on the server.
2. method according to claim 1, it is characterised in that set up long company with the zookeeper Connect, specifically include:
Start an asynchronous thread;
By the asynchronous thread for starting, set up length with the zookeeper and be connected.
3. method according to claim 1, it is characterised in that after being updated in the shared drive, Methods described also includes:
Local disk of the process configuration information update in the zookeeper to the server will be obtained In.
4. method according to claim 1, it is characterised in that obtained according to the shared drive and matched somebody with somebody Confidence ceases, and specifically includes:
Judge whether there is process configuration information in the shared drive;
If so, then obtaining the process configuration information in the shared drive;
Otherwise, the local disk according to the server obtains process configuration information.
5. method according to claim 4, it is characterised in that according to this earth magnetism of the server Examine and seize and take process configuration information, specifically include:
Judge whether there is process configuration information in the local disk of the server;
If so, then obtaining the process configuration information in the local disk;
Otherwise, short connection is set up with the zookeeper, by the short connection set up, obtains zookeeper In process configuration information, and the short connection is closed after process configuration information is got.
6. method according to claim 5, it is characterised in that by the short connection set up, obtains After process configuration information in zookeeper, methods described also includes:
In process configuration information update to the shared drive and/or the local disk that will be obtained.
7. method according to claim 1, it is characterised in that methods described also includes:
Each process of service is provided on the server according to the process configuration information operation for obtaining.
8. a kind of information acquisition device, it is characterised in that server is connected with each other with zookeeper, described There are multiple processes that service is provided on server, there is process configuration information, the dress in the zookeeper Setting on the server, described device includes:
Lock module is robbed, for making each process rob lock, the lock is the lock between default process;
Acquisition module, sets up length for making to rob the successful process of lock and is connected, by building with the zookeeper Vertical connection long is monitored to the shared drive of the server, the process in shared drive is monitored When process configuration information in configuration information and the zookeeper is inconsistent, the zookeeper is obtained In process configuration information, and be updated in the shared drive, so as to rob the process of lock failure according to Shared drive obtains process configuration information;
Wherein, the shared drive is shared by each process that service is provided on the server.
9. device according to claim 8, it is characterised in that the acquisition module specifically for: Make to rob successful one asynchronous thread of process initiation of lock;By the asynchronous thread for starting, with the zookeeper Set up connection long.
10. device according to claim 8, it is characterised in that described device also includes:
First update module, for the process in the zookeeper that the successful process of lock will be obtained is robbed After in configuration information update to the shared drive, the process configuration information in the zookeeper will be obtained It is updated in the local disk of the server.
CN201510975345.3A 2015-12-22 2015-12-22 A kind of information acquisition method and device Pending CN106909456A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510975345.3A CN106909456A (en) 2015-12-22 2015-12-22 A kind of information acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510975345.3A CN106909456A (en) 2015-12-22 2015-12-22 A kind of information acquisition method and device

Publications (1)

Publication Number Publication Date
CN106909456A true CN106909456A (en) 2017-06-30

Family

ID=59199451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510975345.3A Pending CN106909456A (en) 2015-12-22 2015-12-22 A kind of information acquisition method and device

Country Status (1)

Country Link
CN (1) CN106909456A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363619A (en) * 2018-03-07 2018-08-03 深圳市酷开网络科技有限公司 Service procedure control method, server and computer readable storage medium
CN109582386A (en) * 2018-11-09 2019-04-05 聚好看科技股份有限公司 Service starting processing method, device, electronic equipment and readable storage medium storing program for executing
CN109582384A (en) * 2018-10-26 2019-04-05 阿里巴巴集团控股有限公司 The update method and device of configuration information

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020112054A1 (en) * 2001-02-12 2002-08-15 International Business Machines Corporation Method and system for automated session resource clean-up in a distributed client-server environment
CN103500111A (en) * 2013-10-11 2014-01-08 北京奇虎科技有限公司 Information configuration method and device based on zookeeper
CN103856392A (en) * 2013-06-26 2014-06-11 携程计算机技术(上海)有限公司 Message push method, outgoing server using message push method and outgoing server system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020112054A1 (en) * 2001-02-12 2002-08-15 International Business Machines Corporation Method and system for automated session resource clean-up in a distributed client-server environment
CN103856392A (en) * 2013-06-26 2014-06-11 携程计算机技术(上海)有限公司 Message push method, outgoing server using message push method and outgoing server system
CN103500111A (en) * 2013-10-11 2014-01-08 北京奇虎科技有限公司 Information configuration method and device based on zookeeper

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108363619A (en) * 2018-03-07 2018-08-03 深圳市酷开网络科技有限公司 Service procedure control method, server and computer readable storage medium
CN109582384A (en) * 2018-10-26 2019-04-05 阿里巴巴集团控股有限公司 The update method and device of configuration information
CN109582386A (en) * 2018-11-09 2019-04-05 聚好看科技股份有限公司 Service starting processing method, device, electronic equipment and readable storage medium storing program for executing
CN109582386B (en) * 2018-11-09 2022-02-25 聚好看科技股份有限公司 Service starting processing method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN110535831B (en) Kubernetes and network domain-based cluster security management method and device and storage medium
US11349710B1 (en) Composable edge device platforms
US10359951B1 (en) Snapshotless backup
CN104301142B (en) A kind of backup method and equipment of configuration file
US9244674B2 (en) Computer system supporting remotely managed IT services
RU2712815C1 (en) Protection of network devices by means of firewall
CN107515776A (en) The uninterrupted upgrade method of business, node to be upgraded and readable storage medium storing program for executing
CN106201566A (en) The rich big special hot upgrade method of software of profit and equipment
US10229181B2 (en) System and method for synchronizing data between communication devices in a networked environment without a central server
CN107070972A (en) A kind of distributed document processing method and processing device
CN103685608B (en) A kind of method and device for automatically configuring secure virtual machine IP address
CN105407117B (en) The methods, devices and systems of distributed backup data
US10063429B2 (en) Systems and methods for optimizing computer network operations
US10581823B2 (en) Web client plugin manager in vCenter managed object browser
CN108628706A (en) Method, apparatus, system and the storage medium of data backup
CN106909456A (en) A kind of information acquisition method and device
CN108139936A (en) The methods, devices and systems of access to the serial port from the virtual machine in the virtual application of deployment are provided
CN109189749A (en) File synchronisation method and terminal device
CN110502572A (en) A kind of method and server that data are synchronous
CN108270846A (en) The mancarried device of secure operating system Dynamical Deployment is supported under a kind of cloud environment
CN115454636A (en) Container cloud platform GPU resource scheduling method, device and application
CN106941418B (en) SSL VPN configuration information synchronization method and device
CN109063011A (en) Log processing method, electronic device and computer readable storage medium
US20150372854A1 (en) Communication control device, communication control program, and communication control method
CN107918564A (en) Data transmission exception processing method, device, electronic 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: 20170630

RJ01 Rejection of invention patent application after publication