Skip to content

Commit

Permalink
preparing contrib scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
paulczar committed Sep 23, 2014
1 parent 1817411 commit 63ef47e
Show file tree
Hide file tree
Showing 14 changed files with 622 additions and 6 deletions.
23 changes: 23 additions & 0 deletions contrib/fleet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM google/golang:latest

RUN apt-get -yqq update && apt-get -yqq install bc ssh vim

RUN cd /root && \
git clone https://github.com/coreos/fleet.git && \
cd fleet && \
git checkout v0.5.0 && \
./build && \
mv bin/fleetctl /usr/bin/fleetctl

RUN cd /root && \
git clone https://github.com/coreos/etcdctl.git && \
cd etcdctl && \
./build && \
mv bin/etcdctl /usr/bin/etcdctl

ADD . /installer

RUN chmod +x /installer/install

CMD /installer/install

28 changes: 28 additions & 0 deletions contrib/fleet/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

[[ -z $KEY ]] && exit 1
[[ -z $ETCDCTL_PEERS ]] && exit 1
[[ -z $FLEETCTL_ENDPOINT ]] && exit 1
[[ -z $FLEETCTL_TUNNEL ]] && exit 1

etcdctl ls /database/install || etcdctl mkdir /database/install
etcdctl get /database/installl/installing && exit 0
etcdctl get /database/install/complete && exit 0

etcdctl set --ttl=600 /database/install/installing 1

eval `ssh-agent`

fleetctl load systemd/* \
&& fleetctl start database-1-data.service \
&& fleetctl start database-2-data.service \
&& fleetctl start database-3-data.service \
&& sleep 10 \
&& fleetctl start database-1.service \
&& sleep 10 \
&& fleetctl start database-2.service \
&& fleetctl start database-3.service \
&& etcdctl set --ttl 0 /database/install/complete true \
&& etcdctl set --ttl 0 /database/install/installed_by $ETCDCTL_PEERS

etcdctl set --ttl=1 /database/install/installing 0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions contrib/rackspace/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Deploying to Rackspace OnMetal
==============================

Install Heat
------------

Ensure you have heat installed:

```console
$ sudo pip install python-heatclient
```

Set up your environment:

```console
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
export OS_AUTH_SYSTEM=rackspace
export OS_REGION_NAME=IAD
export OS_USERNAME=????
export OS_TENANT_NAME=????
export NOVA_RAX_AUTH=1
export OS_PASSWORD=?????
export OS_PROJECT_ID=${OS_TENANT_NAME}
export OS_TENANT_ID=${OS_TENANT_NAME}
export OS_NO_CACHE=1
export HEAT_URL="https://iad.orchestration.api.rackspacecloud.com/v1/${OS_TENANT_ID}"

```

Deploy from Heat Template
-------------------------

Deploy a three node MySQL onto Rackspace OnMetal IO flavor:

```console
$ heat stack-create Example --template-file=contrib/rackspace/heat-vm.yaml \
-P count=3 -P etcd_discovery=$(curl -s https://discovery.etcd.io/new)
```

Log into CoreOS
---------------

```console
$ eval `ssh-agent`
$ echo $(heat output-show Example private_key | sed 's/"//g') | ssh-add -
$ export LB=$(heat output-show Example loadbalancer | sed 's/"//g') && echo $LB
$ mysql -h $LB -u admin -padmin -e "show status like 'wsrep_cluster%'"
```
Loading

0 comments on commit 63ef47e

Please sign in to comment.