在官網(wǎng)下載geoserver-war.zip包后领铐,解壓有g(shù)eoserver.war,其中根目錄有data文件夾骇笔,拷貝出來放到指定部署的共享目錄下拉讯,然后再geoserver.war包的WEB-INF/web.xml文件里蛔趴,增加
<context-param>
<param-name>GEOSERVER_DATA_DIR</param-name>
<param-value>/{共享目錄}/data</param-value>
</context-param>
<context-param>
<param-name>GEOSERVER_REQUIRE_FILE</param-name>
<param-value>/{共享目錄}/data/global.xml</param-value>
</context-param>
多節(jié)點還會遇到默認日志重復讀寫導致無法正常記錄的問題挑辆,可另外增加GEOSERVER_LOG_LOCATION配置來指定不同目錄存放
<context-param>
<param-name>GEOSERVER_LOG_LOCATION</param-name>
<param-value>/{共享目錄}/data/logs/mylog1</param-value>
</context-param>