Apache Geode deploys configuration files as jar files

This section provides procedures and examples for deploying configuration files as jar files.

Process

 

  1. Package the file as a jar package.
  2. Set the Apache Geode system property to point to the file in the jar file.
  3. 把jar文件包括到你的类路径中。
  4. Verify that the copy of the file is the only copy of the file visible in the runtime application. The classpath is searched after searching elsewhere, so the file is not available in other search areas.
  5. Start your application and the configuration file in the jar file will be loaded.

Example of deployment configuration jar

The following example deploys the cache configuration file, in my.jarmyCache.xml。如下的显示为my.jar的内容:

% jar -tf my.jar
META-INF
META-INF/MANIFEST.MF
myConfig/
myConfig/myCache.xml

 

 

In this example, you should deploy the configuration jar file as follows:

  1. Set the system property, gemfire.cache-xml-file, tomyConfig/myCache.xml
  2. Setting the classpath includes my.jar.
  3. The current directory location of the file checks ./myConfig/myCache.xmlthat there is no file named myCache.xmlin .

When you start the application, the configuration files in the jar file will be loaded.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327040182&siteId=291194637