Skip to content

Instantly share code, notes, and snippets.

@barakmich
Created April 27, 2016 21:34
Show Gist options
  • Save barakmich/9b4f56cce3a8195ab4996f6c48bfcfb0 to your computer and use it in GitHub Desktop.
Save barakmich/9b4f56cce3a8195ab4996f6c48bfcfb0 to your computer and use it in GitHub Desktop.
etcd stress tester
sudo apt-get -y install libpcap-dev
sudo apt-get -y install ntp
sudo apt-get -y install ntpdate
sudo apt-get -y install iptables iproute2
sudo service ntp stop
sudo ntpdate time.nist.gov
sudo service ntp start
GO_VERSION="1.6.2" && cd /usr/local && sudo rm -rf ./go && sudo curl -s https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz | sudo tar -v -C /usr/local/ -xz && cd $HOME;
echo "export GOPATH=$(echo $HOME)/go" >> $HOME/.bashrc
PATH_VAR=$PATH":/usr/local/go/bin:$(echo $HOME)/go/bin"
echo "export PATH=$(echo $PATH_VAR)" >> $HOME/.bashrc
export GOPATH=$(echo $HOME)/go
PATH_VAR=$PATH":/usr/local/go/bin:$(echo $HOME)/go/bin"
export PATH=$(echo $PATH_VAR)
rm -rf $HOME/*
USER_NAME=coreos
BRANCH_NAME=master
mkdir -p $GOPATH/src/github.com/coreos/
git clone https://github.com/$USER_NAME/etcd --branch $BRANCH_NAME $GOPATH/src/github.com/coreos/etcd
cd $GOPATH/src/github.com/coreos/etcd
go get -v -u ./...
rm -rf $GOPATH/bin/
cd $GOPATH/src/github.com/coreos/etcd
./build
mkdir -p $GOPATH/bin/
cp ./bin/etcd $GOPATH/bin/etcd
cd $GOPATH/src/github.com/coreos/etcd/tools/functional-tester/etcd-agent
go build
mkdir -p $GOPATH/bin/
cp ./etcd-agent $GOPATH/bin/etcd-agent
cd $HOME
nohup $HOME/go/bin/etcd-agent -etcd-path $HOME/go/bin/etcd -etcd-log-path $HOME/etcd.log > $HOME/etcd_agent.log 2>&1 &
cat $HOME/etcd_agent.log
cat $HOME/etcd.log
GO_VERSION="1.6.2" && cd /usr/local && sudo rm -rf ./go && sudo curl -s https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz | sudo tar -v -C /usr/local/ -xz && cd $HOME;
echo "export GOPATH=$(echo $HOME)/go" >> $HOME/.bashrc
PATH_VAR=$PATH":/usr/local/go/bin:$(echo $HOME)/go/bin"
echo "export PATH=$(echo $PATH_VAR)" >> $HOME/.bashrc
export GOPATH=$(echo $HOME)/go
PATH_VAR=$PATH":/usr/local/go/bin:$(echo $HOME)/go/bin"
export PATH=$(echo $PATH_VAR)
rm -rf $HOME/*
USER_NAME=coreos
BRANCH_NAME=master
mkdir -p $GOPATH/src/github.com/coreos/
git clone https://github.com/$USER_NAME/etcd --branch $BRANCH_NAME $GOPATH/src/github.com/coreos/etcd
go get -v -u github.com/tools/godep
cd ~/go/src/github.com/coreos/etcd/cmd
godep restore
cd $GOPATH/src/github.com/coreos/etcd/tools/functional-tester/etcd-tester
go build
mkdir -p $GOPATH/bin/
cp ./etcd-tester $GOPATH/bin/etcd-tester
cd $HOME
AGENT_RPC_ENDPOINTS='10.240.0.2:9027,10.240.0.3:9027,10.240.0.4:9027'
nohup $HOME/go/bin/etcd-tester --agent-endpoints="$(echo $AGENT_RPC_ENDPOINTS)" --limit 9999999 > $HOME/tester.log 2>&1 &
sleep 5s
cat $HOME/tester.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment