Skip to content

Commit ec59c60

Browse files
author
Karl Stoney
committed
Ensured solr creates zookeeper node /solr
1 parent 61c5d0f commit ec59c60

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

solr/run.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,14 @@ if [ ! -f "/data/solr.xml" ]; then
1010
cp -R /opt/solr/server/solr/configsets /data/
1111
fi
1212

13-
su -c './bin/solr -s /data -p 8983 -f -c -z hbase-zookeeper:2181' solr
13+
echo Checking solr zookeeper node exists on $HBASE_CONF_QUORUM...
14+
set +e
15+
su -c "./bin/solr zk ls /solr -z $HBASE_CONF_QUORUM:2181 &>/dev/null" &>/dev/null solr
16+
EXIT_CODE=$?
17+
set -e
18+
19+
if [ ! "$EXIT_CODE" = "0" ]; then
20+
echo Creating solr zookeeper node...
21+
su -c "./bin/solr zk mkroot /solr -z $HBASE_CONF_QUORUM:2181"
22+
fi
23+
su -c "./bin/solr -s /data -p 8983 -f -c -z $HBASE_CONF_QUORUM:2181/solr" solr

0 commit comments

Comments
 (0)