The content of the invention
Wiring method and device it is a primary object of the present invention to provide configuration file in a kind of distributed file system,
It is intended to reduce the difficulty read and edit configuration file.
To achieve the above object, the wiring method of configuration file, institute in a kind of distributed file system that the present invention is provided
The wiring method for stating configuration file in distributed file system comprises the following steps:
Write request is initiated to server, and receives the server to ask the write-in beamed back to be approved to ring according to said write
Should;
Obtain the configuration information of user input;
The configuration information is write into the server, and according to the server according to matching somebody with somebody that the configuration information is generated
File is put to be operated.
Preferably, the configuration information includes:
Global sections global sections described with write-in the first configuration data interior and for being come into force in the system overall situation;
Mon. the first id sections, host name where mon, IP, port numbers and in the mon finger daemons of an id
The second configuration data for coming into force;
Osd. the 2nd id sections, host name, drive name where osd and come into force in the osd finger daemons of the 2nd id
The 3rd configuration data;
Mds. the 3rd id sections, the host name where mds and come into force in the mds finger daemons of the 3rd id
Four configuration datas.
Preferably, also include before the write-in server by the configuration information:
User is obtained in the configuration information for the descriptive information of configuration data addition.
Preferably, the descriptive information for obtaining user for configuration data addition in the configuration information is specifically wrapped
Include:
Obtain the explanation that user writes configuration information described in periphery in the " # " of the first write-in of independently row and in the row
Information;And/or
Obtain user write after the configuration data ";" and in the row ";" configuration information is write afterwards
Descriptive information.
Preferably, also include in the configuration information with mon finger daemons, osd finger daemons and mds finger daemons extremely
The corresponding system identification SID of one item missing.
The present invention also provides a kind of writing station of configuration file in distributed file system, the distributed file system
File writing station include:
Initiation module, for initiating write request to server;
Receiver module, response is approved for receiving the server according to the write-in that said write request is beamed back;
First acquisition module, the configuration information for obtaining user input;
Writing module, for the configuration information to be write into the server;
Operational module, for being operated according to the configuration file that the configuration information is generated according to the server.
Preferably, the configuration information includes:
Global sections global sections described with write-in the first configuration data interior and for being come into force in the system overall situation;
Mon. the first id sections, host name where mon, IP, port numbers and in the mon finger daemons of an id
The second configuration data for coming into force;
Osd. the 2nd id sections, host name, drive name where osd and come into force in the osd finger daemons of the 2nd id
The 3rd configuration data;
Mds. the 3rd id sections, the host name where mds and come into force in the mds finger daemons of the 3rd id
Four configuration datas.
Preferably, the writing station of configuration file also includes in the distributed file system:Second acquisition module, is used for
User is obtained in the configuration information for the descriptive information of configuration data addition.
Preferably, second acquisition module specifically for
Obtain the explanation that user writes configuration information described in periphery in the " # " of the first write-in of independently row and in the row
Information;Or
Obtain user write after the configuration data ";" and in the row ";" configuration information is write afterwards
Descriptive information.
Preferably, also include in the configuration information with mon finger daemons, osd finger daemons and mds finger daemons extremely
The corresponding system identification SID of one item missing.
Configuration file of the invention can be used to configure all finger daemons in storage cluster, or a certain type therein
All finger daemons, or certain specific finger daemon;When starting distributed file system, each finger daemon is all from same
Its corresponding configuration is searched in configuration file, and can enter correspondence configuration data in any one row write of configuration file when needed
Description, be easy to read configuration file difficulty.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of wiring method of configuration file in distributed file system, Fig. 1 is refer to, in an embodiment
In, the wiring method of configuration file includes in the distributed file system:
Step S10, initiates write request, and receive the server according to writing that said write request is beamed back to server
Enter to be approved response;
The wiring method of configuration file can be client to clothes in distributed file system provided in an embodiment of the present invention
Business device is write, or server writes to server, can be communicated with the server and with reading
Write the device of function.
When user needs to write the configuration file of the server, asking for write-in is initiated to the server first
Ask, the server according to condition adjudgement whether allow write-in, allow write-in in the case of beam back write-in be approved respond to
User.
Step S20, obtains the configuration information of user input;
Configuration information of the user to writing on a visual interface is input into.The configuration of the distributed document
File format includes that a multiple name sections for file can be combined into:Global sections, osd sections, mon sections and mds sections, wherein,
It is described global sections, the described global sections finger daemon that can influence whole in the distributed file system;Described osd sections,
The described mon sections and described mds sections finger daemon for influenceing corresponding types in the distributed file system respectively.The present embodiment
In, the configuration information includes:
Global sections global sections described with write-in the first configuration data interior and for being come into force in the system overall situation;
Mon. the first id sections, host name where mon, IP, port numbers and in the mon finger daemons of an id
The second configuration data for coming into force;
Osd. the 2nd id sections, host name, drive name where osd and come into force in the osd finger daemons of the 2nd id
The 3rd configuration data;
Mds. the 3rd id sections, the host name where mds and come into force in the mds finger daemons of the 3rd id
Four configuration datas.
Additionally, the configuration file format also includes simplifying metavariable $ type, $ host, $ id and the $ name of configuration, its
In, one in $ type deployable mds, osd and mon, depending on the type according to current finger daemon;$ host are expanded into currently
The host name of finger daemon;$ id expand into the identifier of finger daemon;$ name expand into $ type. $ id.Metavariable is significantly simple
Cluster configuration is changed, the metavariable of configuration can be expanded into occurrence by distributed file system.
In the present embodiment, when the configuration file is configured just for specific finger daemon, the configuration file lattice
Formula is made up of the finger daemon and ID.The ID represents that alphabetic ranges are a-z, and digital scope is 0- by letter and/or numeral
9。
When the form of the configuration file is set, multiple name sections distinguish different type in the form of being segmented respectively
The configuration of object, each name section monopolizes a line and name section is surrounded by " [] ", such as [global].By this side
Formula causes to be better seen when reading, and is also become apparent between every section.
There is no an obvious end mark for a section, section start be exactly a upper section end mark.For example include
Tri- sections of A, B, C is arranged in order, A is not over symbol, and A terminates automatically when B starts after segmentation, and similarly B is not over symbol, in segmentation
B terminates automatically when C starts afterwards.Except in the case of system default, or when starting for one section, system is upper one automatically
Duan Tianjia end marks.The present invention does not limit which kind of mode used, as long as such effect can be reached.
Every section includes specific configuration information parameter, and the configuration information parameter includes a title and value, the configuration
The specific form of information parameter is:Title=value, such as name1=value1.
Step S30, the server is write by the configuration information, and according to the server according to the configuration information
The configuration file of generation is operated.
After user finishes to configuration information input, the configuration information is write into the server.The service
Device generates corresponding configuration file according to the configuration information, and the whole distributed file system is according to the configuration file
It is operated.
Configuration file in the present embodiment can be used to configure all finger daemons in storage cluster, or therein a certain
All finger daemons of type, or certain specific finger daemon;Start distributed file system when, each finger daemon all from
Its corresponding configuration is searched in same configuration file, the flexibility configured to finger daemon is improve, and by metavariable
Enormously simplify cluster configuration.
Further, in order to better discriminate between each finger daemon, in the present embodiment, can also be in the configuration information
Middle write-in includes and at least one corresponding system identification in mon finger daemons, osd finger daemons and mds finger daemons
SID。
The present invention in each configuration information by writing unique corresponding system identification SID so that system can be more preferable
Ground confirms the finger daemon corresponding to configuration information, it is to avoid occur mismatching situation about putting, and influences whole distributed file system
Use.
Further, refer to Fig. 2, based in distributed file system of the present invention the wiring method of file format it is above-mentioned
Embodiment, in distributed file system of the present invention in another embodiment of the wiring method of file format, before the step S30
Also include:
Step S40, obtains user in the configuration information for the descriptive information of configuration data addition.
The step S40 is between the step S20 and the step S30.
When the configuration data in the configuration information of user input is excessively complicated, it is necessary to be said to the configuration data
Bright, the explanation is not worked in the server generation configuration file after, but described matching somebody with somebody can be carried out to reader
Put the explanation of data.
The descriptive information that user is obtained for configuration data addition in the configuration information is specifically included:Obtain and use
Family writes the descriptive information of configuration information described in periphery in the " # " of the first write-in of independently row and in the row, using this kind of side
Formula can be illustrated to the whole section of configuration information of up or down;With obtain user write after the configuration data ";”、
And in the row ";" descriptive information of the configuration information is write afterwards, can be to the institute where the row using this kind of mode
State configuration confidence to illustrate, the two can be used alone can also be used in conjunction with.
The present invention also provides a kind of writing station of configuration file in distributed file system, the distributed file system
The writing station 100 of middle configuration file includes:
Initiation module 10, for initiating write request to server;
The wiring method of configuration file can be client to clothes in distributed file system provided in an embodiment of the present invention
Business device is write, or server writes to server, can be communicated with the server and with reading
Write the device of function.
After the demand of the oriented server write-in configuration information of user, the request of write-in is initiated to the server.
Receiver module 20, response is approved for receiving the server according to the write-in that said write request is beamed back;
Whether the server allows write-in according to condition adjudgement, and the sound that write-in is approved is beamed back in the case where write-in is allowed
User should be given.
First acquisition module 30, the configuration information for obtaining user input;
Configuration information of the user to writing on a visual interface is input into.The configuration of the distributed document
File format includes that a multiple name sections for file can be combined into:Global sections, osd sections, mon sections and mds sections, wherein,
It is described global sections, the described global sections finger daemon that can influence whole in the distributed file system;Described osd sections,
The described mon sections and described mds sections finger daemon for influenceing corresponding types in the distributed file system respectively.The present embodiment
In, the configuration information includes:
Global sections global sections described with write-in the first configuration data interior and for being come into force in the system overall situation;
Mon. the first id sections, host name where mon, IP, port numbers and in the mon finger daemons of an id
The second configuration data for coming into force;
Osd. the 2nd id sections, host name, drive name where osd and come into force in the osd finger daemons of the 2nd id
The 3rd configuration data;
Mds. the 3rd id sections, the host name where mds and come into force in the mds finger daemons of the 3rd id
Four configuration datas.
Additionally, the configuration file format also includes simplifying metavariable $ type, $ host, $ id and the $ name of configuration, its
In, one in $ type deployable mds, osd and mon, depending on the type according to current finger daemon;$ host are expanded into currently
The host name of finger daemon;$ id expand into the identifier of finger daemon;$ name expand into $ type. $ id.Metavariable is significantly simple
Cluster configuration is changed, the metavariable of configuration can be expanded into occurrence by distributed file system.
In the present embodiment, when the configuration file is configured just for specific finger daemon, the configuration file lattice
Formula is made up of the finger daemon and ID.The ID represents that alphabetic ranges are a-z, and digital scope is 0- by letter and/or numeral
9。
When the form of the configuration file is set, multiple name sections distinguish different type in the form of being segmented respectively
The configuration of object, each name section monopolizes a line and name section is surrounded by " [] ", such as [global].By this side
Formula causes to be better seen when reading, and is also become apparent between every section.
There is no an obvious end mark for a section, section start be exactly a upper section end mark.For example include
Tri- sections of A, B, C is arranged in order, A is not over symbol, and A terminates automatically when B starts after segmentation, and similarly B is not over symbol, in segmentation
B terminates automatically when C starts afterwards.Except in the case of system default, or when starting for one section, system is upper one automatically
Duan Tianjia end marks.The present invention does not limit which kind of mode used, as long as such effect can be reached.
Every section includes specific configuration information parameter, and the configuration information parameter includes a title and value, the configuration
The specific form of information parameter is:Title=value, such as name1=value1.
Writing module 40, for the configuration information to be write into the server;
After user finishes to configuration information input, the configuration information is write into the server.
Operational module 50, for being operated according to the configuration file that the configuration information is generated according to the server.
The server generates corresponding configuration file according to the configuration information, the whole distributed file system
It is operated according to the configuration file.
Configuration file in the present embodiment can be used to configure all finger daemons in storage cluster, or therein a certain
All finger daemons of type, or certain specific finger daemon;Start distributed file system when, each finger daemon all from
Its corresponding configuration is searched in same configuration file, the flexibility configured to finger daemon is improve, and by metavariable
Enormously simplify cluster configuration.
Further, in order to better discriminate between each finger daemon, in the present embodiment, can also be in the configuration information
Middle write-in includes and at least one corresponding system identification in mon finger daemons, osd finger daemons and mds finger daemons
SID。
The present invention in each configuration information by writing unique corresponding system identification SID so that system can be more preferable
Ground confirms the finger daemon corresponding to configuration information, it is to avoid occur mismatching situation about putting, and influences whole distributed file system
Use.
Further, above-described embodiment based on the wiring method of file format in distributed file system of the present invention, this
In invention distributed file system in another embodiment of the wiring method of file format, configured in the distributed file system
The writing station 100 of file also includes:
Second acquisition module 60, obtains user in the configuration information for the descriptive information of configuration data addition.
When the configuration data in the configuration information of user input is excessively complicated, it is necessary to be said to the configuration data
Bright, the explanation is not worked in the server generation configuration file after, but described matching somebody with somebody can be carried out to reader
Put the explanation of data.
The descriptive information that user is obtained for configuration data addition in the configuration information is specifically included:Obtain and use
Family writes the descriptive information of configuration information described in periphery in the " # " of the first write-in of independently row and in the row, using this kind of side
Formula can be illustrated to the whole section of configuration information of up or down;With obtain user write after the configuration data ";”、
And in the row ";" descriptive information of the configuration information is write afterwards, can be to the institute where the row using this kind of mode
State configuration confidence to illustrate, the two can be used alone can also be used in conjunction with.
The preferred embodiments of the present invention are these are only, the scope of the claims of the invention is not thereby limited, it is every to utilize this hair
Equivalent structure or equivalent flow conversion that bright specification and accompanying drawing content are made, or directly or indirectly it is used in other related skills
Art field, is included within the scope of the present invention.