Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
./conf-publisher
Starting Configuration Publisher
-----------------------------------------------------------------------------------------------------------------
| Short | Long                                             | Description
-----------------------------------------------------------------------------------------------------------------

 -a,     --action <action-name>                             This is the name of the action to trigger
 -c,     --config <arg>                                     Configuration publisher spring configuration XML
                                                              Requirement Rules: 
                                                               [publish : OPTIONAL, clear : OPTIONAL, verify : 
                                                               OPTIONAL] 

                                                              Handler: 
                                                               Will invoke 'setConfig' on action selected, except 
                                                               for the following actions: [publish : 
                                                               setConfigFile, verify : setConfigFile, clear : 
                                                               setConfigFile] 

 -cs,    --connectString <arg>                              Connect String to Zookeeper (ip1:port1,ip2:port2,..)
                                                              Requirement Rules: 
                                                               [publish : REQUIRED, clear : REQUIRED, verify : 
                                                               REQUIRED] 

                                                              Handler: 
                                                               Will invoke 'setConnectString' on action selected, 
                                                               except for the following actions: [publish : 
                                                               setConnectString, verify : setConnectString, clear 
                                                               : setConnectString] 

 -hn,     --helpnotify                                           Notify the configuration managers' about the Printsconfiguration helpchange menu
 -psa,done
                                  --printSupportedActions                            PrintRequirement SupportedRules: Actions
-----------------
                                                               [publish : OPTIONAL, clear : OPTIONAL, verify : 
                                                               OPTIONAL] 
                                                              Handler: 
                                                               Will invoke 'setNotify' on action selected, except 
                                                               for the following actions: [publish : setNotify, 
                                                               verify : setNotify, clear : setNotify] 
 -h,     --help                                             Prints help menu
 -psa,   --printSupportedActions                            Print Supported Actions
-----------------------------------------------------------------------------------------------------------------

As shown above, the CLI provides 3 major functions,3 major functions,

  • publish - Stores configuration specified in the config-publisher.xml in zookeeper
  • verify - Verifies whether the content stored in zookeeper are identical to the content in the configuration files (original files which we just published to zookeeper) stored locally.
  • clear - Removes any configuration data stored in zookeeper. This will delete only the configuration stored in zookeeper using the same publish - Stores configuration specified in the config-publisher.xml in zookeeper
  • verify - Verifies whether the content stored in zookeeper are identical to the content in the configuration files (original files which we just published to zookeeper) stored locally.
  • clear - Removes any configuration data stored in zookeeper. This will delete only the configuration stored in zookeeper using the same config-publisher.xml. Therefore, users do not have to worry about all configuration being removed from zookeeper.
  • Therefore, users do not have to worry about all configuration being removed from zookeeper.

Additionally, with the -n/-notify option, the configuration change that is being done by one of the above actions (only publish and clear) will be notified to the corresponding components of the same project. That is, if the configuration for file managers are to be published, by adding the -n option to the command, all the file managers belonging to the corresponding project will be notified about the configuration change happened. Then they will download the latest configuration replacing the old versions.

Also note that we need to give the zookeeper connect string with the -connectString option to the CLI so that the CLI will know to which zookeeper ensemble to connect to. Our next step is running the conf-publisher. Executing 

...

You may have noted that the logs say "replacing existing file ...." several times. That is because, if the distributed configuration manager find a file with the same name at a location where a downloaded file to be stored, it will delete the existing file and create a new file with the downloaded content.

...

.

...