Skip to content
Snippets Groups Projects
Commit c371233d authored by matt01671's avatar matt01671
Browse files

cluster code

parent 1bf0d53a
No related branches found
No related tags found
No related merge requests found
- hosts: localhost # - hosts: localhost
vars_files: # vars_files:
- host_vars/nectar.yaml # - host_vars/nectar.yaml
gather_facts: true # gather_facts: true
roles: # roles:
- role: openstack-common # - role: openstack-common
- role: openstack-volume # - role: openstack-volume
- role: openstack-security-group # - role: openstack-security-group
- role: cluster-security-group # - role: cluster-security-group
- role: openstack-instance # - role: openstack-instance
- hosts: instances # - hosts: instances
vars_files: # vars_files:
- host_vars/docker.yaml # - host_vars/docker.yaml
gather_facts: true # gather_facts: true
roles: # roles:
- role: openstack-proxy # - role: openstack-proxy
- role: all-dependencies # - role: all-dependencies
- role: all-mount # - role: all-mount
- role: all-docker # - role: all-docker
- hosts: dbs - hosts: dbs
roles: roles:
- role: cluster-build - role: cluster-build
# - role: cluster-harvester
- hosts: web # - hosts: web
vars_files: # vars_files:
- host_vars/react.yaml # - host_vars/react.yaml
gather_facts: true # gather_facts: true
roles: # roles:
- role: react-build # - role: react-build
\ No newline at end of file
...@@ -49,10 +49,10 @@ instances: ...@@ -49,10 +49,10 @@ instances:
volumes: ['dbvolume3'] volumes: ['dbvolume3']
meta: meta:
group: dbs group: dbs
- name: web # - name: web
volumes: ['webvolume'] # volumes: ['webvolume']
meta: # meta:
group: web # group: web
instance_image: 45225edb-66d8-4fd0-bf41-132a31a18166 instance_image: 45225edb-66d8-4fd0-bf41-132a31a18166
instance_key_name: test-moh instance_key_name: test-moh
......
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
[web] [web]
[dbs] [dbs]
172.26.133.141
172.26.129.16
172.26.131.117
[instances:children] [instances:children]
harvesters harvesters
......
#!/usr/bin/env bash #!/usr/bin/env bash
echo "== Set variables ==" echo "== Set variables =="
export declare -a nodes=(172.17.0.4 172.17.0.3 172.17.0.2) ##CONVERT TO IP ADDRESS OF VMS export declare -a nodes=(172.26.131.117 172.26.133.141 172.26.129.16) ##CONVERT TO IP ADDRESS OF VMS
export masternode=`echo ${nodes} | cut -f1 -d' '` export masternode=`echo ${nodes} | cut -f1 -d' '`
export declare -a othernodes=`echo ${nodes[@]} | sed s/${masternode}//` export declare -a othernodes=`echo ${nodes[@]} | sed s/${masternode}//`
export size=${#nodes[@]} export size=${#nodes[@]}
...@@ -70,5 +70,3 @@ for node in "${nodes[@]}"; do curl -X GET "http://${user}:${pass}@${node}:5984/ ...@@ -70,5 +70,3 @@ for node in "${nodes[@]}"; do curl -X GET "http://${user}:${pass}@${node}:5984/
echo "== Adding a database to one node of the cluster makes it to be created on all other nodes as well: ==" echo "== Adding a database to one node of the cluster makes it to be created on all other nodes as well: =="
curl -XPUT "http://${user}:${pass}@${masternode}:5984/twitter" curl -XPUT "http://${user}:${pass}@${masternode}:5984/twitter"
for node in "${nodes[@]}"; do curl -X GET "http://${user}:${pass}@${node}:5984/_all_dbs"; done for node in "${nodes[@]}"; do curl -X GET "http://${user}:${pass}@${node}:5984/_all_dbs"; done
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment