Skip to content

Commit 0997c8b

Browse files
author
Karl Stoney
committed
Fixed a config issue
1 parent 80de0be commit 0997c8b

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed
File renamed without changes.

demo.sh

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
2-
set -e
2+
set -e
3+
4+
if ! hash jq 2>/dev/null; then
5+
echo You need JQ installed matey! Please install it first.
6+
exit 1
7+
fi
8+
39
echo Starting HDFS...
410
docker-compose up -d namenode datanode1 datanode2
511

@@ -18,18 +24,28 @@ docker-compose up -d hue
1824
echo Creating Users table in HBase...
1925
docker-compose exec hbase_master /bin/sh -c "echo \"create 'User', { NAME => 'cf', REPLICATION_SCOPE => '1' }\" | hbase shell"
2026

21-
echo Creating Templates in Hue...
22-
API="http://127.0.0.1:8082/nifi-api"
23-
PROCESS_GROUP=$(curl --silent $API/flow/process-groups/root | jq .processGroupFlow.id)
24-
PROCESS_GROUP=$(echo $PROCESS_GROUP | tr -d '"')
27+
export WEB="http://127.0.0.1:8082/nifi"
28+
export API="http://127.0.0.1:8082/nifi-api"
29+
echo Waiting for NiFi to come up...
30+
until $(curl --output /dev/null --silent --head --fail $WEB); do
31+
printf '.'
32+
sleep 2
33+
done
2534

26-
curl -iv -F template=@config/hue/users.xml $API/process-groups/$PROCESS_GROUP/templates/upload
35+
echo Creating Templates in NiFi...
36+
export PROCESS_GROUP=$(curl --silent $API/flow/process-groups/root | jq .processGroupFlow.id)
37+
export PROCESS_GROUP=$(echo $PROCESS_GROUP | tr -d '"')
38+
echo Process group: $PROCESS_GROUP
2739

28-
TEMPLATE_ID=$(curl --silent $API/flow/templates | jq .templates | jq '.[]'.id)
29-
TEMPLATE_ID=$(echo $TEMPLATE_ID | tr -d '"')
40+
curl -iv -F template=@config/nifi/users.xml $API/process-groups/$PROCESS_GROUP/templates/upload > /dev/null
41+
42+
export TEMPLATE_ID=$(curl --silent $API/flow/templates | jq .templates | jq '.[]'.id)
43+
export TEMPLATE_ID=$(echo $TEMPLATE_ID | tr -d '"')
44+
echo Template id: $TEMPLATE_ID
3045

31-
PAYLOAD="{\"templateId\":\"$TEMPLATE_ID\",\"originX\":365,\"originY\":-21}"
46+
export PAYLOAD="{\"templateId\":\"$TEMPLATE_ID\",\"originX\":365,\"originY\":-21}"
3247

33-
curl -kH "Content-Type: application/json" -X POST -d $PAYLOAD $API/process-groups/$PROCESS_GROUP/template-instance
48+
curl -kH "Content-Type: application/json" -X POST -d $PAYLOAD $API/process-groups/$PROCESS_GROUP/template-instance > /dev/null
3449

35-
open "http://127.0.0.1:8082/nifi"
50+
echo Opening NiFi...
51+
open $WEB

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ services:
154154
- HBASE_CONF_ROOTDIR=hdfs://namenode:8020/hbase
155155
- INDEX_COLLECTION_users=collection1
156156
volumes:
157-
- ./conf/hbase-indexer:/data
157+
- ./config/:/data
158158
depends_on:
159159
- hbase
160160
- hbase_master

0 commit comments

Comments
 (0)