summaryrefslogtreecommitdiffstats
path: root/examples/distributed-replicate-example.pp
blob: 900d9caa709ee9aa335534709157ffeec511b391 (plain)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#
#	example of a distributed-replicate with four hosts, and two bricks each
#	NOTE: this should be put on *every* gluster host
#
#$annex_loc_vip_1 = '172.16.1.80'	# vip
$annex_loc_ip_1 = '172.16.1.81'
$annex_loc_ip_2 = '172.16.1.82'
$annex_loc_ip_3 = '172.16.1.83'
$annex_loc_ip_4 = '172.16.1.84'

$some_client_ip = ''

class gluster_base {

	class { 'gluster::server':
		ips => ["${annex_loc_ip_1}", "${annex_loc_ip_2}", "${annex_loc_ip_3}", "${annex_loc_ip_4}"],
		#vip => "${annex_loc_vip_1}",
		clients => [$some_client_ip],
		zone => 'loc',
		shorewall => true,
	}

	gluster::host { 'annex1.example.com':
		# use uuidgen to make these
		# NOTE: specifying a host uuid is optional and can be automatic
		#uuid => '1f660ca2-2c78-4aa0-8f4d-21608218c69c',
	}

	gluster::brick { 'annex1.example.com:/mnt/storage1a':
		dev => '/dev/disk/by-id/scsi-36003048007e26c00173ad3b633a2ef67',	# /dev/sda
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '1ae49642-7f34-4886-8d23-685d13867fb1',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::brick { 'annex1.example.com:/mnt/storage1c':
		dev => '/dev/disk/by-id/scsi-36003048007e26c00173ad3b633a36700',	# /dev/sdb
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '1c9ee010-9cd1-4d81-9a73-f0788d5b3e33',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::host { 'annex2.example.com':
		uuid => '2fbe6e2f-f6bc-4c2d-a301-62fa90c459f8',
	}

	gluster::brick { 'annex2.example.com:/mnt/storage2a':
		dev => '/dev/disk/by-id/scsi-36003048007df450014ca27ee19eaec55',	# /dev/sdc
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '2affe5e3-c10d-4d42-a887-cf8993a6c7b5',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::brick { 'annex2.example.com:/mnt/storage2c':
		dev => '/dev/disk/by-id/scsi-36003048007df450014ca280e1bda8e70',	# /dev/sdd
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '2c434d6c-7800-4eec-9121-483bee2336f6',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::host { 'annex3.example.com':
		uuid => '3f5a86fd-6956-46ca-bb80-65278dc5b945',
	}

	gluster::brick { 'annex3.example.com:/mnt/storage3b':
		dev => '/dev/disk/by-id/scsi-36003048007e14f0014ca2722130bc87c',	# /dev/sdc
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '3b79d76b-a519-493c-9f21-ca35524187ef',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::brick { 'annex3.example.com:/mnt/storage3d':
		dev => '/dev/disk/by-id/scsi-36003048007e14f0014ca2743150a5471',	# /dev/sdd
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '3d125f8a-c3c3-490d-a606-453401e9bc21',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::host { 'annex4.example.com':
		uuid => '4f8e3157-e1e3-4f13-b9a8-51e933d53915',
	}

	gluster::brick { 'annex4.example.com:/mnt/storage4b':
		dev => '/dev/disk/by-id/scsi-36003048007e36700174029270d81faa1',	# /dev/sdc
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '4bf21ae6-06a0-44ad-ab48-ea23417e4e44',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	gluster::brick { 'annex4.example.com:/mnt/storage4d':
		dev => '/dev/disk/by-id/scsi-36003048007e36700174029270d82724d',	# /dev/sdd
		labeltype => 'gpt',
		fstype => 'xfs',
		fsuuid => '4dfa7e50-2315-44d3-909b-8e9423def6e5',
		xfs_inode64 => true,
		xfs_nobarrier => true,
		areyousure => true,
	}

	$brick_list = [
		'annex1.example.com:/mnt/storage1a',
		'annex2.example.com:/mnt/storage2a',
		'annex3.example.com:/mnt/storage3b',
		'annex4.example.com:/mnt/storage4b',
		'annex1.example.com:/mnt/storage1c',
		'annex2.example.com:/mnt/storage2c',
		'annex3.example.com:/mnt/storage3d',
		'annex4.example.com:/mnt/storage4d',
	]

	# TODO: have this run transactionally on *one* gluster host.
	gluster::volume { 'examplevol':
		replica => 2,
		bricks => $brick_list,
		start => undef,	# i'll start this myself
	}

	# namevar must be: <VOLNAME>#<KEY>
	gluster::volume::property { 'examplevol#auth.reject':
		value => ['192.0.2.13', '198.51.100.42', '203.0.113.69'],
	}

	#gluster::volume::property { 'examplevol#cluster.data-self-heal-algorithm':
	#	value => 'full',
	#}

	#gluster::volume { 'someothervol':
	#	replica => 2,
	#	bricks => $brick_list,
	#	start => undef,
	#}

}