2019-06-20 17:41:54 +08:00
# Install Dependencies
* [CentOS 7 ](#centos-7 )
* [Ubuntu 18.04 ](#ubuntu-1804 )
* [Debian 9 ](#debian-9 )
* [CentOS 6 ](#centos-6 )
2019-07-07 08:42:39 +08:00
* [Mac OSX ](#mac-osx )
2019-06-20 17:41:54 +08:00
CentOS 7
========
```shell
# install epel, `luarocks` need it.
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo rpm -ivh epel-release-latest-7.noarch.rpm
# add openresty source
sudo yum install yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
# install openresty, etcd and some compilation tools
sudo yum install -y etcd openresty curl git automake autoconf \
2019-07-02 20:45:59 +08:00
gcc pcre-devel libtool gcc-c++ luarocks cmake3 lua-devel
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
2019-06-20 17:41:54 +08:00
# start etcd server
sudo service etcd start
```
Ubuntu 18.04
============
```shell
# add openresty source
wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main"
sudo apt-get update
# install openresty, etcd and some compilation tools
sudo apt-get install -y git etcd openresty curl luarocks\
check libpcre3 libpcre3-dev libjemalloc-dev \
libjemalloc1 build-essential libtool automake autoconf pkg-config cmake
# start etcd server
sudo service etcd start
```
2019-09-12 09:27:31 +08:00
Debian 9 & & 10
2019-06-20 17:41:54 +08:00
========
```shell
2019-09-12 09:27:31 +08:00
# optional
sed -i 's|^deb http://deb.debian.org/debian|deb http://mirrors.huaweicloud.com/debian|g' /etc/apt/sources.list
sed -i 's|^deb http://security.debian.org/debian-security|deb http://mirrors.huaweicloud.com/debian-security|g' /etc/apt/sources.list
apt update
apt install wget gnupg -y
2019-06-20 17:41:54 +08:00
# add openresty source
wget -qO - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
sudo apt-get -y install software-properties-common
sudo add-apt-repository -y "deb http://openresty.org/package/debian $(lsb_release -sc) openresty"
sudo apt-get update
# install etcd
wget https://github.com/etcd-io/etcd/releases/download/v3.3.13/etcd-v3.3.13-linux-amd64.tar.gz
tar -xvf etcd-v3.3.13-linux-amd64.tar.gz & & \
cd etcd-v3.3.13-linux-amd64 & & \
2019-07-02 20:45:59 +08:00
sudo cp -a etcd etcdctl /usr/bin/
2019-06-20 17:41:54 +08:00
2019-07-02 20:45:59 +08:00
# install openresty and some compilation tools
2019-08-16 15:59:08 +08:00
sudo apt-get install -y git openresty cmake curl \
2019-06-20 17:41:54 +08:00
check libpcre3 libpcre3-dev libjemalloc-dev \
2019-09-12 09:27:31 +08:00
build-essential libtool automake autoconf pkg-config
2019-06-20 17:41:54 +08:00
2019-09-12 09:27:31 +08:00
# install luarocks
# (the version must > 3.0, --lua-dir was first introduced in the luarocks 3.0 release)
2019-08-16 15:59:08 +08:00
2019-09-12 09:27:31 +08:00
wget https://luarocks.org/releases/luarocks-3.1.3.tar.gz
tar zxpf luarocks-3.1.3.tar.gz
cd luarocks-3.1.3
2019-08-16 15:59:08 +08:00
2019-09-12 09:27:31 +08:00
* Run `./configure --with-lua=/usr/local/openresty/luajit/` . (This will attempt to detect your installation of Lua. If you get any error messages, see the section "Customizing your settings", below.)
2019-08-16 15:59:08 +08:00
* Run `make build` .
* As superuser, run `make install` .
ln -s /usr/local/bin/luarocks /usr/bin/luarocks
2019-06-20 17:41:54 +08:00
# start etcd server
nohup etcd &
```
CentOS 6
========
TODO
2019-08-22 14:40:56 +08:00
Failed to compile `rapidjson` , and the compilation of `libr3` relies on later versions of `autoconf` and `pcre` , but the CentOS 6 comes with a lower version, will support CentOS 6 later.
2019-07-07 08:42:39 +08:00
Mac OSX
=======
```shell
2019-07-08 15:49:39 +08:00
# install openresty, etcd and some compilation tools
2019-08-16 15:19:48 +08:00
brew install autoconf automake check pkg-config pcre cmake libtool openresty/brew/openresty etcd luarocks
2019-07-07 08:42:39 +08:00
2019-09-09 18:03:16 +08:00
# start etcd server with v2 protocol
etcd --enable-v2=true &
2019-07-07 08:42:39 +08:00
```