Public Repository

Last pushed: 4 months ago
Short Description
Short description is empty for this repo.
Full Description

create a script and run it

N=${1:-4}

i=1
while [ $i -lt $N ]
do
    docker run -itd \
        --net hadoop \
        --cpus=4.0 \
        -m 8g \
        -v /db/elasticsearch/$i/data:/usr/local/elasticsearch/data \
        -v /db/elasticsearch/$i/logs:/usr/local/elasticsearch/logs \
        -e "TZ=Asia/Taipei" \
        --name elasticsearch$i \
        --hostname elasticsearch$i \
        chming1016/elasticsearch:a$i &> /dev/null
    i=$(( $i + 1 ))
done

start cluster

docker exec -it elasticsearch1 bash
cd /usr/local/elasticsearch/bin
su elastic
./elasticsearch &

docker exec -it elasticsearch2 bash
cd /usr/local/elasticsearch/bin
su elastic
./elasticsearch &

docker exec -it elasticsearch3 bash
cd /usr/local/elasticsearch/bin
su elastic
./elasticsearch &
Docker Pull Command
Owner
chming1016