CN106911730A - A kind of cloud disk service device accesses moving method and device - Google Patents

A kind of cloud disk service device accesses moving method and device Download PDF

Info

Publication number
CN106911730A
CN106911730A CN201510971808.9A CN201510971808A CN106911730A CN 106911730 A CN106911730 A CN 106911730A CN 201510971808 A CN201510971808 A CN 201510971808A CN 106911730 A CN106911730 A CN 106911730A
Authority
CN
China
Prior art keywords
network request
database
service
abnormal
cloud disk
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
CN201510971808.9A
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 CN201510971808.9A priority Critical patent/CN106911730A/en
Publication of CN106911730A publication Critical patent/CN106911730A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/40Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass for recovering from a failure of a protocol instance or entity, e.g. service redundancy protocols, protocol state redundancy or protocol service redirection

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Moving method and device are accessed the invention provides a kind of cloud disk service device.Methods described includes:Judge the network request for receiving whether for abnormal database by monitoring service;If the network request is directed to abnormal database, the second process that the network request is switched to standby traffic cluster is processed;If the network request is directed to normal database, the network request is sent to the second local process and is processed.Achieve when the database of cloud disk service device cluster goes wrong, avoid the cloud disk service device cluster stuck, it is easy to, in the case where only a cloud disk service device cluster is disposed, the influence of the performance to cloud disk service device can be reduced, is easy to the beneficial effect of maintenance and expansion.

Description

A kind of cloud disk service device accesses moving method and device
Technical field
The present invention relates to software technology field, more particularly to a kind of cloud disk service device access moving method and A kind of cloud disk service device accesses moving apparatus.
Background technology
With the development of Internet technology, cloud disk has become network storage work essential in living Tool, cloud disk can be serviced by internet for enterprises and individuals provide storage, reading, download of information etc..
Cloud disk is by the cloud disk service device cluster of front end receiver user's request and each data of the specific data of storage Storehouse constitutes.Each database one domain name of correspondence, user sends access request by the domain name, so that Associated databases can be operated by cloud disk service device cluster.In first technology, portion for convenience Administration, there is provided a cloud disk service device cluster, the process of each cloud disk service device receives user in the cluster For the access request of a certain database domain name.But, if exception occurs in certain database A, such as Collapse, then the process of the reception access request then can be stuck, and the database is accessed for high-volume user When A, then the process of cloud disk service device cluster can gradually be occupied full, then may finally cause the cloud disk Cloud disk service device cluster it is stuck so that the cloud disk service device in the cloud disk service device cluster can not be User provides service.
Make the stuck of whole cloud disk service device cluster to solve a database corruption, in first technology, Then a big cloud disk service device cluster is physically split for multiple small cloud disk service device clusters, Each cloud disk service device cluster management partial database.But this kind of plan implementation high cost, maintenance cost Also very high, cluster expansion is very inconvenient, and the database of certain cluster is stuck, after a certain time should Cluster in the same old way can be stuck.
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 part of to provide one kind The cloud disk service device that solves the above problems access moving method and corresponding cloud disk service device accesses migration Device.
According to one aspect of the present invention, there is provided a kind of cloud disk service device accesses moving method, including:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.
Preferably, it is described to judge the network request for receiving whether for abnormal database by monitoring service The step of, including:
After network request is received by monitoring service, the value of configuration service is read;
According to the value of the configuration service, judge the network request whether for abnormal database.
Preferably, it is described network request is received by monitoring service after, read configuration service value step Before rapid, also include:
Monitor whether each database exception occurs;
If exception occurs in the database, configuration file is generated according to the database;
The configuration file is loaded onto in configuration service, to update the value of the configuration service.
Preferably, whether described each database of monitoring there is abnormal step, including:
Monitor whether each database breaks down;
And/or monitor each database flowing of access it is whether abnormal.
Preferably, the step of generation configuration file according to the database, including:
The corresponding domain name of the database is obtained, and configuration file is generated according to domain name.
Preferably, whether the value according to the configuration service, judge the network request for abnormal Database the step of, including:
Judge whether the domain name of map network request matches with the value of the configuration service;
If the domain name of map network request is matched with the value of the configuration service, it is determined that the network please Seeking Truth is for abnormal database;
If the domain name of map network request is mismatched with the value of the configuration service, it is determined that the network Request is not directed to abnormal database.
Preferably, the monitoring service includes nginx multi-process model services;Second process includes PHP processes.
Preferably, it is described to judge the network request for receiving whether for abnormal database by monitoring service The step of, including:
After nginx multi-process model services receive a network request, by lua script calling interfaces Call lua scripts;
Judge the network request whether for abnormal database by the lua scripts.
Preferably, the lua scripts calling interface includes openresty interfaces.
According to another aspect of the present invention, there is provided a kind of cloud disk service device accesses moving apparatus, including:
Whether network request judge module, be suitable to judge the network request for receiving for different by monitoring service Normal database;
Network request handover module, is suitable to when the network request is directed to abnormal database, by institute State network request and be switched to the second process of standby traffic cluster and processed;
Network request sending module, when being suitable to the network request and being directed to normal database, will be described Network request is sent to the second local process and is processed.
Preferably, the network request judge module, including:
Reading submodule, is suitable to after network request is received by monitoring service, reads the value of configuration service;
Network request judging submodule, is suitable to the value according to the configuration service, judges the network request Whether for abnormal database.
Preferably, before the reading submodule, also include:
Database monitoring submodule, is suitable to monitor whether each database exception occurs;
Configuration file generates submodule, is suitable to when the database occurs abnormal, according to the database Generation configuration file;
Submodule is updated, is suitable to be loaded onto the configuration file in configuration service, to update the configuration The value of service.
Preferably, the database monitoring submodule, including:
Mishap Database monitoring submodule, is suitable to monitor whether each database breaks down;And/or
Whether each database access traffic monitoring submodule, the flowing of access for being suitable to monitor each database is different Often.
Preferably, the configuration file generation submodule, including:
The configuration file generation submodule of correspondence domain name, the corresponding domain name of the acquisition database, and according to Domain name generates configuration file.
Preferably, the network request judging submodule, including:
Matching judgment submodule, is suitable to judge that the domain name that map network is asked is with the value of the configuration service No matching;
Exception database determination sub-module, is suitable to the domain name and the configuration service in map network request During value matching, determine that the network request is directed to abnormal database;
Normal data storehouse determination sub-module, is suitable to the domain name and the configuration service in map network request When value is mismatched, determine that the network request is not directed to abnormal database.
Preferably, the monitoring service includes nginx multi-process model services;Second process includes PHP processes.
Preferably, the network request judge module, including:
Lua scripts call submodule, are suitable to receive a network request in nginx multi-process model services Afterwards, lua scripts are called by lua script calling interfaces;
Lua scripts judge network request submodule, are suitable to judge the network request by the lua scripts Whether for abnormal database.
Preferably, the lua scripts calling interface includes openresty interfaces.
According to another aspect of the present invention, there is provided a kind of cloud disk service device accesses migration equipment, including:
Memory, is loaded with a plurality of executable instruction;
Processor, performs a plurality of executable instruction;The a plurality of instruction includes performing following steps Method:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.
Cloud disk service device of the invention accesses migration scheme, can be in whole cloud disk service device cluster Every cloud disk service device in, a monitoring service is set, please to the network that receives by monitoring service Ask and judged, whether to judge received network request for abnormal database, if it is, Then the second process that the network request switches to standby traffic cluster is processed;Otherwise, please by network Ask and processed in the second local process.Thus solve in first technology, only disposed in cloud platform When certain database in the corresponding database of one group of cloud disk service device cluster occurs abnormal, the cloud disk is caused Cloud disk service device in server cluster can not continue to provide the user the problem of service, achieve in cloud disk When the database of server cluster goes wrong, it is to avoid the cloud disk service device cluster is stuck, is easy in only portion In the case of one cloud disk service device cluster of administration, the influence of the performance to cloud disk service device can be reduced, just In the beneficial effect of maintenance and expansion.
Described above is only the general introduction of technical solution of the present invention, in order to better understand skill of the invention Art means, and can be practiced according to the content of specification, and it is of the invention above and other in order to allow Objects, features and advantages can become apparent, below especially exemplified by specific embodiment of the invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are for this Field those of ordinary skill will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, And it is not considered as limitation of the present invention.And in whole accompanying drawing, be denoted by the same reference numerals Identical part.In the accompanying drawings:
Fig. 1 shows that the step of cloud disk service device according to an embodiment of the invention accesses moving method is flowed Cheng Tu;
Fig. 2 shows that the step of cloud disk service device according to an embodiment of the invention accesses moving method is flowed Cheng Tu;
Fig. 3 shows that cloud disk service device according to an embodiment of the invention accesses the structural frames of moving apparatus Figure;
Fig. 3 A show that the cloud disk service device based on Fig. 3 accesses migratory system example;
Fig. 4 shows that cloud disk service device according to an embodiment of the invention accesses the structural frames of moving apparatus Figure;And
Fig. 5 shows that cloud disk service device according to an embodiment of the invention accesses the structural frames of migration equipment Figure.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although being shown in accompanying drawing The exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure without Should be limited by embodiments set forth here.Conversely, there is provided these embodiments are able to more thoroughly Understand the disclosure, and can by the scope of the present disclosure it is complete convey to those skilled in the art.
Embodiment one
Reference picture 1, shows that a kind of cloud disk service device according to an embodiment of the invention accesses migration side The step of method flow chart, specifically may include steps of:
Step S110:Judge the network request for receiving whether for abnormal database by monitoring service; If the network request is directed to abnormal database, step S120 is performed;Otherwise perform step S130。
The embodiment of the present invention can apply to dispose one group of cloud disk service device cluster in cloud platform, and the cloud In the case of disk server cluster correspondence multiple database, by corresponding to different in the cloud disk service device cluster The network request in regular data storehouse is migrated.Certainly, if disposing multigroup cloud disk service device cluster, this hair Bright embodiment can also be used, and the embodiment of the present invention is not any limitation as to it.
In actual applications, cloud disk service device cluster can be to that should have multiple domain names, and each domain name is corresponded to In a database, when user accesses the domain name of the cloud disk service device cluster, please by the network to user Ask and parsed, corresponding data manipulation then can be performed in corresponding database.For example, one Group cloud disk service device cluster S has 3 domain names A, B, a C, the database corresponding to it be respectively DB-1, DB-2、DB-3.In first technology, in user accesses the cloud disk service device cluster using client When cloud disk uploads data, then the PHP processes of the cloud disk service device cluster receive client hair to domain name A The network request for sending, and the network request is parsed according to corresponding program, and in domain name A correspondences Database D B-1 in add corresponding data.The PHP processes perform to file beat opening/closing, The service logics such as upload/download.
In embodiments of the present invention, it is the cloud for every cloud disk service device in cloud disk service device cluster Disk server sets a monitoring service, and the monitoring service receives the network request that user sends, Ran Houjin Enter step S120.
Corresponding database monitor process can also be set in embodiments of the present invention, with to database whether Exception is monitored, and conventional monitoring method may include steps of:
Step S1:Running state information is obtained from database using active session history interface;
Step S2:By the running state information in predetermined amount of time and the history run state of the database Information is compared, to determine the running status trend of database;
Step S3:According to the running status trend evaluation database of database with the presence or absence of abnormal;Data The running status trend in storehouse can include:According to the running status trend that the sub- index of core is estimated;Root Running status trend being estimated according to integrated performance index etc..
It is to be appreciated that above-mentioned monitoring method be able to more fully understand technical scheme and A kind of case enumerated, it is impossible in this, as to a kind of limitation of the invention.
Whether it is monitored extremely by database, when detecting the corresponding data of cloud disk service device cluster When there is exception database in storehouse, exception database can be marked and be recorded, and then received After the network request sent corresponding to user, the monitoring service that can be provided according to cloud platform is to the network Request is judged, to determine whether the network request is for abnormal database.If the network please Ask and be directed to abnormal database, then into step S120;If the network request is directed to just Normal data, then into step S130.
In embodiments of the present invention, the exception of database includes:Database corruption etc. cannot provide service It is abnormal;The connection quantity that database is at the appointed time received in section is more than threshold value, it is understood that be cloud disk Server receives connection and attacks, and the connection is attacked and is directed to above-mentioned database.
In actual applications, after monitoring service receives the network request of client transmission, can be asked from network The corresponding domain name of middle parsing network request is sought, its corresponding database is then determined according to domain name, then Judge whether the database is abnormal.Enter step S120 if abnormal;If normal, enter step Rapid S130.
Preferably, the monitoring service includes nginx multi-process model services.
Monitoring service can include nginx multi-process model services, and nginx is a kind of agency of lightweight Cloud disk service device, it occupies, and internal memory is fewer, and concurrent capability is stronger, and then can reduce in system While the occupancy deposited, the more business corresponding to network request can be simultaneously loaded.Nginx starts Afterwards in running background in the way of background process, background process includes a master process and multiple Worker processes.After the connection of client is received, the existing worker of master process selections enters Journey receives the connection, and the network request of the client is received by the connection;If without existing Worker, master process then create a worker process and receive the connection, and are received by the connection The network request of the client
In embodiments of the present invention, Nginx multi-process model service is not performed corresponding to network request Specific Business Processing, but used as a kind of originator that turns of network request, nginx multi-process model services connect The network request sent by client is received, then the network request is made whether for abnormal database Judgement, will be determined the network request is forwarded into the second of standby traffic cluster to enter according to judged result Journey, the second process for being still forwarded to this cluster is processed.Second process performs specific business and patrols Volume.
Can be pre-set in nginx multi-process model services multiple domain names of cloud disk service device cluster with The corresponding relation of the corresponding database of cloud disk service device cluster, such that it is able to judge the net according to network request Network request correspondence is which database.
In embodiments of the present invention, can be that monitoring service configures the IP address of local second process and standby With the IP address of business cluster.If it is determined that the network request for receiving is directed to abnormal database, Then the IP address of the standby traffic cluster according to configuration, standby traffic cluster is transmitted to by the network request. If it is determined that the network request for receiving is directed to abnormal database, then according to the standby traffic collection of configuration The IP address of group, the second local process is forwarded by the network request.
Step S120:The second process that the network request is switched to standby traffic cluster is processed.
In embodiments of the present invention, after the cloud disk service device cluster in deployment directly facing client, phase A standby traffic cluster should be provided with.
In every cloud disk service device in cloud disk service device cluster, sequentially deploy for judging Whether the network request for receiving is for the monitoring service of abnormal database and for processing specific business Second process of logic.The service logic such as plays opening/closing file, upload/downloading data, newly-built/to delete Except the business operation logic such as file.
In every cloud disk service device in standby traffic cluster, the second foregoing process is only configured with.It is standby Identical database is all configured with business cluster and corresponding cloud disk service device cluster.
In embodiments of the present invention, standby traffic cluster corresponding with cloud disk service device cluster can be created, The standby traffic cluster also has a database corresponding to it, the cloud disk service device of cloud disk service device cluster, by After its monitoring service receives network request, when judging that the database that the network request is directed to occurs abnormal, The network request is then transmitted to certain the cloud disk clothes of the corresponding standby traffic cluster of cloud disk service device cluster Business device, is processed, then the abnormal database is to the present invention by the second process of the cloud disk service device The process of cloud disk service device cluster would not produce stuck phenomenon because the network of the database of exception please Ask and do not processed by the cloud disk service device cluster.
Preferably, second process includes PHP processes.
In the embodiment of the present invention, the second process set in each cloud disk service device of standby traffic cluster can So that including PHP (Hypertext Preprocessor, hypertext pretreatment language) process, PHP is to exempt from The code for taking and increasing income, program development speed ratio is very fast, the speed of service is fast etc. can be reached using PHP Advantage, thus, entered using PHP processes as the second of standby traffic cluster in embodiments of the present invention Journey can improve research and development speed while R & D Cost is saved.But the concurrent quantity of PHP processes is few, If database occurs abnormal, it is easy to PHP processes occur to take, so that the PHP of whole cluster Process takes, and causes the problem that cluster is stuck.
Can be performed using the processing mode of PHP multi-process in the embodiment of the present invention and correspond to network request Business Processing, can reach while perform more network request, improve the corresponding business of network request The efficiency for the treatment of.PHP multi-process can include a PHP host process and more multiple PHP subprocess, It is used to receive the network request of nginx multi-process model service forwarding by PHP host processes, and by these nets Network request is respectively sent in each PHP subprocess perform specific Business Processing.
Preferably, the step S120 can include:
Sub-step S1202:After nginx multi-process model services receive a network request, by lua Script calling interface calls lua scripts;
Sub-step S1204:Judge the network request whether for abnormal number by the lua scripts According to storehouse.
In the embodiment of the present invention, lua is a kind of light weight, expansible script, can be embedded in application In program, flexible extension and customization function can be provided for application program, and lua language volume compared with Small, toggle speed ratio is very fast, thus, the speed of service of system can be accelerated using lua language.
In embodiments of the present invention, lua scripts can be embedded into nginx multi-process model services In, after nginx multi-process model services receive a network request, can be by lua scripts Whether calling interface calls lua scripts, lua scripts to can be used for network request for abnormal database Judged.
Accordingly, lua scripts calling interface can include openresty interfaces, and openresty is a kind of complete The web application cloud disk service devices of function, it has packed the Nginx cores of standard, and many is conventional Third party's module, and their most of dependences, it is of the invention then in nginx multi-process model services Middle addition openresty interfaces, then process of the nginx multi-process model service in the parsing to network request In call the openresty interfaces, such that it is able to call lua scripts, realization judge network request whether pin To the process of abnormal database.The complexity of programming is reduced by this kind of mode.
Step S130:The network request is sent into the second local process to be processed.
When the network request for receiving is directed to normal database, then monitoring service is by the network request The second local process is forwarded to be processed, such as according to local IP address such as 127.0.0.1, prison Control service gives the IP address with IP address forwarding network request, so that the second local process can connect The network request is received, specific service logic is then performed according to the network request, such as corresponding The operation such as addition, deletion of data is carried out in database.
The embodiment of the present invention is by monitoring service to receiving corresponding to the one group of cloud disk service device disposed Whether the network request of cluster is judged, to judge received network request for abnormal data Storehouse, if it is, the second process that the network request switches to standby traffic cluster is processed;It is no Then, network request is processed in the second local process.And then this group of cloud disk service can ensured While device cluster provides the user normal service, the database achieved in cloud disk service device cluster occurs During problem, it is to avoid the cloud disk service device cluster is stuck, it is easy in only one cloud disk service device cluster of deployment In the case of, the influence of the performance to cloud disk service device can be reduced, it is easy to the beneficial effect of maintenance and expansion.
Embodiment two
Reference picture 2, shows that a kind of cloud disk service device according to an embodiment of the invention accesses migration side The step of method flow chart, specifically may include steps of:
Step S210:Monitor whether each database exception occurs.
In the embodiment of the present invention, corresponding monitoring process etc. mode can be set, to cloud disk service device collection The corresponding each database of group is monitored, to monitor whether each database exception occurs.Accordingly, for The method of conventional database exception monitoring is described in detail in embodiment one, herein not It is repeated here again.
Preferably, the step S210 can include:
Sub-step S2102:Monitor whether each database breaks down;And/or monitor each database Whether flowing of access is abnormal.
In the embodiment of the present invention, database can include extremely:Database failure;Database failure can be with Including:Failure, the system failure, media failure and computer virus inside affairs etc..In prison When controlling certain database and one or more in above-mentioned failure occur, then can determine that the database goes out Show failure, namely there is exception in the database.
Database can also include extremely:There is exception in the flowing of access of database, for example, database Flowing of access exceed database volume, monitor certain database occur database access flow occur it is different Chang Shi, such as access the network request quantity per second of the database more than threshold value, then can determine the number Exception is occurred in that according to storehouse.
Broken down certain database is monitored, or database flowing of access it is abnormal when, then can be true The fixed database occurs abnormal.
Step S220:If exception occurs in the database, according to database generation configuration text Part.
In the embodiment of the present invention, certain database in the corresponding database of cloud disk service device cluster is monitored When occurring abnormal, the configuration file of exception database can be corresponded to according to exception database generation.Correspondence In different exception databases, corresponding different configuration file can be generated.It is of course also possible to be directed to Each abnormal database generates a configuration file.The configuration file is used for which database exception to be indicated, Such as include database name and corresponding domain name.
In embodiments of the present invention, a configuration service can be first set, the configuration file is loaded into In configuration service.
Preferably, the step S220 can include:
Sub-step S2202:The corresponding domain name of the database is obtained, and configuration is generated according to domain name File.
In the embodiment of the present invention, can be given birth to according to the domain name by obtaining the corresponding domain name of exception database Into the configuration file corresponding to each exception database, and then, when the configuration file of the database is got, Then can determine whether the database exception occurs.
It is to be appreciated that in the embodiment of the present invention can also by obtain exception database IP address, Database name, Service name etc., and according to one or more generations therein corresponding to exception database Configuration file.In actual applications, those skilled in the art can voluntarily select exception according to actual needs The features described above of database corresponds to the mark of the configuration file of exception database, the present invention as generation Embodiment is not any limitation as to this.
Step S230:The configuration file is loaded onto in configuration service, to update the configuration service Value.
In the embodiment of the present invention, the corresponding database of cloud disk service device cluster can be included under cloud platform Configuration service, can be preset in the configuration service corresponding to the whether abnormal value of each database, Other, value of the normal data storehouse in configuration service can be defaulted as null value, then, for abnormal cloud disk For server, the value that exception database can be set in configuration service is 1.
In actual applications, those skilled in the art can voluntarily set in configuration service according to actual needs The value of normal data storehouse and exception database is put, the embodiment of the present invention is not any limitation as to this.
Step S240:After network request is received by monitoring service, the value of configuration service is read.
In the embodiment of the present invention, after the network request that monitoring service receives user's transmission, can be with root According to the database that the network request is directed to, read to correspond to from the configuration service of cloud disk service device cluster and be somebody's turn to do The value of database.
Step S250:According to the value of the configuration service, judge the network request whether for abnormal Database;If the network request is directed to abnormal database, step S260 is performed;It is no Then, step S270 is performed.
After value of the database corresponding to network request in configuration service is read, can be according to the number According to storehouse configuration service value, to judge the network request whether for abnormal database.For example, working as When the value of the configuration service of the database corresponding to network request for reading is null value, then the net can be determined It is normal data storehouse that network asks corresponding database, in matching somebody with somebody for the database corresponding to network request for reading When the value for putting service is non-null value, then can determine that the corresponding database of the network request is abnormal data Storehouse.
When network request is directed to abnormal database, then step S260 is performed;Otherwise, step is performed Rapid S270.
Preferably, the step S250 can include:
Sub-step S2502:Judge whether the domain name of map network request matches with the value of the configuration service; If the domain name of map network request is matched with the value of the configuration service, sub-step S2504 is performed; Otherwise perform sub-step S2506.
In the embodiment of the present invention, due to corresponding to database domain name in the value of configuration service, thus After reading the value of configuration service, can be corresponding with the value of configuration service by the domain name of the network request The domain name of database is compared, with judge the domain name of the network request and configuration service value whether Match somebody with somebody, if it does, then performing sub-step S2504;Otherwise, sub-step S2506 is performed.
Sub-step S2504:Determine that the network request is directed to abnormal database.
Sub-step S2506:Then determine that the network request is not directed to abnormal database.
When the domain name of network request is matched with the value of configuration service, then can determine that the network request is pin To abnormal database, otherwise, the network request is not directed to abnormal database, i.e., for normal Database.
Step S260:The second process that the network request is switched to standby traffic cluster is processed.
In the embodiment of the present invention, when the network request that user sends is directed to abnormal database, then will The network request sends to the second process of standby traffic cluster and is processed, and corresponding in network request Corresponding data manipulation is performed in database.
Step S270:The network request is sent into the second local process to be processed.
In the embodiment of the present invention, when the network request that user sends is directed to normal database, then will The network request sends to the second process of cloud disk service device cluster and is processed, and in network request correspondence Corresponding data manipulation is performed in database.
When the embodiment of the present invention occurs abnormal by monitoring database, configuration of the generation corresponding to database File, and the configuration file is loaded onto in configuration service, and by monitoring service receive network please After asking, according to the value of configuration cloud disk service device, whether to judge the network request for exception database, If it is, the second process that the network request switches to standby traffic cluster is processed;Otherwise, Network request is processed in the second local process.And then this group of cloud disk service device collection can ensured While group provides the user normal service, achieve and save R & D Cost, reduce maintenance difficulties Beneficial effect.
For embodiment of the method, in order to be briefly described, therefore it is all expressed as a series of combination of actions, But those skilled in the art should know, the embodiment of the present invention is not limited by described sequence of movement System, because according to the embodiment of the present invention, some steps can sequentially or simultaneously be carried out using other.Its Secondary, those skilled in the art should also know, embodiment described in this description belongs to be preferable to carry out Example, necessary to the involved action not necessarily embodiment of the present invention.
Embodiment three
Reference picture 3, shows that a kind of cloud disk service device according to an embodiment of the invention accesses migration dress The structured flowchart put, can specifically include such as lower module:
Network request judge module 310, be suitable to by monitoring service judge the network request that receives whether pin To abnormal database;
Network request handover module 320, is suitable to when the network request is directed to abnormal database, The second process that the network request is switched to standby traffic cluster is processed;
Preferably, the monitoring service can include nginx multi-process model services;Second process Including PHP processes.
Preferably, the network request judge module 310, can include:
Lua scripts call submodule 3102, are suitable to receive a network in nginx multi-process model services After request, lua scripts are called by lua script calling interfaces;
Lua scripts judge network request submodule 3104, are suitable to judge the net by the lua scripts Whether network request is for abnormal database.
Preferably, the lua scripts calling interface includes openresty interfaces.
Network request sending module 330, when being suitable to the network request and being directed to normal database, will The network request is sent to the second local process and is processed.
Reference picture 3A, shows that the cloud disk service device based on Fig. 3 accesses the example of migratory system.Wherein Dispatch server S311 and each cloud disk service device S312 is included in cloud disk service device cluster S310, is adjusted The load balancing of the degree load whole system of server S 311 S310.Each cloud disk service device S312 includes Above-mentioned network request judge module 310, network request handover module 320, network request sending module 330 Etc. module.Standby traffic cluster includes dispatch server S321 and each cloud disk service device S322, wherein often Individual cloud disk service device S322 includes the second process.
The embodiment of the present invention is by monitoring service to receiving corresponding to the one group of cloud disk service device disposed Whether the network request of cluster is judged, to judge received network request for abnormal data Storehouse, if it is, the second process that the network request switches to standby traffic cluster is processed;It is no Then, network request is processed in the second local process.And then this group of cloud disk service can ensured While device cluster provides the user normal service, the database achieved in cloud disk service device cluster occurs During problem, it is to avoid the cloud disk service device cluster is stuck, it is easy in only one cloud disk service device cluster of deployment In the case of, the influence of the performance to cloud disk service device can be reduced, it is easy to the beneficial effect of maintenance and expansion.
Example IV
Reference picture 4, shows that a kind of cloud disk service device according to an embodiment of the invention accesses migration dress The structured flowchart put, can specifically include such as lower module:
Network request judge module 410, be suitable to by monitoring service judge the network request that receives whether pin To abnormal database;
Preferably, the network request judge module 410, can include:
Reading submodule 4106, is suitable to after network request is received by monitoring service, reads configuration service Value;
Network request judging submodule 4108, is suitable to the value according to the configuration service, judges the network Whether request is for abnormal database.
Preferably, before the reading submodule 4106, can also include:
Database monitoring submodule 4100, is suitable to monitor whether each database exception occurs;
Configuration file generates submodule 4102, is suitable to when the database occurs abnormal, according to the number Configuration file is generated according to storehouse;
Submodule 4104 is updated, is suitable to be loaded onto the configuration file in configuration service, it is described to update The value of configuration service.
Preferably, the database monitoring submodule 4100, can include:
Mishap Database monitoring submodule 41002, is suitable to monitor whether each database breaks down;With/ Or
Each database access traffic monitoring submodule 41004, is suitable to monitor the flowing of access of each database It is whether abnormal.
Preferably, the configuration file generation submodule 4102, can include:
The configuration file generation submodule 41022 of correspondence domain name, obtains the corresponding domain name of the database, And configuration file is generated according to domain name.
Preferably, the network request judging submodule 4108, can include:
Matching judgment submodule 41082, is suitable to judge the domain name and the configuration service of map network request Value whether match;
Exception database determination sub-module 41084, is suitable to the domain name in map network request and the configuration When the value of service is matched, determine that the network request is directed to abnormal database;
Normal data storehouse determination sub-module 41086, is suitable to the domain name in map network request and the configuration When the value of service is mismatched, determine that the network request is not directed to abnormal database.
Network request handover module 420, is suitable to when the network request is directed to abnormal database, The second process that the network request is switched to standby traffic cluster is processed;
Network request sending module 430, when being suitable to the network request and being directed to normal database, will The network request is sent to the second local process and is processed.
For device embodiment, because it is substantially similar to embodiment of the method, so the comparing of description Simply, the relevent part can refer to the partial explaination of embodiments of method.
Embodiment five
Reference picture 5, shows that a kind of cloud disk service device according to an embodiment of the invention accesses migration and sets Standby 500 structured flowchart, can specifically include:
Memory 510, is loaded with a plurality of executable instruction;
Processor 520, performs a plurality of executable instruction;The a plurality of instruction includes performing following step Rapid method:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.
Preferably, a plurality of executable instruction of the embodiment of the present invention may also include the side of foregoing each step Method, the embodiment of the present invention is not limited to it.
Algorithm and display be not solid with any certain computer, virtual system or miscellaneous equipment provided herein There is correlation.Various general-purpose systems can also be used together with based on teaching in this.As described above, It is obvious to construct the structure required by this kind of system.Additionally, the present invention is not also for any specific Programming 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 Inventive embodiment can be put into practice in the case of without these details.In some instances, not Known method, structure and technology are shown specifically, 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 in each inventive aspect Or it is multiple, in above to the description of exemplary embodiment of the invention, each feature of the invention is sometimes It is grouped together into single embodiment, figure or descriptions thereof.However, should not be by the disclosure Method be construed to reflect following intention:I.e. the present invention for required protection requirement ratio is in each claim The middle more features of feature be expressly recited.More precisely, as the following claims reflect As, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows Thus claims of specific embodiment are expressly incorporated in the specific embodiment, wherein each right It is required that in itself all as separate embodiments of the invention.
Those skilled in the art are appreciated that can be carried out certainly to the module in the equipment in embodiment Adaptively change and they are arranged in one or more equipment different from the embodiment.Can be with Module or unit or component in embodiment is combined into a module or unit or component, and in addition may be used To be divided into multiple submodule or subelement or sub-component.Except such feature and/or process or Outside at least some in unit exclude each other, can be using any combinations to this specification (including companion With claim, summary and accompanying drawing) disclosed in all features and so disclosed any method or All processes or unit of person's equipment are combined.Unless expressly stated otherwise, this specification (including companion With claim, summary and accompanying drawing) disclosed in each feature can it is identical by offers, equally or phase Replace like the alternative features of purpose.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include it Some included features are rather than further feature, but the group of the feature of different embodiments in its embodiment Conjunction means to be within the scope of the present invention and formed different embodiments.For example, in following power In sharp claim, the one of any of embodiment required for protection mode can make in any combination With.
All parts embodiment of the invention can be realized with hardware, or be processed with one or more The software module run on device is realized, or is realized with combinations thereof.Those skilled in the art should Understand, basis can be realized using microprocessor or digital signal processor (DSP) in practice The cloud disk service device of the embodiment of the present invention access some or all parts in migration equipment some or Person's repertoire.The present invention be also implemented as a part for performing method as described herein or Whole equipment or program of device (for example, computer program and computer program product).It is such Realize that program of the invention can be stored on a computer-readable medium, or can be with one or many The form of individual signal.Such signal can be downloaded from internet website and obtained, or in carrier signal Upper offer, or provided in any other form.
It should be noted that above-described embodiment the present invention will be described rather than limiting the invention, And those skilled in the art can design replacement without departing from the scope of the appended claims Embodiment.In the claims, any reference symbol being located between bracket should not be configured to right It is required that limitation.Word "comprising" does not exclude the presence of element or step not listed in the claims.Position 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 the unit claim for listing equipment for drying, several in these devices can be by same Individual hardware branch is embodied.The use of word first, second, and third does not indicate that any order. These words can be construed to title.
Moving method is accessed the invention discloses A1, a kind of cloud disk service device, including:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.
A2, the method as described in A1, it is described by monitoring service judge the network request that receives whether pin The step of to abnormal database, including:
After network request is received by monitoring service, the value of configuration service is read;
According to the value of the configuration service, judge the network request whether for abnormal database.
A3, the method as described in A2, it is described network request is received by monitoring service after, reading is matched somebody with somebody Before the step of putting the value of service, also include:
Monitor whether each database exception occurs;
If exception occurs in the database, configuration file is generated according to the database;
The configuration file is loaded onto in configuration service, to update the value of the configuration service.
Whether A4, the method as described in A3, the monitoring each database there is abnormal step, wrap Include:
Monitor whether each database breaks down;
And/or monitor each database flowing of access it is whether abnormal.
The step of A5, the method as described in A3, generation configuration file according to the database, bag Include:
The corresponding domain name of the database is obtained, and configuration file is generated according to domain name.
A6, the method as described in A4, the value according to the configuration service judge that the network please Seeking Truth it is no for abnormal database the step of, including:
Judge whether the domain name of map network request matches with the value of the configuration service;
If the domain name of map network request is matched with the value of the configuration service, it is determined that the network please Seeking Truth is for abnormal database;
If the domain name of map network request is mismatched with the value of the configuration service, it is determined that the network Request is not directed to abnormal database.
A7, the method as described in A1, the monitoring service include nginx multi-process model services;Institute Stating the second process includes PHP processes.
A8, the method as described in A7, it is described by monitoring service judge the network request that receives whether pin The step of to abnormal database, including:
After nginx multi-process model services receive a network request, by lua script calling interfaces Call lua scripts;
Judge the network request whether for abnormal database by the lua scripts.
A9, the method as described in A8, the lua scripts calling interface include openresty interfaces.
Moving apparatus are accessed the invention also discloses B10, a kind of cloud disk service device, including:
Whether network request judge module, be suitable to judge the network request for receiving for different by monitoring service Normal database;
Network request handover module, is suitable to when the network request is directed to abnormal database, by institute State network request and be switched to the second process of standby traffic cluster and processed;
Network request sending module, when being suitable to the network request and being directed to normal database, will be described Network request is sent to the second local process and is processed.
B11, the device as described in B10, the network request judge module, including:
Reading submodule, is suitable to after network request is received by monitoring service, reads the value of configuration service;
Network request judging submodule, is suitable to the value according to the configuration service, judges the network request Whether for abnormal database.
B12, the device as described in B11, before the reading submodule, also include:
Database monitoring submodule, is suitable to monitor whether each database exception occurs;
Configuration file generates submodule, is suitable to when the database occurs abnormal, according to the database Generation configuration file;
Submodule is updated, is suitable to be loaded onto the configuration file in configuration service, to update the configuration The value of service.
B13, the device as described in B12, the database monitoring submodule, including:
Mishap Database monitoring submodule, is suitable to monitor whether each database breaks down;And/or
Whether each database access traffic monitoring submodule, the flowing of access for being suitable to monitor each database is different Often.
B14, the device as described in B12, the configuration file generate submodule, including:
The configuration file generation submodule of correspondence domain name, the corresponding domain name of the acquisition database, and according to Domain name generates configuration file.
B15, the device as described in B13, the network request judging submodule, including:
Matching judgment submodule, is suitable to judge that the domain name that map network is asked is with the value of the configuration service No matching;
Exception database determination sub-module, is suitable to the domain name and the configuration service in map network request During value matching, determine that the network request is directed to abnormal database;
Normal data storehouse determination sub-module, is suitable to the domain name and the configuration service in map network request When value is mismatched, determine that the network request is not directed to abnormal database.
B16, the device as described in B10, the monitoring service include nginx multi-process model services; Second process includes PHP processes.
B17, the device as described in B16, the network request judge module, including:
Lua scripts call submodule, are suitable to receive a network request in nginx multi-process model services Afterwards, lua scripts are called by lua script calling interfaces;
Lua scripts judge network request submodule, are suitable to judge the network request by the lua scripts Whether for abnormal database.
B18, the device as described in B17, the lua scripts calling interface include openresty interfaces.
Migration equipment is accessed the invention also discloses C19, a kind of cloud disk service device, including:
Memory, is loaded with a plurality of executable instruction;
Processor, performs a plurality of executable instruction;The a plurality of instruction includes performing following steps Method:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.

Claims (10)

1. a kind of cloud disk service device accesses moving method, including:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.
2. method according to claim 1, it is characterised in that described to be judged to connect by monitoring service The step of whether network request for receiving is for abnormal database, including:
After network request is received by monitoring service, the value of configuration service is read;
According to the value of the configuration service, judge the network request whether for abnormal database.
3. method according to claim 2, it is characterised in that received by monitoring service described To after network request, read configuration service value the step of before, also include:
Monitor whether each database exception occurs;
If exception occurs in the database, configuration file is generated according to the database;
The configuration file is loaded onto in configuration service, to update the value of the configuration service.
4. method according to claim 3, it is characterised in that the monitoring each database is The no step for exception occur, including:
Monitor whether each database breaks down;
And/or monitor each database flowing of access it is whether abnormal.
5. method according to claim 3, it is characterised in that described to be given birth to according to the database The step of into configuration file, including:
The corresponding domain name of the database is obtained, and configuration file is generated according to domain name.
6. method according to claim 4, it is characterised in that described according to the configuration service Value, the step of whether judge the network request for abnormal database, including:
Judge whether the domain name of map network request matches with the value of the configuration service;
If the domain name of map network request is matched with the value of the configuration service, it is determined that the network please Seeking Truth is for abnormal database;
If the domain name of map network request is mismatched with the value of the configuration service, it is determined that the network Request is not directed to abnormal database.
7. method according to claim 1, it is characterised in that the monitoring service includes nginx Multi-process model service;Second process includes PHP processes.
8. method according to claim 7, it is characterised in that described to be judged to connect by monitoring service The step of whether network request for receiving is for abnormal database, including:
After nginx multi-process model services receive a network request, by lua script calling interfaces Call lua scripts;
Judge the network request whether for abnormal database by the lua scripts.
9. a kind of cloud disk service device accesses moving apparatus, including:
Whether network request judge module, be suitable to judge the network request for receiving for different by monitoring service Normal database;
Network request handover module, is suitable to when the network request is directed to abnormal database, by institute State network request and be switched to the second process of standby traffic cluster and processed;
Network request sending module, when being suitable to the network request and being directed to normal database, will be described Network request is sent to the second local process and is processed.
10. a kind of cloud disk service device accesses migration equipment, including:
Memory, is loaded with a plurality of executable instruction;
Processor, performs a plurality of executable instruction;The a plurality of instruction includes performing following steps Method:
Judge the network request for receiving whether for abnormal database by monitoring service;
If the network request is directed to abnormal database, the network request is switched to standby Second process of business cluster is processed;
If the network request is directed to normal database, the network request is sent to locally The second process processed.
CN201510971808.9A 2015-12-22 2015-12-22 A kind of cloud disk service device accesses moving method and device Pending CN106911730A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510971808.9A CN106911730A (en) 2015-12-22 2015-12-22 A kind of cloud disk service device accesses moving method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510971808.9A CN106911730A (en) 2015-12-22 2015-12-22 A kind of cloud disk service device accesses moving method and device

Publications (1)

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

Family

ID=59199778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510971808.9A Pending CN106911730A (en) 2015-12-22 2015-12-22 A kind of cloud disk service device accesses moving method and device

Country Status (1)

Country Link
CN (1) CN106911730A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309120A (en) * 2018-03-06 2019-10-08 阿里巴巴集团控股有限公司 Data processing method and data processing equipment
CN110636072A (en) * 2019-09-26 2019-12-31 腾讯科技(深圳)有限公司 Target domain name scheduling method, device, equipment and storage medium
CN112765128A (en) * 2020-12-31 2021-05-07 北京知因智慧科技有限公司 REPL-based data development method, system and electronic equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309120A (en) * 2018-03-06 2019-10-08 阿里巴巴集团控股有限公司 Data processing method and data processing equipment
CN110309120B (en) * 2018-03-06 2023-04-07 阿里云计算有限公司 Data processing method and data processing device
CN110636072A (en) * 2019-09-26 2019-12-31 腾讯科技(深圳)有限公司 Target domain name scheduling method, device, equipment and storage medium
CN112765128A (en) * 2020-12-31 2021-05-07 北京知因智慧科技有限公司 REPL-based data development method, system and electronic equipment
CN112765128B (en) * 2020-12-31 2023-10-03 北京知因智慧科技有限公司 REPL-based data development method, system and electronic equipment

Similar Documents

Publication Publication Date Title
CN105074698B (en) It is performed in parallel continuous events processing (CEP) inquiry
CN103475687B (en) Distributed method and system for download site data
CN104699541B (en) Method, apparatus, data transfer components and the system of synchrodata
US20220070067A1 (en) Declarative and reactive data layer for component-based user interfaces
CN110941528B (en) Log buried point setting method, device and system based on fault
CN107395659A (en) A kind of method and device of service handling and common recognition
CN104484223B (en) A kind of Android system application method for closing and device
CN105653425A (en) Complicated event processing engine based monitoring system
CN109120461B (en) A kind of service feature end-to-end monitoring method, system and device
JP2013536513A (en) Method and apparatus for filtering streaming data
CN105184166A (en) Kernel-based Android application real-time behavior analysis method and system
US20160321036A1 (en) Dynamically monitoring code execution activity to identify and manage inactive code
CN109118353A (en) The data processing method and device of air control model
US20160292581A1 (en) Minimized processing of streaming changes into a semantic reasoner
CN104281488B (en) The method and system of server engine
CN106911730A (en) A kind of cloud disk service device accesses moving method and device
CN110196888A (en) Data-updating method, device, system and medium based on Hadoop
CN106095483A (en) The Automation arranging method of service and device
CN106777368A (en) Data base query language adaptation method and device, distributed data-storage system
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN103647811B (en) A method and an apparatus for application's accessing backstage service
CN106843977A (en) A kind of processing method of application program self-starting, device and mobile terminal
CN109739665A (en) Interface managerial method, device, server and storage medium
CN104580361A (en) Method, device and system for downloading data
US8224933B2 (en) Method and apparatus for case-based service composition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170630

WD01 Invention patent application deemed withdrawn after publication