WebGIS项目移植


前2年做的WEBGIS的demo,基于openlayer3+geoserver+postgis,之前移植傻啦吧唧的每次移植都将图层重新发布一遍。

移植过程中,首先安装POSTGIS数据库,设置新密码,新密码可能与旧密码不一样。
然后部署GEOSERVER,运行GEOSERVER,发现数据库报错:
1、数据库IP换了
2、数据库密码换了等等
这时需要修改,比如我刚部署的新路径E:\BaiduNetdiskDownload\WebGIS\apache-tomcat-8.0.36\webapps\geoserver\data\workspaces\js\js\datastore.xml
修改host,passwd等配置参数,其中passwd加密处理过,此时我们可以在其他工作空间用新的数据库密码新建一个数据库连接,此时在对应的工作空间会生成相应的datastore.xml,将此文件中的passwd复制到需要修改的地方。
这时再重新启动geoserver,则环境移植完成了,可以跑相应的Demo啦!

<connectionParameters>
    <entry key="port">5432</entry>
    <entry key="Connection timeout">20</entry>
    <entry key="passwd">crypt1:w1bdOFdSYEifuA/166bIxg==</entry>
    <entry key="dbtype">postgis</entry>
    <entry key="encode functions">false</entry>
    <entry key="Evictor run periodicity">300</entry>
    <entry key="namespace">www.js.com</entry>
    <entry key="schema">public</entry>
    <entry key="create database">false</entry>
    <entry key="fetch size">1000</entry>
    <entry key="preparedStatements">false</entry>
    <entry key="min connections">1</entry>
    <entry key="Evictor tests per run">3</entry>
    <entry key="host">localhost</entry>
    <entry key="validate connections">true</entry>
    <entry key="max connections">10</entry>
    <entry key="database">postgres</entry>
    <entry key="Support on the fly geometry simplification">true</entry>
    <entry key="Max connection idle time">300</entry>
    <entry key="Test while idle">true</entry>
    <entry key="Loose bbox">true</entry>
    <entry key="Expose primary keys">false</entry>
    <entry key="Max open prepared statements">50</entry>
    <entry key="Estimated extends">true</entry>
    <entry key="user">postgres</entry>
  </connectionParameters>

转载自:https://blog.csdn.net/u012121187/article/details/81237220

You may also like...