-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
622 additions
and
6 deletions.
There are no files selected for viewing
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
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 | ||
|
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
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.
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
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%'" | ||
``` |
Oops, something went wrong.