Setup GeoServer locally - AtlasOfLivingAustralia/biocollect GitHub Wiki

Introduction

In order for BioCollect to show projects on map in project finder or activities on map in data pages like all records, you need to setup GeoServer. This article explains how to get it running on your local machine.

Requirements

BioCollect - 5.2-SNAPSHOT (Grails 3)
Ecodata - 2.0-SNAPSHOT (Grails 3) or 1.56-SNAPSHOT (Grails 2)
GeoServer - 2.7.4
ElasticGeo - 2.7.4

Getting it to work

Step 1. Download GeoServer and unzip it.

wget http://sourceforge.net/projects/geoserver/files/GeoServer/2.7.4/geoserver-2.7.4-bin.zip
unzip geoserver-2.7.4-bin.zip

Step 2. Download ElasticGeo extension

wget https://raw.githubusercontent.com/temi/elasticgeo/v2.7.4/gs-web-elasticsearch/target/elasticgeo2.7.4-gs2.7.4-es1.7.3.jar

Note: ElasticGeo extension's repo is here. However, it had to be extended to create connection to elasticsearch via REST API. The extended version is used above.

Step 3. Make ElasticGeo extension accessible to GeoServer.

cp ~/elasticgeo2.7.4-gs2.7.4-es1.7.3.jar ~/geoserver-2.7.4-bin/webapps/geoserver/WEB-INF/lib/

Step 4. Add a variable to startup.sh file

vi ~/geoserver-2.7.4-bin/bin/startup.sh

Add below line

export GEOSERVER_XSTREAM_WHITELIST=mil.nga.giat.data.elasticsearch.ElasticAttribute

Step 5. Start GeoServer

cd ~/geoserver-2.7.4-bin/bin/
./startup.sh

Step 6. Update Ecodata config.

geoServer.enabled=true
geoServer.baseURL=http://localhost:8081/geoserver
geoServer.username=admin
geoServer.password=geoserver
elasticsearch.local=false

The above statements enable connection to GeoServer. And, make GeoServer discover elasticsearch.