-
-
Notifications
You must be signed in to change notification settings - Fork 450
/
Copy pathsharding.pp
51 lines (49 loc) · 1.1 KB
/
sharding.pp
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
node 'mongos' {
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class { 'mongodb::server':
configsvr => true,
bind_ip => [$facts['networking']['ip']],
}
-> class { 'mongodb::client': }
-> class { 'mongodb::mongos':
configdb => ["${facts['networking']['ip']}:27019"],
}
-> mongodb_shard { 'rs1' :
member => 'rs1/mongod1:27018',
keys => [{
'rs1.foo' => {
'name' => 1,
}
}],
}
}
node 'mongod1' {
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class { 'mongodb::server':
shardsvr => true,
replset => 'rs1',
bind_ip => [$facts['networking']['ip']],
}
-> class { 'mongodb::client': }
mongodb_replset { 'rs1':
members => ['mongod1:27018', 'mongod2:27018'],
}
}
node 'mongod2' {
class { 'mongodb::globals':
manage_package_repo => true,
}
-> class { 'mongodb::server':
shardsvr => true,
replset => 'rs1',
bind_ip => [$facts['networking']['ip']],
}
-> class { 'mongodb::client': }
mongodb_replset { 'rs1':
members => ['mongod1:27018', 'mongod2:27018'],
}
}