Skip to content

Single Node Dev VM

Andy Spohn edited this page Aug 2, 2015 · 18 revisions

Overview

This single node development VM configuration will enable you to see a functional GeoWave installation with a small amount of data from a shapefile loaded and layers configured in GeoServer.

Procedure

  1. Download the HDP 2.3 Sandbox VM, import and get it running

  2. Log into Ambari http://127.0.0.1:8080/ using admin/admin

  3. Add Accumulo service

    • Actions→Add Service and follow the wizard steps to install Accumulo

    • The script expects that the root user will have a password of admin

    • Set passwords and accept the defaults for the rest

    • Ensure the Accumulo and other services are running

  4. Run the HDP Sandbox GeoWave installation and configuration script

    • The root password to the VM is hadoop

    • The script will pause when creating the geowave Accumulo user. Set the password to geowave

  5. When the script completes you’ll be able to view ingested content on an OpenLayers map via WMS

HDP Sandbox GeoWave installation and configuration script

After Accumulo has been added to the HDP VM and all services are reporting as healthy copy the script below onto the VM and execute to finish configuration of Accumulo and install and configure the GeoWave components.

Note: During the Accumulo configuration portion the script will pause waiting for you to set the geowave user password. The script expects that you will set the account password to geowave.

#!/bin/bash
#
# Install GeoWave on Hortonworks Sandbox VM using RPMs and Puppet
#
# Assumptions:
#  - Your VM has a working Internet connection
#  - Your Accumulo root user account password has been set to admin
#  - When prompted by Accumulo you'll set the geowave user password to geowave
#
echo -e "\nStep 1 of 5: Installing GeoWave\n---------------------------------------\n"

rpm -Uvh http://s3.amazonaws.com/geowave-rpms/release/noarch/geowave-repo-1.0-3.noarch.rpm
yum -y --enablerepo=geowave install geowave-puppet
puppet module install puppetlabs-stdlib

# I use port 8993 as it's already configured in the VM port forwarding
# and not used by default. If you decide to use the solr service you'll
# have to pick a new unused port
cat << EOF > /tmp/geowave.pp
class { 'geowave::repo': repo_enabled => 1, } ->
class { 'geowave':
  geowave_version       => '0.8.8.1',
  hadoop_vendor_version => 'hdp2',
  install_accumulo      => true,
  install_app           => true,
  install_app_server    => true,
  http_port             => '8993',
}
EOF

puppet apply /tmp/geowave.pp

# Configure Accumulo - You will be prompted to create a password for the
# geowave user which you'll set to geowave
# Manual Steps Documentation: http://ngageoint.github.io/geowave/documentation.html#accumulo-configuration
echo -e "\nStep 2 of 5: Configuring Accumulo\n---------------------------------------\n"
cat << EOF > /tmp/accumulo-commands
createuser geowave
createnamespace geowave
grant NameSpace.CREATE_TABLE -ns geowave -u geowave
config -s general.vfs.context.classpath.geowave=hdfs://sandbox.hortonworks.com:8020/apps/accumulo/classpath/geowave/0.8.8.1-hdp2/[^.].*.jar
config -ns geowave -s table.classpath.context=geowave
exit
EOF

# This is assuming you set admin as the password of the root user when you
# configured the Accumulo service
accumulo shell -u root -p 'pass:admin' -fv /tmp/accumulo-commands

# Download a small data file and ingest
echo -e "\nStep 3 of 5: Ingesting Sample Data\n---------------------------------------\n"
curl http://naciscdn.org/naturalearth/50m/cultural/ne_50m_admin_0_countries.zip > /tmp/ne_50m_admin_0_countries.zip
mkdir /tmp/ingest; unzip -d /tmp/ingest/ /tmp/ne_50m_admin_0_countries.zip
geowave -localingest -b /tmp/ingest -i hdp-accumulo-instance -n geowave.50m_admin_0_countries -f geotools-vector -u geowave -p geowave -z sandbox.hortonworks.com:2181

# Configure GeoServer
echo -e "\nStep 4 of 5: Configuring GeoServer\n---------------------------------------\n"

cat << EOF > /tmp/geowave-datastore.xml
<dataStore>
  <name>geowave.50m_admin_0_countries</name>
  <type>GeoWave Datastore</type>
  <connectionParameters>
    <entry key="ZookeeperServers">sandbox.hortonworks.com:2181</entry>
    <entry key="Password">geowave</entry>
    <entry key="Namespace">geowave.50m_admin_0_countries</entry>
    <entry key="UserName">geowave</entry>
    <entry key="Authorization Management Provider">empty</entry>
    <entry key="Lock Management">memory</entry>
    <entry key="InstanceName">hdp-accumulo-instance</entry>
  </connectionParameters>
</dataStore>
EOF
curl -u admin:geoserver -XPOST -T /tmp/geowave-datastore.xml -H "Content-type: text/xml" http://localhost:8993/geoserver/rest/workspaces/geowave/datastores

cat << EOF > /tmp/ne_50m_admin_0_countries-layer.xml
<featureType>
  <name>ne_50m_admin_0_countries</name>
  <nativeCRS>GEOGCS[&quot;WGS 84&quot;,
    DATUM[&quot;World Geodetic System 1984&quot;,
    SPHEROID[&quot;WGS 84&quot;, 6378137.0, 298.257223563, AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],
    AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],
    PRIMEM[&quot;Greenwich&quot;, 0.0, AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],
    UNIT[&quot;degree&quot;, 0.017453292519943295],
    AXIS[&quot;Geodetic longitude&quot;, EAST],
    AXIS[&quot;Geodetic latitude&quot;, NORTH],
    AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</nativeCRS>
  <srs>EPSG:4326</srs>
  <nativeBoundingBox>
    <minx>-180.0</minx>
    <maxx>180.0</maxx>
    <miny>-90.0</miny>
    <maxy>90.0</maxy>
    <crs>EPSG:4326</crs>
  </nativeBoundingBox>
  <projectionPolicy>FORCE_DECLARED</projectionPolicy>
</featureType>
EOF
curl -u admin:geoserver -XPOST -T /tmp/ne_50m_admin_0_countries-layer.xml -H "Content-type: text/xml" http://localhost:8993/geoserver/rest/workspaces/geowave/datastores/geowave.50m_admin_0_countries/featuretypes

echo -e "\nStep 5 of 5: Layer Preview\n---------------------------------------\n"
echo -e "Open browser to - http://localhost:8993/geoserver/geowave/wms?service=WMS&version=1.1.0&request=GetMap&layers=geowave:ne_50m_admin_0_countries&styles=&bbox=-180.0,-90.0,180.0,90.0&width=768&height=384&srs=EPSG:4326&format=application/openlayers"