Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contrib/demo-multi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Host setup
1. Install Vagrant 1.6.2

$ wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.6.2_x86_64.rpm
$ yum -y --nogpgcheck localinstall vagrant_1.6.2_x86_64.rpm
$ sudo yum -y --nogpgcheck localinstall vagrant_1.6.2_x86_64.rpm
$ vagrant version
Installed Version: 1.6.2
Latest Version: 1.6.2
Expand Down Expand Up @@ -45,7 +45,7 @@ Host setup
$ git clone git://github.com/pmorie/geard
$ cd geard
$ git checkout demo-multi
$ cd contrib/demo
$ cd contrib/demo-multi
$ cat Vagrantfile

5. Pull and start local docker registry. This will be used to serve the docker images needed for
Expand Down
3 changes: 2 additions & 1 deletion contrib/demo-multi/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ fi

if [ ! -d "geard" ]; then
echo "Fetching geard code"
git clone git://github.com/openshift/geard
git clone git://github.com/pmorie/geard
cd geard
git checkout demo-multi 2>&1
fi

if [ ! "$(ifconfig | grep eth1)" ]; then
Expand Down
3 changes: 3 additions & 0 deletions contrib/demo-multi/db-import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh -x

sudo switchns --container=parks-db-1 -- /bin/bash -c "curl https://raw.githubusercontent.com/thesteve0/fluentwebmap/master/parkcoord.json | mongoimport -d fluent -c parkpoints --type json && mongo fluent --eval 'db.parkpoints.ensureIndex( { pos : \"2d\" } );'"
26 changes: 22 additions & 4 deletions contrib/demo-multi/setup-multi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,27 @@ fi

$base/teardown-multi.sh

gear deploy $base/deploy_parks_map.json localhost localhost 192.168.205.11 192.168.205.11 localhost
gear stop 192.168.205.11/parks-backend-{2,3}
#gear deploy $base/deploy_parks_map.json localhost localhost 192.168.205.11 192.168.205.11 localhost
#gear stop 192.168.205.11/parks-backend-{2,3}

$base/wait_for_url.sh "http://localhost:14000/"
gear install openshift/centos-mongodb parks-db-1 -p "27017:4003" openshift/centos-mongodb --start
$base/wait_for_url.sh "http://localhost:4003/"
read

sudo switchns --container=parks-db-1 -- /bin/bash -c "curl https://raw.githubusercontent.com/thesteve0/fluentwebmap/master/parkcoord.json | mongoimport -d fluent -c parkpoints --type json && mongo fluent --eval 'db.parkpoints.ensureIndex( { pos : \"2d\" } );'"
gear install parks-map-app parks-backend-1 -p "3000:4002" -n "127.0.0.1:27017:localhost:4003" --start
$base/wait_for_url.sh "http://localhost:4002/"
read

gear install parks-map-app atomic-2:43273/parks-backend-2 -p "3000:4002" -n "127.0.0.1:27017:192.168.205.10:4003" --start
$base/wait_for_url.sh "http://atomic-2:4002"
read

gear install parks-map-app atomic-2:43273/parks-backend-3 -p "3000:4003" -n "127.0.0.1:27017:192.168.205.10:4003" --start
$base/wait_for_url.sh "http://atomic-2:4003"
read

gear install openshift/centos-haproxy-simple-balancer parks-lb-1 -p "8080:14000" -n "192.168.1.1:8080:localhost:4002,192.168.1.2:8080:192.168.205.11:4002,192.168.1.3:8080:192.168.205.11:4003" --start
$base/wait_for_url.sh "http://localhost:14000"
read

$base/db-import.sh