Last active
August 29, 2015 14:23
-
-
Save guileen/541074b50f45c93366c5 to your computer and use it in GitHub Desktop.
安装redis/hadoop/mongodb/mariadb集群
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
ver=2.7.0 | |
useradd -d /data/hadoop hadoop | |
wget http://apache.fayea.com/hadoop/common/hadoop-${ver}/hadoop-${ver}.tar.gz | |
tar xzvf hadoop-${ver}.tar.gz | |
sudo mv hadoop-${ver} /opt/hadoop |
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
wget http://mirrors.cnnic.cn/apache/hbase/1.1.1/hbase-1.1.1-bin.tar.gz | |
tar xzvf hbase-1.1.1-bin.tar.gz | |
sudo mv hbase-1.1.1 /opt/hbase |
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
go get github.com/wandoulabs/codis --depth=1 | |
cd $GOPATH/src/github.com/wandoulabs/codis/ && \ | |
./bootstrap.sh && \ | |
make gotest |
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
ver=1.4.2 | |
wget http://golangtc.com/static/go/go${ver}.src.tar.gz | |
tar xzvf go${ver}.src.tar.gz | |
mv go /opt/go | |
cd /opt/go/src && bash all.bash | |
sudo mkdir /opt/gowork | |
cat <<EOF>>/etc/profile | |
# Golang | |
export GOROOT=/opt/go | |
export GOPATH=/opt/gowork | |
export PATH=\$PATH:\$GOROOT/bin:\$GOWORK/bin | |
EOF | |
source /etc/profile |
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
# Use newer version of gcc (older version of gcc has problems) | |
# Use CFLAGS="-O1" ./configure && make | |
# Use CFLAGS="-O3 -fno-strict-aliasing" ./configure && make | |
# autoreconf -fvi && ./configure needs automake and libtool to be installed | |
# Where bash is your shell/hashbang, consistently use hash (for commands) or type (to consider built-ins & keywords). | |
# When writing a POSIX script, use command -v. | |
if command -v apt-get 2 > /dev/null; then; | |
apt-get install -y libtool | |
else | |
# update autoconf for centos | |
yum install -y xz libtool | |
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz | |
tar xJf autoconf-2.69.tar.xz | |
cd autoconf-2.69 && ./configure --prefix=/usr && sudo make install | |
fi | |
ver=0.4.1 | |
LC_ALL=C | |
curl -L https://github.com/twitter/twemproxy/archive/v${ver}.tar.gz -o twemproxy-v${ver}.tar.gz | |
cd twemproxy-${ver} && \ | |
autoreconf -fvi && \ | |
./configure && \ | |
make && \ | |
sudo make install |
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/sh | |
ver=3.0.2 | |
wget http://download.redis.io/releases/redis-${ver}.tar.gz | |
tar xzvf redis-${ver}.tar.gz | |
cd redis-${ver} && make install |
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
ver=3.4.6 | |
# wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-${ver}/zookeeper-${ver}.tar.gz | |
wget http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-${ver}/zookeeper-${ver}.tar.gz | |
tar xzvf zookeeper-${ver}.tar.gz | |
sudo mv zookeeper-${ver} /opt/zookeeper | |
sudo cat <<EOF>>/etc/profile | |
# Zookeeper | |
export ZOOKEEPER_HOME=/opt/zookeeper | |
export PATH=\$PATH:\$ZOOKEEPER_HOME/bin:\$ZOOKEEPER_HOME/conf | |
EOF | |
source /etc/profile | |
cat <<EOF>/opt/zookeeper/conf/zoo.cfg | |
dataDir=/data/zookeeper/ | |
clientPort=2181 | |
#server.1=zoo1:2888:3888 | |
#server.2=zoo2:2888:3888 | |
#server.3=zoo3:2888:3888 | |
# administrator guide before turning on autopurge. | |
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance | |
tickTime=2000 | |
initLimit=10 | |
syncLimit=5 | |
maxClientCnxns=60 | |
autopurge.snapRetainCount=3 | |
# Purge task interval in hours | |
# Set to "0" to disable auto purge feature | |
#autopurge.purgeInterval=1 | |
EOF | |
mkdir /data/zookeeper | |
read serverid | |
echo $serverid > /data/zookeeper/myid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment