GeoMesa實(shí)踐教程(一):GeoMesa安裝
1偶妖、系統(tǒng)環(huán)境
主機(jī) | 操作系統(tǒng) |
---|---|
master | Ubuntu18.04 |
slave1 | Ubuntu18.04 |
slave2 | Ubuntu18.04 |
2姜凄、軟件環(huán)境
軟件 | 版本 | 版本兼容說明 |
---|---|---|
GeoMesa | 3.3.0 | 整體版本從GeoMesa倒推,GeoMesa安裝說明(https://www.geomesa.org/documentation/stable/user/hbase/install.html#install-hbase-geoserver)上提示了HBase的兼容版本2.X |
GeoServer | 2.17.3 | GeoMesa對GeoServer版本是有要求的趾访,可以看這個(gè)網(wǎng)站 https://www.geomesa.org/documentation/stable/user/geoserver.html |
HBase | 2.2.7 | 根據(jù)GeoMesa需要态秧,找2.X版本就行 |
Hadoop | 2.10.1 | HBase介紹網(wǎng)站(https://hbase.apache.org/book.html)給出了HBase各版本與Hadoop版本兼容性,根據(jù)自己情況選擇就行(建議還是2系列)扼鞋。 |
Zookeeper | 3.7.0 | 就用我這個(gè)版本申鱼,或者3.4系列都可以,其他的沒試過 |
3云头、安裝
Hadoop捐友、HBase、ZooKeeper安裝就不介紹了溃槐,Google上很多安裝介紹匣砖,這里著重說下GeoMesa的安裝。其實(shí)GeoMesa安裝非常簡單昏滴,總體來說分為三步:
- 1猴鲫、下載GeoMesa,解壓谣殊,然后把{GEOMESA_PATH}/bin添加到環(huán)境變量拂共。
GeoMesa-HBase 3.3.0 下載地址: https://github.com/locationtech/geomesa/releases/download/geomesa-3.3.0/geomesa-hbase_2.11-3.3.0-bin.tar.gz
然后,把hbase的hbase-site.xml添加到{GEOMESA_PATH}/lib/geomesa-hbase-datastore_2.12-3.3.0.jar的根目錄下姻几,有兩個(gè)辦法
1. 用zip軟件打開宜狐,然后添加進(jìn)去
2. 執(zhí)行命令
zip -r {GEOMESA_PATH}/lib/geomesa-hbase-datastore_2.12-3.3.0.jar hbase-site.xml
按照GeoMesa的說法,有一些依賴可能是由于License原因鲜棠,沒辦法直接提供肌厨,因此提供了一個(gè)工具下載:
{GEOMESA_PATH}/bin/install-shapefile-support.sh
-
2、在{GEOMESA_PATH}/dist/hbase下有一個(gè)geomesa-hbase-distributed-runtime-hbase2_2.12-3.3.0.jar文件(注意是HBase2)豁陆,然后執(zhí)行命令:
hdfs dfs -put {GEOMESA_PATH}/dist/hbase/geomesa-hbase-distributed-runtime-hbase2_2.12-3.3.0.jar /hbase/lib/
-
3柑爸、配置GeoServer,這一步只要把依賴搞定就沒問題盒音,主要是依賴的問題表鳍。
1、GeoMesa提供了工具用來自動(dòng)下載所需依賴(其實(shí)在 https://www.geomesa.org/documentation/stable/user/hbase/install.html#install-hbase-geoserver 這個(gè)網(wǎng)站上祥诽,GeoMesa已經(jīng)列出了所需的依賴譬圣,但是還是缺了一些,我這里列出我用的依賴雄坪,大家對號入座)
- 修改{GEOMESA_PATH}/conf/dependencie
hbase_install_version="2.2.7" hbase_thirdparty_install_version="2.2.1" hadoop_install_version="2.8.5" zookeeper_install_version="3.4.10" # required for hadoop - make sure it corresponds to the hadoop installed version guava_install_version="31.0-jre"
-
執(zhí)行{GEOMESA_PATH}/bin/install-dependencies.sh
2厘熟、把這個(gè)壓縮包{GEOMESA_PATH}/dist/gs-pluginsgeomesa-hbase-gs-plugin_2.12-3.3.0-install.tar.gz解壓到${GEOSERVER_PATH}/webapps/geoserver/WEB-INF/lib下面
3、把下面這些依賴復(fù)制到${GEOSERVER_PATH}/webapps/geoserver/WEB-INF/lib下面,重啟Geoserver
- commons-cli-1.2.jar
- commons-configuration-1.6.jar
- commons-io-2.5.jar
- commons-logging-1.1.3.jar
- hadoop-auth-2.8.5.jar
- hadoop-common-2.8.5.jar
- hadoop-hdfs-2.8.5.jar
- hadoop-hdfs-client-2.8.5.jar
- hadoop-mapreduce-client-core-2.8.5.jar
- hbase-client-2.2.7.jar
- hbase-common-2.2.7.jar
- hbase-hadoop-compat-2.2.7.jar
- hbase-mapreduce-2.2.7.jar
- hbase-protocol-2.2.7.jar
- hbase-protocol-shaded-2.2.7.jar
- hbase-shaded-miscellaneous-2.2.1.jar
- hbase-shaded-netty-2.2.1.jar
- hbase-shaded-protobuf-2.2.1.jar
- htrace-core4-4.1.0-incubating.jar
- metrics-core-2.2.0.jar(新增)
- metrics-core-3.2.6.jar
- netty-3.6.2.Final.jar
- netty-all-4.1.48.Final.jar
- protobuf-java-2.5.0.jar
- zookeeper-3.7.0.jar
- zookeeper-jute-3.7.0.jar(新增)
- curator-client-4.3.0.jar(新增)
- curator-framework-4.3.0.jar(新增)
- curator-recipes-4.3.0.jar(新增)
- postgresql-42.2.14.jar(新增)