cs171027
5 years ago
11 changed files with 112 additions and 100 deletions
@ -1,5 +1,4 @@ |
|||||
[defaults] |
[defaults] |
||||
#added parameters for actual management of LXC nodes with ansible because of bridged |
#added parameters for actual management of LXC nodes with ansible because of bridged networking packet loss |
||||
#networking packet loss |
|
||||
gather_timeout = 30 |
gather_timeout = 30 |
||||
timeout = 30 |
timeout = 30 |
||||
|
@ -1,4 +1,4 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
[ `id -u` -ne 0 ] && exit 1 |
[ `id -u` -ne 0 ] && exit 1 |
||||
test -f /root/.ssh/id_rsa.pub || ssh-keygen -t rsa -b 4096 -N '' -f /root/.ssh/id_rsa |
test -f /root/.ssh/id_rsa.pub || ssh-keygen -t rsa -b 4096 -N '' -f /root/.ssh/id_rsa |
||||
ansible-playbook -i inventory/hosts --skip-tags swarm --diff -v stack.yml |
ansible-playbook -i inventory/hosts --skip-tags swarm --diff -v swarm-galera.yml |
||||
|
@ -1,3 +1,3 @@ |
|||||
#!/bin/bash |
#!/bin/bash |
||||
[ `id -u` -ne 0 ] && exit 1 |
[ `id -u` -ne 0 ] && exit 1 |
||||
ansible-playbook -i inventory/hosts --tags swarm --diff -v stack.yml |
ansible-playbook -i inventory/hosts --tags swarm --diff -v swarm-galera.yml |
||||
|
@ -0,0 +1,91 @@ |
|||||
|
version: '3.2' |
||||
|
|
||||
|
services: |
||||
|
|
||||
|
db_cluster_node1: |
||||
|
|
||||
|
image: ubuntu:galera-node-worker1 |
||||
|
|
||||
|
# environment: |
||||
|
# - NODENAME={{.Node.Hostname}} |
||||
|
# - NODEID={{.Node.ID}} |
||||
|
# - SERVICEID={{.Service.ID}} |
||||
|
# - SERVICENAME={{.Service.Name}} |
||||
|
# - TASKID={{.Task.ID}} |
||||
|
# - TASKNAME={{.Task.Name}} |
||||
|
# - TASKREPID={{.Task.Slot}} |
||||
|
hostname: node1 |
||||
|
|
||||
|
volumes: |
||||
|
|
||||
|
- /var/container_data/mysql:/var/lib/mysql |
||||
|
|
||||
|
networks: |
||||
|
galera_net: |
||||
|
|
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
restart_policy: |
||||
|
delay: 10s |
||||
|
max_attempts: 10 |
||||
|
window: 60s |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.labels.node1 == true |
||||
|
- node.role == worker |
||||
|
#- node.group == galera |
||||
|
ports: |
||||
|
- mode: host |
||||
|
# target: 3306 |
||||
|
# published: 3306 |
||||
|
target: 4567 |
||||
|
published: 4567 |
||||
|
# target: 4568 |
||||
|
# published: 4568 |
||||
|
# target: 4568 |
||||
|
# published: 4568 |
||||
|
|
||||
|
#- "10.0.3.100:3306:3306" |
||||
|
#- "10.0.3.100:4567:4567" |
||||
|
#- "10.0.3.100:4568:4568" |
||||
|
#- "10.0.3.100:4444:4444" |
||||
|
|
||||
|
db_cluster_node2: |
||||
|
|
||||
|
image: ubuntu:galera-node-worker2 |
||||
|
|
||||
|
hostname: node2 |
||||
|
|
||||
|
volumes: |
||||
|
|
||||
|
- /var/container_data/mysql:/var/lib/mysql |
||||
|
|
||||
|
networks: |
||||
|
galera_net: |
||||
|
|
||||
|
deploy: |
||||
|
replicas: 1 |
||||
|
restart_policy: |
||||
|
delay: 10s |
||||
|
max_attempts: 10 |
||||
|
window: 60s |
||||
|
placement: |
||||
|
constraints: |
||||
|
- node.labels.node2 == true |
||||
|
- node.role == worker |
||||
|
# - node.group == galera |
||||
|
depends_on: |
||||
|
- db_cluster_node1 |
||||
|
ports: |
||||
|
- mode: host |
||||
|
target: 4567 |
||||
|
published: 4567 |
||||
|
# - "10.0.3.101:3306:3306" |
||||
|
# - "10.0.3.101:4567:4567" |
||||
|
# - "10.0.3.101:4568:4568" |
||||
|
# - "10.0.3.101:4444:4444" |
||||
|
|
||||
|
|
||||
|
networks: |
||||
|
galera_net: |
||||
|
|
@ -1,5 +0,0 @@ |
|||||
--- |
|
||||
- hosts: all |
|
||||
gather_facts: no |
|
||||
roles: |
|
||||
- lxc_swarm |
|
@ -1,88 +1,5 @@ |
|||||
version: '3.2' |
--- |
||||
|
- hosts: all |
||||
services: |
gather_facts: no |
||||
|
roles: |
||||
db_cluster_node1: |
- lxc_swarm |
||||
|
|
||||
image: ubuntu:galera-node-worker1 |
|
||||
|
|
||||
# environment: |
|
||||
# - NODENAME={{.Node.Hostname}} |
|
||||
# - NODEID={{.Node.ID}} |
|
||||
# - SERVICEID={{.Service.ID}} |
|
||||
# - SERVICENAME={{.Service.Name}} |
|
||||
# - TASKID={{.Task.ID}} |
|
||||
# - TASKNAME={{.Task.Name}} |
|
||||
# - TASKREPID={{.Task.Slot}} |
|
||||
|
|
||||
volumes: |
|
||||
|
|
||||
- /var/container_data/mysql:/var/lib/mysql |
|
||||
|
|
||||
networks: |
|
||||
galera_net: |
|
||||
|
|
||||
deploy: |
|
||||
replicas: 1 |
|
||||
restart_policy: |
|
||||
delay: 10s |
|
||||
max_attempts: 10 |
|
||||
window: 60s |
|
||||
placement: |
|
||||
constraints: |
|
||||
- node.labels.node1 == true |
|
||||
- node.role == worker |
|
||||
#- node.group == galera |
|
||||
ports: |
|
||||
- mode: host |
|
||||
# target: 3306 |
|
||||
# published: 3306 |
|
||||
target: 4567 |
|
||||
published: 4567 |
|
||||
# target: 4568 |
|
||||
# published: 4568 |
|
||||
# target: 4568 |
|
||||
# published: 4568 |
|
||||
|
|
||||
#- "10.0.3.100:3306:3306" |
|
||||
#- "10.0.3.100:4567:4567" |
|
||||
#- "10.0.3.100:4568:4568" |
|
||||
#- "10.0.3.100:4444:4444" |
|
||||
|
|
||||
db_cluster_node2: |
|
||||
|
|
||||
image: ubuntu:galera-node-worker2 |
|
||||
|
|
||||
volumes: |
|
||||
|
|
||||
- /var/container_data/mysql:/var/lib/mysql |
|
||||
|
|
||||
networks: |
|
||||
galera_net: |
|
||||
|
|
||||
deploy: |
|
||||
replicas: 1 |
|
||||
restart_policy: |
|
||||
delay: 10s |
|
||||
max_attempts: 10 |
|
||||
window: 60s |
|
||||
placement: |
|
||||
constraints: |
|
||||
- node.labels.node2 == true |
|
||||
- node.role == worker |
|
||||
# - node.group == galera |
|
||||
depends_on: |
|
||||
- db_cluster_node1 |
|
||||
ports: |
|
||||
- mode: host |
|
||||
target: 4567 |
|
||||
published: 4567 |
|
||||
# - "10.0.3.101:3306:3306" |
|
||||
# - "10.0.3.101:4567:4567" |
|
||||
# - "10.0.3.101:4568:4568" |
|
||||
# - "10.0.3.101:4444:4444" |
|
||||
|
|
||||
|
|
||||
networks: |
|
||||
galera_net: |
|
||||
|
|
||||
|
Loading…
Reference in new issue