Skip to content

Commit 97275e7

Browse files
author
mcharles
committed
Create 2015-07-06-geomesa-HDP-deploy.md
1 parent 931258e commit 97275e7

File tree

1 file changed

+316
-0
lines changed

1 file changed

+316
-0
lines changed
Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
---
2+
title: Deploying GeoMesa on HDP Sandbox 2.2.4
3+
author: mcharles
4+
layout: tutorial
5+
---
6+
7+
{% include tutorial-header.html %}
8+
9+
##### This tutorial will introduce how to deploy GeoMesa on a Hortonworks Data Platform (HDP) virtual machine in six stages:
10+
11+
1. Mount HDP with VirtualBox
12+
2. Install Zookeeper & Accumulo
13+
3. Build GeoMesa
14+
4. Install Apache Tomcat 7
15+
5. Install GeoServer
16+
6. Deploy GeoMesa to GeoServerDeploy GeoMesa on a Hortonworks Data Platform (HDP) virtual machine
17+
18+
<!--more-->
19+
20+
21+
22+
<br>
23+
### Stage 1: Mount HDP on Virtual Machine
24+
25+
##### 1.1
26+
Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
27+
28+
##### 1.2
29+
Download [HDP 2.2.4](http://hortonworks.com/products/hortonworks-sandbox/#install) image for VirtualBox
30+
31+
Right-click the downloaded image and select "Open with VirtualBox"
32+
33+
##### 1.3
34+
Right-click the image in VirtualBox and selet 'Start'
35+
36+
<br>
37+
##### Stage 1 Checkpoint
38+
- Enter '127.0.0.1:8888' in browser and to be directed to the Hortnworks Sandbox registration page
39+
- Enter 'localhost:50070/dfshealth.jsp' to view Hadoop NameNode status
40+
41+
42+
<br>
43+
### Stage 2: Install Zookeeper & Accumulo
44+
45+
##### 2.1
46+
In a terminal window, enter the following to access the HDP VM:
47+
48+
```
49+
ssh [email protected] -p 2222
50+
```
51+
password: hadoop
52+
53+
##### 2.2
54+
55+
Install Zookeeper and Accumulo by entering:
56+
57+
```
58+
yum install zookeeper
59+
yum install accumulo
60+
```
61+
62+
##### 2.3
63+
64+
Set directories for Zookeeper, Accumulo, and Hadoop:
65+
66+
```
67+
export ZOOKEEPER_HOME=/usr/hdp/2.2.4.2-2/zookeeper
68+
export ACCUMULO_HOME=/usr/hdp/2.2.4.2-2/accumulo
69+
export HADOOP_PREFIX=/usr/hdp/2.2.4.2-2/hadoop
70+
export HADOOP_HOME=/usr/hdp/2.2.4.2-2/hadoop
71+
```
72+
73+
##### 2.4
74+
Switch to the HDFS user and make an Accumulo data directory
75+
```
76+
su hdfs
77+
hadoop fs -mkdir -p /apps/accumulo
78+
```
79+
Switch back to the root user ('su root')
80+
81+
82+
##### 2.5
83+
Copy the example configuration files into the conf directory:
84+
```
85+
cp $ACCUMULO_HOME/conf/examples/512MB/standalone/* $ACCUMULO_HOME/conf
86+
```
87+
88+
##### 2.6
89+
Edit and save ```$ACCUMULO_HOME/conf/accumulo-site.xml``` to include the following:
90+
```
91+
<property>
92+
<name>instance.volumes</name>
93+
<value>hdfs://sandbox:8020/apps/accumulo</value>
94+
</property>`
95+
```
96+
##### 2.7
97+
Edit the following 5 files, located in ```$ACCUMULO_HOME/conf```, and replace "localhost" with "sandbox":
98+
99+
- gc
100+
- masters
101+
- monitor
102+
- tracers
103+
- slaves
104+
105+
##### 2.8
106+
Change permissions and ownership of the Accumulo data directory:
107+
```
108+
su hdfs
109+
hadoop fs -chmod -R 700 /apps/accumulo
110+
hadoop fs -chown -R accumulo:accumulo /apps/accumulo
111+
```
112+
Switch back to the root user
113+
114+
##### 2.9
115+
116+
Initialize Accumulo:
117+
```
118+
$ACCUMULO_HOME/bin/accumulo init
119+
```
120+
Enter an instance name (e.g. accumulo) and password (e.g. secret)
121+
122+
Start Accumulo:
123+
```
124+
$ACCUMULO_HOME/bin/start-all.sh
125+
```
126+
<br>
127+
##### Stage 2 Checkpoint
128+
- Enter '127.0.0.1:50095' in browser and to be directed to an Accumulo overview w/ Zookeeper at port 2181
129+
130+
<br>
131+
### Stage 3: Build GeoMesa & Test Accumulo QuickStart
132+
133+
134+
##### Syntax for transferring files from local machine to HDP Sandbox via SCP:
135+
```
136+
scp -P 2222 local/file/path/filename [email protected]:vm/desired/filepath
137+
```
138+
139+
##### 3.1
140+
141+
On your local machine, clone the [GeoMesa github branch](https://github.com/locationtech/geomesa/tree/jnh_accumulo1.6) for Accumulo 1.6, and build using ```mvn clean install```
142+
143+
##### 3.2
144+
145+
Find ```geomesa-1.1.0-rc.3-SNAPSHOT.jar``` in the GeoMesa build on local machine (located in geomesa-assemble/target) and SCP to the VM
146+
```
147+
scp -P 2222 geomesa-assemble/target/geomesa-1.1.0-rc.3-SNAPSHOT-bin.tar.gz [email protected]:/usr/hdp/2.2.4.2-2/
148+
```
149+
Tar the file to create a GeoMesa directory on the VM (e.g. /usr/hdp/2.2.4.2-2/geomesa-1.1.0-rc.3-SNAPSHOT) and set GeoMesa Home:
150+
151+
```
152+
export GEOMESA_HOME=/usr/hdp/2.2.4.2-2/geomesa-1.1.0-rc.3-SNAPSHOT
153+
export PATH=${GEOMESA_HOME}/bin:$PATH
154+
```
155+
156+
##### 3.3
157+
158+
In the GeoMesa directory, run configure:
159+
```
160+
bin/geomesa configure
161+
```
162+
163+
Install GPL software:
164+
```
165+
bin/install-jai
166+
bin/install-jline
167+
bin/install vecmath
168+
```
169+
170+
##### 3.4
171+
172+
Deploy GeoMesa to Accumulo by copying the distributed runtime jar into Accumulo's lib/ext directory
173+
```
174+
scp $GEOMESA_HOME/dist/geomesa-distributed-runtime-1.1.0-rc.3-SNAPSHOT.jar $ACCUMULO_HOME/lib/ext
175+
```
176+
##### 3.5
177+
CD into GeoMesa build on local machine and SCP ```geomesa-accumulo-quickstart-1.1.0-rc.3-SNAPSHOT.jar``` (located in geomesa-examples/geomesa-accumulo-quickstart/target) to VM
178+
```
179+
scp -P 2222 geomesa-examples/geomesa-accumulo-quickstart/target/geomesa-accumulo-quickstart-1.1.0-rc.3-SNAPSHOT.jar [email protected]:/usr/hdp/2.2.4.2-2/
180+
```
181+
##### 3.6
182+
Run AccumuloQuickStart with the following command:
183+
184+
{% highlight bash %}
185+
java -cp ./geomesa-accumulo-quickstart-1.1.0-rc.3-SNAPSHOT.jar org.locationtech.geomesa.examples.AccumuloQuickStart -instanceId accumulo -zookeepers "localhost:2181" -user root -password secret -tableName VMtest
186+
{% endhighlight %}
187+
188+
See [GeoMesa Quick Start](http://www.geomesa.org/geomesa-quickstart/) for more details on this step
189+
<br>
190+
##### Stage 3 Checkpoint
191+
- The above command should yield the output similar to:
192+
193+
{% highlight bash %}
194+
'''
195+
Creating feature-type (schema): AccumuloQuickStart
196+
Creating new features
197+
Inserting new features
198+
Submitting query
199+
1. Bierce|640|Sun Sep 14 15:48:25 EDT 2014|POINT (-77.36222958792739 -37.13013846773835)|null
200+
2. Bierce|886|Tue Jul 22 14:12:36 EDT 2014|POINT (-76.59795732474399 -37.18420917493149)|null
201+
3. Bierce|925|Sun Aug 17 23:28:33 EDT 2014|POINT (-76.5621106573523 -37.34321201566148)|null
202+
4. Bierce|589|Sat Jul 05 02:02:15 EDT 2014|POINT (-76.88146600670152 -37.40156607152168)|null
203+
5. Bierce|394|Fri Aug 01 19:55:05 EDT 2014|POINT (-77.42555615743139 -37.26710898726304)|null
204+
6. Bierce|931|Fri Jul 04 18:25:38 EDT 2014|POINT (-76.51304097832912 -37.49406125975311)|null
205+
7. Bierce|322|Tue Jul 15 17:09:42 EDT 2014|POINT (-77.01760098223343 -37.30933767159561)|null
206+
8. Bierce|343|Wed Aug 06 04:59:22 EDT 2014|POINT (-76.66826220670282 -37.44503877750368)|null
207+
9. Bierce|259|Thu Aug 28 15:59:30 EDT 2014|POINT (-76.90122194030118 -37.148525741002466)|null
208+
'''
209+
{% endhighlight %}
210+
211+
<br>
212+
### Stage 4: Install Apache Tomcat 7
213+
214+
##### 4.1
215+
216+
Download the Core tar.gz for [Apache Tomcat 7](https://tomcat.apache.org/download-70.cgi)
217+
218+
SCP the tar.gz file to VM and tar to create Tomcat directory
219+
220+
```
221+
scp -P 2222 apache-tomcat-7.0.62.tar.gz [email protected]:/usr/hdp/2.2.4.2-2/
222+
tar xzf apache-tomcat-7.0.62.tar.gz
223+
```
224+
225+
##### 4.2
226+
CD into new Tomcat folder and start Tomcat with:
227+
```
228+
bin/startup.sh
229+
```
230+
231+
<br>
232+
##### Stage 4 Checkpoint
233+
- Navigate to 127.0.0.1:8080 in browser to confirm Apache Tomcat is running
234+
235+
<br>
236+
### Stage 5: Install GeoServer
237+
238+
##### 5.1
239+
240+
Download [Geoserver-2.5.2.war](http://sourceforge.net/projects/geoserver/files/GeoServer/2.5.2/geoserver-2.5.2-war.zip/download) and unzip
241+
242+
##### 5.2
243+
244+
SCP ```geoserver.war``` into Tomcat's webapps directory:
245+
```
246+
scp -P 2222 geoserver.war [email protected]:/usr/hdp/2.2.4.2-2/apache-tomcat-7.0.62/webapps
247+
```
248+
249+
Shutdown and restart Tomcat
250+
<br>
251+
##### Stage 5 Checkpoint
252+
- Navigate to 127.0.0.1:8080/geoserver and login with username: admin / password: geoserver
253+
254+
255+
256+
<br>
257+
### Stage 6: Deploy GeoMesa to GeoServer
258+
259+
##### 6.1
260+
Copy GeoMesa plugin to GeoServer:
261+
```
262+
cp $GEOMESA_HOME/dist/geomesa-plugin-1.1.0-rc.3-SNAPSHOT-geoserver-plugin.jar /usr/hdp/2.2.4.2-2/apache-tomcat-7.0.62/webapps/geoserver/WEB-INF/lib
263+
```
264+
265+
##### 6.2
266+
267+
Install additional dependencies as described in [GeoMesa Deployment](http://www.geomesa.org/geomesa-deployment/)
268+
269+
The HDP sandbox VM is using Accumulo 1.6, Zookeeper 3.4.6, and Hadoop 2.6, so use the following download links to ensure correct versions:
270+
271+
###### Accumulo
272+
accumulo-core-1.6.0.jar[Download](http://search.maven.org/remotecontent?filepath=org/apache/accumulo/accumulo-core/1.6.0/accumulo-core-1.6.0.jar)
273+
274+
accumulo-fate-1.6.0.jar [Download](http://search.maven.org/remotecontent?filepath=org/apache/accumulo/accumulo-fate/1.6.0/accumulo-fate-1.6.0.jar)
275+
276+
accumulo-trace-1.6.0.jar [Download](http://search.maven.org/remotecontent?filepath=org/apache/accumulo/accumulo-trace/1.6.0/accumulo-trace-1.6.0.jar)
277+
278+
###### Zookeeper
279+
zookeeper-3.4.6.jar [Download](https://repo1.maven.org/maven2/org/apache/zookeeper/zookeeper/3.4.6/zookeeper-3.4.6.jar)
280+
281+
###### Hadoop core
282+
hadoop-auth-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-auth/2.6.0/hadoop-auth-2.6.0.jar)
283+
284+
hadoop-client-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-client/2.6.0/hadoop-client-2.6.0.jar)
285+
286+
hadoop-common-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-common/2.6.0/hadoop-common-2.6.0.jar)
287+
288+
hadoop-hdfs-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-hdfs/2.6.0/hadoop-hdfs-2.6.0.jar)
289+
290+
hadoop-mapreduce-client-app-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-app/2.6.0/hadoop-mapreduce-client-app-2.6.0.jar)
291+
292+
hadoop-mapreduce-client-common-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-common/2.6.0/hadoop-mapreduce-client-common-2.6.0.jar)
293+
294+
hadoop-mapreduce-client-core-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-core/2.6.0/hadoop-mapreduce-client-core-2.6.0.jar)
295+
296+
hadoop-mapreduce-client-jobclient-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-jobclient/2.6.0/hadoop-mapreduce-client-jobclient-2.6.0.jar)
297+
298+
hadoop-mapreduce-client-shuffle-2.6.0.jar [Download](http://central.maven.org/maven2/org/apache/hadoop/hadoop-mapreduce-client-shuffle/2.6.0/hadoop-mapreduce-client-shuffle-2.6.0.jar)
299+
300+
###### Thrift
301+
libthrift-0.9.1.jar[Download](https://search.maven.org/remotecontent?filepath=org/apache/thrift/libthrift/0.9.1/libthrift-0.9.1.jar)
302+
303+
SCP all of these files into GeoServer's ```WEB-INF/lib``` directory
304+
305+
306+
##### 6.3
307+
308+
Two pre-existing JARs must also be updated in the lib directory:
309+
310+
commons-configuration: Accumulo requires commons-configuration 1.6 and previous versions should be replaced [Download](https://search.maven.org/remotecontent?filepath=commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar)
311+
commons-lang: GeoServer ships with commons-lang 2.1, but Accumulo requires replacing that with version 2.4 [Download](https://search.maven.org/remotecontent?filepath=commons-lang/commons-lang/2.4/commons-lang-2.4.jar)
312+
313+
314+
<br>
315+
##### Tutorial Completion Check
316+
- Execute the steps under 'Visualize Data With Geoserver' in the [GeoMesa Quick Start](http://www.geomesa.org/geomesa-quickstart/)

0 commit comments

Comments
 (0)