CN103777969B - Server parameter deploying method and device with no need for restarting - Google Patents

Server parameter deploying method and device with no need for restarting Download PDF

Info

Publication number
CN103777969B
CN103777969B CN201210402186.4A CN201210402186A CN103777969B CN 103777969 B CN103777969 B CN 103777969B CN 201210402186 A CN201210402186 A CN 201210402186A CN 103777969 B CN103777969 B CN 103777969B
Authority
CN
China
Prior art keywords
server
parameter
memory space
module
server parameter
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.)
Active
Application number
CN201210402186.4A
Other languages
Chinese (zh)
Other versions
CN103777969A (en
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201210402186.4A priority Critical patent/CN103777969B/en
Publication of CN103777969A publication Critical patent/CN103777969A/en
Application granted granted Critical
Publication of CN103777969B publication Critical patent/CN103777969B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a server parameter deploying method with no need for restarting. The server parameter deploying method comprises: step 100, a storage space is allocated in a server, and server parameters are written into the storage space; step 110, the server parameters are loaded into a server internal memory when a server is started; step 120, the storage space is accessed to re-deploy the server parameters. Compared with the prior art, the reading speed of the server parameter deploying method and device with no need for restarting through xml is high, server restating is not needed. When assignment operation of related static variables or key/value pairs is finished, the server parameters are also updated and re-deployed.

Description

A kind of method and apparatus that need not restart deployment server parameter
Technical field
The application is related to technical field of the computer network, more particularly to a kind of need not restart both can deployment server parameter Method and apparatus.
Background technology
For the application server of on-line operation, it is sometimes necessary to which deployment adjusts some parameters, to reach different effects, Finishing service demand.For example, certain data export function, derives with single thread and multithreading derives both of which, server Default parameterss are single threads, when needing to perform multithreading derivation operation, it is necessary to adjust server parameter.Traditional method needs First stop server, after changing parameter, then restart server.
Some application servers have the function of heat deployment, mainly use reading xml configuration files and realize Dynamical Deployment. These technical schemes typically write on configuration file in one xml document, and server is touched by artificial when needing to use The mode sent out, reads the parameter in xml document;When needing to change parameter temporal, by the parameter in modification xml document, and again Secondary trigger parameter reading program reads amended parameter into server.
Application server is the stable environment of a longtime running, carries the business logic processing function of client, right In existing application server, (application server mentioned here refers to the background server for deploying service application, not extensively Technical service device assembly in justice) parameter configuration technology, there is following defect:
1st, stopping server being needed to be disposed.
The configuration parameter load mechanism of application server, is all, when startup of server, to be disposably loaded onto at present In internal memory, when needing to wherein a or two parameter modification.Need to stop server, after modification parameter, open again Dynamic server is loaded.
Such way time and effort consuming, application server carry substantial amounts of service request daily, stop every time all making The interruption of business on line, and in order to change a or two parameter, cause whole Server Restart, the cost of consuming is also huge Big, the loss for causing is also than larger.
2nd, it is poor by xml loading performance.
Application server writes on parameter in one xml document, reads xml, Ran Houtong by IO streams when needed Cross and parse this xml, the configuration item in xml is read in into internal memory, use for application server.As parameter is to write on local xml In file, it is an operation for comparing consuming performance to flow reading by IO;In addition, after reading xml, parsing xml is also a consumption Take the operation of performance.If configuration parameter is relatively more, loading procedure is slower.
The content of the invention
The application provides a kind of method and apparatus of easy to operate application deployment server parameter, server parameter plus Load is dynamic, be independent of the startup of server, it is to avoid the interruption of business, can be according to need after server parameter memory-resident To change at any time.
A kind of method that need not restart deployment server parameter of the application, including:
Step 100, distributes memory space in the server, and server parameter is write the memory space;
Step 110, during startup of server is loaded onto the server parameter in server memory;
Step 120, accesses the memory space and the server parameter is redeployed.
As a kind of preferred mode, in step 100, the method that server parameter writes memory space is included:
Step 101, creates some static variables in memory space, one a pair of these static variables and server parameter Should;
Step 102, assigns initial value to the static variable, and the initial value is current server parameter.
The setting of the static variable can utilize existing multiple programs language and programming mode to realize, preferred Java languages Speech, can be such that application program operationally facilitates using Java static variables and read, and configurator easily operationally can enter Row modification, Java static variables also will not be reclaimed by Java Garbage Collectors in server run duration.
Memory space described here both can be understood as the space in the hardware store medium of server, it is understood that For system program, memory space is interpreted as system program and these static variables, certain system program is set in system program Code be also intended to rely on hardware store medium depositing.
As another kind of preferred mode, in step 100, the method that server parameter writes memory space is included:
Step 103, creates container in memory space;
Step 104, current server parameter is stored in the container.
Described container can using the program creation such as Java or C++, can for example adopt List containers in Java, Map containers etc..
Preferably, the container is map containers, the default parameterss of current server are stored in the form of key/value pair In the map containers.Used in map containers, unique keyword is searched by " key " corresponding mapping corresponding value The modification of " value " convenient service device parameter.
The server parameter is loaded onto in server memory during startup of server in step 110, when need change When certain or multiple server parameters, as long as new value is assigned to corresponding static variable or key/value pair, server parameter Change just comes into force, and server also can perceive the conversion of server parameter the very first time, accurate and efficient.
When accessing the memory space in the step 120, it is possible to use corresponding program or function reading or change are It is easy to operation, preferably, the step 120 is specifically included:
Step 121, creates the configuration parameter page;
Step 122, reads the server parameter in the memory space;
Step 123, the server parameter for reading is shown in the configuration parameter page;
Step 124, redeploys to the server parameter on the configuration parameter page;
Step 125, the server parameter after redeploying is stored to the memory space.
In the step 120, man-machine interaction is easily facilitated using the configuration parameter page, server parameter is either with quiet The mode of state variable, or easily can be read by corresponding program or function in the form of key/value pair, it is displayed in and matches somebody with somebody Put in parameter page.The data i.e. current server parameter in the configuration parameter page are read, then by configuration parameter Page input needs the value of modification, finally submits to service device to store again to the memory space.
The application need not restart the method for deployment server parameter than passing through xml reading speeds faster in prior art, nothing Server need to be restarted, when the assignment operation to associated static variable or key/value pair is completed, server parameter has also been updated Complete to redeploy.
Present invention also provides a kind of device that need not restart deployment server parameter, including:
Server parameter, for distributing memory space in the server, is write the memory space by parameter memory module;
Parameter load-on module, for the server parameter being loaded onto in server memory during startup of server;
Parameter adapting module, for accessing the memory space and redeploying to the server parameter.
Used as a kind of preferred mode, the parameter memory module includes:
Space distribute module, for distributing memory space in the server;
Parameter read-in module, for server parameter is write the memory space.
Wherein described parameter read-in module includes:
Static variable creation module, for some static variables are created in memory space, these static variables and service Device parameter is corresponded;
Static variable assignment module, for assigning initial value to the static variable, the initial value is current server ginseng Number.
Used as another kind of preferred mode, the parameter memory module includes:
Space distribute module, for distributing memory space in the server;
Parameter read-in module, for server parameter is write the memory space.
Wherein described parameter read-in module includes:
Container creation module, for container is created in memory space;
Container assignment module, for current server parameter is stored in the container.
The parameter adapting module includes:
Creation module, for creating the configuration parameter page;
Read module, for reading the server parameter in the memory space;
Display module, for the server parameter for reading is shown in the configuration parameter page;
Deployment module, for redeploying to the server parameter on the configuration parameter page;
Memory module, for the server parameter after redeploying is stored to the memory space.
The application need not be restarted the method and apparatus of deployment server parameter and be make use of static variable or container storage service Device parameter, especially in startup of server, server parameter is loaded onto in server memory, is not related to during reading service device parameter And the operation of IO streams and xml parsing operations, improve the speed of reading.The storage mode and characteristic of server parameter in the application It is easy to change, completes after modification and restart deployment, it is not necessary to restart server.
Description of the drawings
Fig. 1 is the method flow diagram that the application need not restart deployment server parameter;
Fig. 2 is that the application need not be restarted A kind of mode flow chart;
Fig. 3 is that the application need not be restarted Two kinds of mode flow charts;
Fig. 4 is to access memory space during the application need not restart the method for deployment server parameter and server parameter is done The flow chart for redeploying;
Fig. 5 is the schematic device (the first embodiment) that the application need not restart deployment server parameter;
Fig. 6 is the schematic device (second embodiment) that the application need not restart deployment server parameter.
Specific embodiment
Technical scheme is conducted further description below in conjunction with accompanying drawing.
Referring to Fig. 1, a kind of method that need not restart deployment server parameter of the application, including:
Step 100, distributes memory space in the server, server parameter is write the memory space, is specifically included:
Referring to Fig. 2, step 101, some static variables are created in memory space, the setting of static variable can be using existing There are multiple programs language and programming mode to realize, by taking Java as an example, define one or more public (public) first static (static) variable, defined static variable and server parameter are corresponded.
For example, with regard to the visual attribute of certain classification webpage, when server parameter is set as true, then clothes are accessed for all Browsable such webpage of user of business device, when server parameter is set as fasle, user's then not browsable such webpage, then The visual attribute of category webpage can be set as a static variable, its value can be true or fasle.
Step 102, assigns initial value to static variable, and in current server parameter, visual attribute is true, then static The initial value of number variable is true.
Herein, another embodiment of step 100 is additionally provided, referring to Fig. 3, is now specifically included in step 100:
Step 103, creates container in memory space;Container adopts the map containers in Java herein,
Step 104, current server parameter is stored in map containers.
The default parameterss of such as current server are:Visual attribute-the true of webpage, then the visual attribute of webpage/ True is stored in the map containers in the form of key/value pair, and used in map containers, unique keyword is corresponding to map Value, searches the search and modification of corresponding " true " convenient service device parameter by " visual attribute of webpage ".
The life cycle of the memory space of server is the life cycle identical with server component, when application program is needed When wanting reading service device parameter, corresponding value is obtained according to server parameter name by Map containers, it is also possible to by parameter Name arranges new value, to reach identical purpose.Because Map containers itself are a dynamic containers, can be according to a unique key Multiple parameters, and corresponding value are placed, so as to effectively reduce the definition quantity of parameter.
Step 110, during startup of server is loaded onto server parameter in server memory;When need change certain or it is many When individual server parameter, as long as new value is assigned to corresponding static variable or key/value pair, the change of server parameter is just stood Come into force.
Step 120, accesses memory space and server parameter is redeployed.When accessing memory space, it is possible to use Corresponding program or function referring to Fig. 4, are specifically included reading or change:
Step 121, creates the configuration parameter page, the configuration parameter page can adopt be easy to the window that recognizes and operate or The various ways such as list.
Step 122, reads the server parameter in memory space;
Step 123, the server parameter for reading is shown in the configuration parameter page, for example, read static variable " visual attribute of webpage " and its value " true " shown in the configuration parameter page, using the configuration parameter page more just In man-machine interaction, server parameter is either in the way of static variable, or easily can be led in the form of key/value pair Cross corresponding program or function to read, be displayed in the configuration parameter page.
Step 124, redeploys to server parameter on the configuration parameter page;Read the configuration parameter page In data i.e. current server parameter, by the configuration parameter page be input into need modification value, will " webpage it is visible The value of attribute " is revised as " fasle "
Step 125, the server parameter after redeploying is stored to memory space, if there is application program to open, its The server parameter for calling has been then the new value after redeploying.
As the value of " visual attribute of webpage " is " fasle ", therefore, now user cannot browse such net Page.
Based on above method, present invention also provides a kind of device that need not restart deployment server parameter, referring to Fig. 5, Including:
Server parameter, for distributing memory space in the server, is write the storage empty by parameter memory module 200 Between;
Parameter load-on module 210, for the server parameter being loaded onto in server memory during startup of server;
Parameter adapting module 220, for accessing the memory space and redeploying to the server parameter.
Used as a kind of specific embodiment, parameter memory module 200 includes:
Space distribute module 201, for distributing memory space in the server;
Parameter read-in module 202, for server parameter is write the memory space.
Wherein parameter read-in module 202 includes:
Static variable creation module 2021, for some static variables are created in memory space, these static variables and Server parameter is corresponded;
Static variable assignment module 2022, for assigning initial value to the static variable, the initial value is current service Device parameter.
Used as another kind of specific embodiment, referring to Fig. 6, parameter memory module 200 includes:
Space distribute module 203, for distributing memory space in the server;
Parameter read-in module 204, for server parameter is write the memory space.
Wherein parameter read-in module 204 includes:
Container creation module 2041, for container is created in memory space;
Container assignment module 2042, for current server parameter is stored in the container.
Parameter adapting module 220 includes:
Creation module 221, for creating the configuration parameter page;
Read module 222, for reading the server parameter in the memory space;
Display module 223, for the server parameter for reading is shown in the configuration parameter page;
Deployment module 224, for redeploying to the server parameter on the configuration parameter page;
Memory module 225, for the server parameter after redeploying is stored to the memory space.
The application need not restart the method and apparatus of deployment server parameter than passing through xml reading speeds more in prior art Hurry up, server need not be restarted, when the assignment operation to associated static variable or key/value pair is completed, server parameter is also It is updated and completes to redeploy.
Modules in the application device can be integrated in one, it is also possible to be deployed separately, or be further split into many Individual submodule.Modules can be distributed in the system of embodiment according to embodiment description, it is also possible to carry out respective change position In one or more systems different from the present embodiment.
Those skilled in the art should be understood that embodiments herein can be provided becomes method, system or computer journey Sequence product.Therefore, the application can adopt complete hardware embodiment, complete software embodiment or with reference to software and hardware in terms of The form of embodiment.
Each module or each step of the application can realize with general computing device that alternatively, they can use tricks Calculate the executable program code of device to realize, perform such that it is able to be stored in storage device by computing device, Or they are fabricated to each integrated circuit modules respectively, or the multiple modules or step in them are fabricated to into single collection Realize into circuit module.Therefore, the application is not restricted to any specific hardware and software combination.
Disclosed above is only the specific embodiment of the application, but the application is not limited to this, the technology of this area Personnel can carry out various changes and modification without deviating from spirit and scope to the application.Obviously these are changed and become Type all should belong to this application claims protection domain protection in.

Claims (10)

1. a kind of method that need not restart deployment server parameter, it is characterised in that include:
Step 100, distributes memory space in the server, and server parameter is write the memory space;Wherein, server is joined Number writes the memory space, including:Some static variables are created in memory space, these static variables and server parameter one One correspondence, or map containers are created in memory space, and server parameter is stored in the form of key/value pair the map In container;
Step 110, during startup of server is loaded onto the server parameter in server memory;
Step 120, accesses the memory space and the server parameter is redeployed, including:The server is joined Several new values are assigned to corresponding static variable or key/value pair.
2. server parameter is write the side of memory space by the method for claim 1, it is characterised in that in step 100 Method includes:
Step 101, creates some static variables in memory space, and these static variables and server parameter are corresponded;
Step 102, assigns initial value to the static variable, and the initial value is current server parameter.
3. server parameter is write the side of memory space by the method for claim 1, it is characterised in that in step 100 Method includes:
Step 103, creates container in memory space;
Step 104, current server parameter is stored in the container.
4. method as claimed in claim 3, it is characterised in that the container is map containers, the default parameterss of current server It is stored in the form of key/value pair in the map containers.
5. the method as described in any one of Claims 1 to 4, it is characterised in that the step 120 is specifically included:
Step 121, creates the configuration parameter page;
Step 122, reads the server parameter in the memory space;
Step 123, the server parameter for reading is shown in the configuration parameter page;
Step 124, redeploys to the server parameter on the configuration parameter page;
Step 125, the server parameter after redeploying is stored to the memory space.
6. a kind of device that need not restart deployment server parameter, it is characterised in that include:
Server parameter, for distributing memory space in the server, is write the memory space by parameter memory module;Wherein, Server parameter is write into the memory space, including:Some static variables are created in memory space, these static variable kimonos Business device parameter is corresponded, or map containers are created in memory space, and server parameter is stored up in the form of key/value pair It is stored in the map containers;
Parameter load-on module, for the server parameter being loaded onto in server memory during startup of server;
Parameter adapting module, for accessing the memory space and the server parameter being redeployed, including:Will be described The new value of server parameter is assigned to corresponding static variable or key/value pair.
7. device as claimed in claim 6, it is characterised in that the parameter memory module includes:
Space distribute module, for distributing memory space in the server;
Parameter read-in module, for server parameter is write the memory space.
8. device as claimed in claim 7, it is characterised in that the parameter read-in module includes:
Static variable creation module, for some static variables are created in memory space, these static variables and server are joined Number is corresponded;
Static variable assignment module, for assigning initial value to the static variable, the initial value is current server parameter.
9. device as claimed in claim 7, it is characterised in that the parameter read-in module includes:
Container creation module, for container is created in memory space;
Container assignment module, for current server parameter is stored in the container.
10. the device as described in any one of claim 6~9, it is characterised in that the parameter adapting module includes:
Creation module, for creating the configuration parameter page;
Read module, for reading the server parameter in the memory space;
Display module, for the server parameter for reading is shown in the configuration parameter page;
Deployment module, for redeploying to the server parameter on the configuration parameter page;
Memory module, for the server parameter after redeploying is stored to the memory space.
CN201210402186.4A 2012-10-19 2012-10-19 Server parameter deploying method and device with no need for restarting Active CN103777969B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210402186.4A CN103777969B (en) 2012-10-19 2012-10-19 Server parameter deploying method and device with no need for restarting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210402186.4A CN103777969B (en) 2012-10-19 2012-10-19 Server parameter deploying method and device with no need for restarting

Publications (2)

Publication Number Publication Date
CN103777969A CN103777969A (en) 2014-05-07
CN103777969B true CN103777969B (en) 2017-04-12

Family

ID=50570250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210402186.4A Active CN103777969B (en) 2012-10-19 2012-10-19 Server parameter deploying method and device with no need for restarting

Country Status (1)

Country Link
CN (1) CN103777969B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808287B (en) * 2016-02-25 2019-06-18 网宿科技股份有限公司 A kind of method and system for restarting network service
CN107357598A (en) * 2016-05-09 2017-11-17 中兴通讯股份有限公司 One parameter configuration method and device
CN108008981B (en) * 2016-10-27 2020-12-08 海信视像科技股份有限公司 Method and device for initializing program in system on chip (SoC)
CN108132807B (en) * 2016-12-01 2021-04-09 北京云中融信网络科技有限公司 Parameter loading method and device
CN106776166B (en) * 2016-12-06 2020-02-07 郑州云海信息技术有限公司 Method and system for testing Ceph storage cluster in RDMA (remote direct memory Access) mode
CN107465738A (en) * 2017-08-01 2017-12-12 深圳市金立通信设备有限公司 A kind of communication means, server and computer-readable recording medium
CN111104133A (en) * 2018-10-25 2020-05-05 深圳市茁壮网络股份有限公司 Configuration parameter updating system, method and storage medium
CN109614139A (en) * 2018-12-13 2019-04-12 浪潮(北京)电子信息产业有限公司 A kind of system service configuration method, device, equipment and medium
CN109753320B (en) * 2019-01-03 2022-02-22 中国银行股份有限公司 Application parameter processing method and device
CN110187928A (en) * 2019-04-25 2019-08-30 平安科技(深圳)有限公司 Method, apparatus, equipment and the storage medium that JAVA cluster configuration item comes into force in real time

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6243753B1 (en) * 1998-06-12 2001-06-05 Microsoft Corporation Method, system, and computer program product for creating a raw data channel form an integrating component to a series of kernel mode filters
CN1410890A (en) * 2001-10-08 2003-04-16 联想(北京)有限公司 Method of operating netcard nucleus driving program under user's mode
CN101183972A (en) * 2007-11-16 2008-05-21 中兴通讯股份有限公司 Method for remote control startup of server
CN102467412A (en) * 2010-11-16 2012-05-23 金蝶软件(中国)有限公司 Method, device and business system for processing operation request
CN102999362A (en) * 2012-12-04 2013-03-27 浪潮电子信息产业股份有限公司 Method for modifying sequence of boot options of basic input/output system (BIOS)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6243753B1 (en) * 1998-06-12 2001-06-05 Microsoft Corporation Method, system, and computer program product for creating a raw data channel form an integrating component to a series of kernel mode filters
CN1410890A (en) * 2001-10-08 2003-04-16 联想(北京)有限公司 Method of operating netcard nucleus driving program under user's mode
CN101183972A (en) * 2007-11-16 2008-05-21 中兴通讯股份有限公司 Method for remote control startup of server
CN102467412A (en) * 2010-11-16 2012-05-23 金蝶软件(中国)有限公司 Method, device and business system for processing operation request
CN102999362A (en) * 2012-12-04 2013-03-27 浪潮电子信息产业股份有限公司 Method for modifying sequence of boot options of basic input/output system (BIOS)

Also Published As

Publication number Publication date
CN103777969A (en) 2014-05-07

Similar Documents

Publication Publication Date Title
CN103777969B (en) Server parameter deploying method and device with no need for restarting
KR102157925B1 (en) Data query method and apparatus
CN103677654B (en) The method and electronic equipment of a kind of data storage
CN112905595A (en) Data query method and device and computer readable storage medium
CN104714828A (en) Methods and devices for installing and operating application
CN103064717B (en) A kind of apparatus and method of parallel installation of software for cluster system
CN104199684B (en) The implementation method and device of browser cold start-up
US10025630B2 (en) Operating programs on a computer cluster
CN106970958B (en) A kind of inquiry of stream file and storage method and device
CN103699674A (en) Webpage storing method, webpage opening method, webpage storing device, webpage opening device and webpage browsing system
US11308066B1 (en) Optimized database partitioning
CN105677904B (en) Small documents storage method and device based on distributed file system
CN109408493A (en) A kind of moving method and system of data source
US8793250B1 (en) Flexible partitioning of data
CN110427364A (en) A kind of data processing method, device, electronic equipment and storage medium
CN103279489A (en) Method and device for storing metadata
CN107071007A (en) A kind of method, device and client for obtaining configuration resource
US10757190B2 (en) Method, device and computer program product for scheduling multi-cloud system
CN103942301A (en) Distributed file system oriented to access and application of multiple data types
CN107844519A (en) Electronic installation, data base querying scenario generation method and storage medium
CN102929943B (en) data output method and device
CN110096515A (en) A kind of RDF data management method, device and storage medium based on triple
CN107493200B (en) Optical disc image file creating method, virtual machine deploying method and device
CN103744882A (en) Catalogue fragment expressing method and device based on key value pair
CN102053855A (en) Software generation system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant