Skip to content

Instantly share code, notes, and snippets.

@ckeyer
Created August 26, 2016 10:54
Show Gist options
  • Save ckeyer/b8c7d68b426d969dae861879d3e28039 to your computer and use it in GitHub Desktop.
Save ckeyer/b8c7d68b426d969dae861879d3e28039 to your computer and use it in GitHub Desktop.
#!/bin/bash
# ubuntu 16.04 x86_64 (4.4.0-34-generic)
# Mem:1G CPU:1
# user: root
set -ex
apt-get update -y
apt-get install -y make git wget gcc g++
# 安装docker
if [ ! -n `which docker` ]; then
echo "install docker"
apt-get install -y apt-transport-https
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' > /etc/apt/sources.list.d/docker.list
apt-get update -y
apt-get install -y docker-engine
fi
# 安装go
if [ ! -n `which go` ]; then
wget https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz -O /tmp/go.tgz
cd /usr/local
tar zxf /tmp/go.tgz
echo 'export GOROOT=/usr/local/go' >> /etc/profile
echo 'export GOPATH=/go' >> /etc/profile
echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /etc/profile
source /etc/profile
rm -rf /tmp/*
fi
# 安装 rocksdb
apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev
cd /tmp
git clone https://github.com/facebook/rocksdb.git
cd rocksdb
git checkout v4.1
PORTABLE=1 make shared_lib
INSTALL_PATH=/usr/local make install-shared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment