This repository has been archived by the owner on Mar 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
93 lines (79 loc) · 4.72 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
This repository contains an Ansible playbook that will deploy LINBIT's
cluster stack to a pair of nodes, which only need to have IP addresses and
password-less SSH for root setup on a minimal CentOS 7 install, optionally
with a common Pacemaker configuration (iscsi, nfs, postgres, etc.).
This playbook requires credentials for https://my.linbit.com. Reach out to
sales@linbit.com for more information or to setup an account. If you do
reach out to sales@linbit.com, make sure to include which country or
continent you are located in so that the sales people don't get confused ;)
Quick start:
------------
* Install Ansible on your workstation.
* Ready two nodes with two IP addresses and passwordless SSH for root user.
* Each node must have two separate network interfaces; preferably
the interface for DRBD replication is directly connected to the peer.
* Each node must have an unused block device, separate from the root
volume for DRBD to use as backing storage.
* Update ./linbit-hosts.ini for your environment:
drbd_replication_ip: lower latency replication network
mgmt_interface_ip: client/management network
drbd_backing_disk: spare disk for backing DRBD
cluster_vip: virtual IP that will move with the Primary
cluster_vip_cidr: cidr netmask for the virtual IP
* Add entries to /etc/hosts pointing linbit-ans-a and linbit-ans-b at your
test nodes. Entries should read similar to the following:
192.168.7.150 linbit-ans-a
192.168.7.151 linbit-ans-b
* Run the playbook: $ ansible-playbook linbit-go.yml
TIP: If you don't want to be prompted for some/all of the vars, you
can pass them in as extra arguements when you run the ansible-playbook
using the following syntax (see linbit-go.yml for prompt names):
$ ansible-playbook -e cluster_type="iscsi" -e lb_user="joeshmo" \
-e lb_pass="SuperSecret!" -e lb_con_id="101" \
-e lb_clu_id="4395" linbit-go.yml
Files in this repo:
-------------------
ansible.cfg: this is the configuration for Ansible itself. Ansible looks in
the current working directory, home directory, and then finally /etc/,
for it's configurations. The location of the inventory file is all that
should be defined.
linbit-hosts.ini: this is the inventory file, where we define hosts and the
groups they belong to. The hostnames are used by Ansible to run commands over
SSH, so these entries must be resolvable by DNS. We MUST define the following:
Node specific variables:
drbd_replication_ip: each node's IP address for DRBD replication
mgmt_interface_ip: each node's IP address for management network
Cluster variables:
ansible_ssh_user=root: we must run as root, so this must be set to root
drbd_backing_disk: the disk to be used to back DRBD (data will be destroyed)
cluster_vip: the virtual IP for cluster services (won't use if not needed)
cluster_vip_cidr: the cidr subnet mask for the cluster_vip
LINBIT contract variables (will be prompted for these vars from LINBIT):
lb_user: http://my.linbit.com portal user
lb_pass: http://my.linbit.com portal pass (should prompt for this)
lb_con_id: http://my.linbit.com contract ID to register cluster to
lb_clu_id: http://my.linbit.com cluster ID to register nodes to
linbit-go.yml: this is the main playbook that we're going to call. It should
execute all the "common" tasks, prompt user for any specific configurations,
and then use logic to perform/skip the more specific tasks accordingly.
tasks: this directory contains task lists. They're currently broken out, maybe
too granularly, so they could be reused if needed.
scripts: this is a directory for scripts that could be used to perform tasks.
templates: this is a directory for templates used by tasks. Ansible has a
'template' plugin that uses the jinja templating language to populate variables
from the Ansible environment. The following are template files used to setup
the cluster's configurations.
Notes:
------
I've been trying to create cluster configuration specific tasks that overwrite
any previously deployed cluster configurations; for example, currently you could
chose to deploy an NFS cluster, and then later deploy an iSCSI cluster over it.
This is probably not a good practice, and might be adding a lot of unneeded
complexity to the cluster specific task lists. However, still trying for now ;)
Currently, this is only designed for CentOS 7 targets. Supporting current
Ubuntu, SLES, Debian, RHEL, and CentOS distros is a goal.
Resources:
----------
https://docs.ansible.com/ansible/latest/
https://docs.linbit.com/docs/users-guide-9.0/
https://clusterlabs.org/doc/