This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#./assignSlots.sh 7001 5 redis-cluster-m- | |
readonly STARTING_PORT=${1:-0} | |
readonly NUM_MASTERS=${2:-0} | |
readonly NAME_PREFIX=${3:-"redis-cluster-m-"} | |
readonly MAX_SLOT=$((16383)) | |
readonly SLOT_RANGE=$(((MAX_SLOT + NUM_MASTERS - 1) / NUM_MASTERS)) | |
readonly LOCAL_CONTAINER_ID=$(docker ps -f name="$NAME_PREFIX" -q | head -n 1) | |
readonly LOCAL_PORT=$(docker inspect --format='{{index .Config.Labels "com.docker.swarm.service.name"}}' "$LOCAL_CONTAINER_ID" | sed 's|.*-||') | |
for ((port = STARTING_PORT, endPort = STARTING_PORT + NUM_MASTERS, slot = 0; port < endPort; port++)) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#./forEach.sh 7001 5 redis-cluster-m- CLUSTER INFO | |
readonly STARTING_PORT=$1 | |
readonly NUM_MASTERS=$2 | |
readonly NAME_PREFIX=$3 | |
readonly REDIS_CMD=("${@:4}") | |
readonly LOCAL_CONTAINER_ID=$(docker ps -f name="$NAME_PREFIX" -q | head -n 1) | |
readonly LOCAL_PORT=$(docker inspect --format='{{index .Config.Labels "com.docker.swarm.service.name"}}' "$LOCAL_CONTAINER_ID" | sed 's|.*-||') | |
for ((port = STARTING_PORT, endPort = port + NUM_MASTERS; port < endPort; port++)) do | |
host=$([ "$LOCAL_PORT" == $port ] && echo "127.0.0.1" || echo "$NAME_PREFIX$port") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#./rmServices.sh redis-cluster-m- | |
readonly FILTER=${1:-"redis-cluster-m-"} | |
docker service ls | grep "$FILTER" | awk '{print $1}' | xargs docker service rm | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x8616e6270e14ff16dbbf1ea0a46ea3dc0d84ce1d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 16nkM86wpv7W3BKgTA5qfQQtGEdZECNVgr https://explorer.blockstack.org/address/16nkM86wpv7W3BKgTA5qfQQtGEdZECNVgr |
OlderNewer