【发布时间】:2019-08-21 23:56:19
【问题描述】:
问题/问题:
我们如何确保 EMR 引导操作在 EMR 上安装 HBase 应用程序之后运行?
集群信息:
我正在使用支持 Hbase 1.4.9 的 emr-5.25.0 版本。
用例: 我正在使用 Bootstrap 操作在 EMR 上安装 Geomesa(如下文档所示)。 https://www.geomesa.org/documentation/tutorials/geomesa-hbase-s3-on-aws.html
观察:
我使用下面的代码作为引导操作。我看到在集群上安装 HBase 之前启动了以下引导操作。我想使用引导操作确保 Geomesa 安装在每个主节点上,以防多主设置。
#!/bin/bash
set -e -x
IS_MASTER=false
if [ -f /mnt/var/lib/info/instance.json ]
then
IS_MASTER=`cat /mnt/var/lib/info/instance.json | tr -d '\n ' | sed -n 's|.*\"isMaster\":\([^,]*\).*|\1|p'`
fi
if [[ $IS_MASTER == false* ]]
then
echo "Not the master server."
exit 0
else
echo "Installing Geomesa on Master Server."
GEOMESA_INSTALLATION_FILE_S3_LOCATION="$1"
GEOMESA_FILE_VERSION="$2"
# initialize the Geomesa version.
export GEOMESA_VERSION="$3"
# Create jars package
mkdir -p /home/hadoop/jars
# Copy Geomesa 2.3.0 jars from s3 to local jars folders.
aws s3 cp $GEOMESA_INSTALLATION_FILE_S3_LOCATION /home/hadoop/jars
# Move to opt package
cd /opt/
# Unzip geomesa jar in /opt package.
sudo tar zxvf /home/hadoop/jars/geomesa-hbase-dist_${GEOMESA_FILE_VERSION}-bin.tar.gz
# run bootstrap-geomesa-hbase-aws.sh file to bootstrap geomesa on EMR.
sudo /opt/geomesa-hbase_${GEOMESA_FILE_VERSION}/bin/bootstrap-geomesa-hbase-aws.sh
# Go to /etc/hadoop/conf
cd /etc/hadoop/conf
# Copy hbase-site.xml in the /etc/hadoop/conf
sudo cp /usr/lib/hbase/conf/hbase-site.xml /etc/hadoop/conf
# Create .zip file for hbase-site.xml
sudo zip /home/hadoop/jars/hbase-site.zip hbase-site.xml
# initialize GEOMESA_EXTRA_CLASSPATHS to hbase-site.zip
export GEOMESA_EXTRA_CLASSPATHS=/home/hadoop/jars/hbase-site.zip
fi
【问题讨论】:
标签: hbase amazon-emr geomesa