feat(dev-db/etcd): add new raft based etcd

This commit is contained in:
Brandon Philips 2013-07-10 14:46:25 -07:00
parent 08bb509fe5
commit f2640f0d8f
10 changed files with 58 additions and 41 deletions

View File

@ -1,8 +0,0 @@
[Service]
ExecStartPre=/usr/lib/etcd/host/doozerd/configure.sh
ExecStart=/usr/lib/etcd/host/riak/configure.sh
Before=etcd.service
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +0,0 @@
[Service]
ExecStart=/usr/sbin/etcd -a doozer:?ca=${DOOZERD_MASTER}:8046
EnvironmentFile=/var/run/etcd/doozerd/EnvironmentFile
[Install]
WantedBy=multi-user.target

View File

@ -74,6 +74,7 @@ RDEPEND="${RDEPEND}
sys-process/psmisc sys-process/psmisc
sys-process/time sys-process/time
virtual/perf virtual/perf
coreos-base/coreos-experimental
" "
# TODO: sys-apps/iotools # TODO: sys-apps/iotools

View File

@ -15,7 +15,5 @@ IUSE=""
DEPEND="" DEPEND=""
RDEPEND=" RDEPEND="
app-admin/systemd-rest app-admin/systemd-rest
app-admin/etcd dev-db/etcd
app-admin/etcd-client
app-admin/etcd-lib
" "

View File

@ -5,37 +5,32 @@
# $Header:$ # $Header:$
# #
EAPI=2 EAPI=4
CROS_WORKON_PROJECT="coreos/etcd" CROS_WORKON_PROJECT="coreos/etcd"
CROS_WORKON_LOCALNAME="etcd" CROS_WORKON_LOCALNAME="etcd"
CROS_WORKON_REPO="git://github.com" CROS_WORKON_REPO="git://github.com"
CROS_WORKON_COMMIT="f4301f994c995d7e91214e082fa18312899b4131" CROS_WORKON_COMMIT="01e5d41f91da0251a8ed9dbba79df70a9dd6a237"
inherit toolchain-funcs cros-workon systemd inherit toolchain-funcs cros-workon systemd
DESCRIPTION="etcd" DESCRIPTION="etcd"
HOMEPAGE="https://github.com/xiangli-cmu/etcd" HOMEPAGE="https://github.com/coreos/etcd"
SRC_URI="" SRC_URI=""
LICENSE="MIT" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
KEYWORDS="amd64 arm x86" KEYWORDS="amd64 x86"
IUSE="" IUSE=""
DEPEND=">=dev-lang/go-1.0.2" DEPEND=">=dev-lang/go-1.1"
GOROOT="${ED}usr/$(get_libdir)/go"
GOPKG="${PN}" ETCD_PACKAGE="github.com/coreos/etcd"
src_compile() { src_compile() {
export GOPATH="${S}" ./build
go get
go build -o ${PN}
} }
src_install() { src_install() {
dosbin ${S}/${PN} dobin ${S}/${PN}
systemd_dounit "${FILESDIR}"/${PN}.service systemd_dounit "${FILESDIR}"/${PN}.service
systemd_enable_service multi-user.target ${PN}.service systemd_enable_service multi-user.target ${PN}.service
systemd_dounit "${FILESDIR}"/${PN}-bootstrap.service
systemd_enable_service multi-user.target ${PN}-bootstrap.service
} }

View File

@ -5,29 +5,27 @@
# $Header:$ # $Header:$
# #
EAPI=2 EAPI=4
CROS_WORKON_PROJECT="coreos/etcd" CROS_WORKON_PROJECT="coreos/etcd"
CROS_WORKON_LOCALNAME="etcd" CROS_WORKON_LOCALNAME="etcd"
CROS_WORKON_REPO="git://github.com" CROS_WORKON_REPO="git://github.com"
inherit toolchain-funcs cros-workon systemd inherit toolchain-funcs cros-workon systemd
DESCRIPTION="etcd" DESCRIPTION="etcd"
HOMEPAGE="https://github.com/xiangli-cmu/etcd" HOMEPAGE="https://github.com/coreos/etcd"
SRC_URI="" SRC_URI=""
LICENSE="MIT" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
KEYWORDS="~amd64 ~arm ~x86" KEYWORDS="~amd64"
IUSE="" IUSE=""
DEPEND=">=dev-lang/go-1.0.2" DEPEND=">=dev-lang/go-1.1"
GOROOT="${ED}usr/$(get_libdir)/go" GOROOT="${ED}usr/$(get_libdir)/go"
GOPKG="${PN}" GOPKG="${PN}"
src_compile() { src_compile() {
export GOPATH="${S}" ./build
go get
go build -o ${PN}
} }
src_install() { src_install() {

View File

@ -0,0 +1,35 @@
#!/bin/bash
C10N_ENDPOINT=https://core-api.appspot.com/v1/c10n/group
META_URL="http://169.254.169.254/latest"
USER_DATA=$(curl -s $META_URL/user-data)
URL=$USER_DATA
echo $URL | grep -q '^https://' || (echo Coordination URL requires valid SSL; exit 1)
TMP=`mktemp`
curl -s "$USER_DATA/raw" > $TMP
# validate ssh key
ssh-keygen -l -f $TMP > /dev/null 2>&1
if [ $? -eq 0 ]; then
cat $TMP >> $HOME/.ssh/authorized_keys
echo "SSH key updated"
else
echo "Not a valid ssh key"
fi
IP_LIST=""
for IP4 in `curl -s $META_URL/meta-data/ | grep ipv4`; do
IP=$(curl -s $META_URL/meta-data/$IP4)
if [ "$IP_LIST" != "" ]; then
IP_LIST="$IP_LIST,$IP"
else
IP_LIST="$IP"
fi
done
curl $C10N_ENDPOINT -d "c10n_url=$URL" -d"ip_list=$IP_LIST"

View File

@ -0,0 +1,5 @@
[Service]
ExecStart=/usr/bin/etcd-bootstrap
[Install]
WantedBy=multi-user.target