从Geoserver导出图层配置

6

是否可以从Geoserver导出图层配置,并将其导入到另一台计算机上的Geoserver?每次切换计算机时都要设置图层,这需要很长时间。

4个回答

9
显然你不能这样做。唯一的方法是复制 data_dir 目录并替换新安装的 data_dir。然后当您启动 geoserver 时,您设置的图层配置应该会自动加载。

1
在一个新安装的geoserver机器上,如果数据目录中存储了加密密码的图层,则这些图层将无法正确加载。 - whatnick
“应该”是关键词。这个问题困扰了我很多年。在升级之前,一定要做一个基本的“复制”备份。我还开始使用多个实例,每个实例都有自己的子层集。小错误随着时间的推移会逐渐累积,在频繁编辑许多层时,很难缩小到单个有问题的层。对于小实例来说,将它们逐个带入新实例中然后销毁旧实例并不是什么大问题。 - Kevin

2
您可以使用Geoserver Manager(Geoserver rest-api的包装器)1来配置图层并存储过程。然后,您只需将Manager指向新的Geoserver即可。

1

对于将Geoserver 2.x迁移到Geoserver 2.y(使用Tomcat):

  1. Make a backup of your directory "data" of Geoserver 2.x.

  2. Stop Geoserver 2.x in Tomcat and then, stop Tomcat (sudo /etc/init.d/tomcatx stop).

  3. Remove (a backup is best) your directory "geoserver" of "webapps". (generally is tomcatx/webapps).

  4. Install the new version of Geoserver (in this case Geoserver 2.y). If you are using Tomcat, you could use the war file.

  5. Edit the file "web.xml" (tomcatx/webapps/geoserver/WEB-INF/web.xml) whit the new path. For example:

    <context-param>
        <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>/var/lib/tomcatx/webapps/geoserver/data</param-value>
    </context-param> 
    

    <context-param>
        <param-name>GEOSERVER_DATA_DIR</param-name>
        <param-value>new-path-of-data</param-value>
    </context-param> 
  1. 将你的新目录 "security" 移动到其他位置(通常是 tomcatx/webapps/geoserver/data/security)。

  2. 更改数据目录的权限为 tomcatx。(chgrp,chown)

  3. 重新启动 Tomcat。

此致敬礼。

Geoserver 2.x 是旧版本。

Geoserver 2.y 是新版本。

tomcatx 是您的 Tomcat 版本。


0
1.copy folder "data" in geoserver to on another computer and replace it to .war and geoserver folder

2-dump database old to new computer 

3-restart tomcat

/etc/init.d/tomcat7 restart

4-change owner "data" on geoserver to  tomcat user 

-cd 到 /var/lib/tomcat7/webapps/geoserver sudo chown -R tomcat7 data sudo chown -R :tomcat7 data

5-reload store on geoserver

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接