summaryrefslogtreecommitdiffstats
path: root/lib_cman.py
blob: c1245fcc4daf261779530aa63003cc12a7b6f490 (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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
#!/usr/bin/env python
# vim: set fileencoding=UTF-8:
# Copyright 2013 Red Hat, Inc.
# Author: Jan Pokorný <jpokorny at redhat dot com>
# Distributed under GPLv2+;  generated content under CC-BY-SA 3.0
# (to view a copy, visit http://creativecommons.org/licenses/by-sa/3.0/)
"""Library comprising cman cluster entities and relationships"""

from lib_nodes import *
from lib_edges import *
from lib_shared import *


#
# edges/protocols
#

class CmanRicciRPC(ApplicationSpecificProtocol, Delegate):
    """[ricci client] -> ricci"""
    defaults = dict((
        LABEL('port 11111'),
    ))
    summary = 'ricci RPC is a customized variant of XMLRPC'
    web = 'http://www.sourceware.org/cluster/conga/ricci_api/index.html'
    #web = 'http://www.sourceware.org/cluster/conga/ricci_api/ricci_api.html'


class CmanRicciRPCSrc(object):
    common_src_of = CmanRicciRPC


class CmanLuciHTTPS(HTTPS, Delegate):
    """[web browser] -> luci"""
    defaults = dict((
        LABEL('port 8084'),
    ))
    secprops = dict(
        euser='luci',
        egroup='luci',
        # XXX: https://bugzilla.redhat.com/1023202
        #      https://bugzilla.redhat.com/1026374
        label='system_u:system_r:initrc_t:s0',
    )


class CmanModclusterdUpdates(Exchange):
    """modclusterd <-> modclusterd"""
    defaults = dict((
        LABEL('port 16851\n(either direction)'),
    ))
    summary = 'XML-formatted status messages'
    miscprops = dict(
        sockopts = ['O_NONBLOCK'
                   ,'TCP_NODELAY (since el6.3/https://bugzilla.redhat.com/742431#c10)'
                   ]
    )


class CmanModclusterdUpdatesPeer(object):
    common_src_of = CmanModclusterdUpdates
    common_dst_of = CmanModclusterdUpdates


#
# nodes
#

class CmanRGManager(Daemon):
    defaults = dict((
        LABEL('rgmanager'),
    ))
    summary = \
    "RGManager (Resource Group ~) deals with cluster resources"
    web = 'https://fedorahosted.org/cluster/wiki/RGManager'
    location = '/usr/sbin/rgmanager'
    repo = dict(
        git='git://git.fedorahosted.org/git/cluster.git',
        web='https://git.fedorahosted.org/cgit/cluster.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/cluster-commits',
    )
    man = [
        'rgmanager(8)',
    ]
    ids = dict(
        srpm = 'rgmanager',
        rpm = 'rgmanager',
        rhbz = 'rgmanager',
    )


class CmanClustat(Executable):
    defaults = dict((
        LABEL('clustat'),
    ))
    summary = \
    "clustat is a program to display cluster status"
    location = '/usr/sbin/clustat'
    repo = dict(
        git='git://git.fedorahosted.org/git/cluster.git',
        web='https://git.fedorahosted.org/cgit/cluster.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/cluster-commits',
    )
    man = [
        'clustat(8)'
    ]
    doc = {
        'Displaying HA Service Status with clustat'
        :'https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/s1-admin-manage-ha-services-cli-CA.html#s2-admin-manage-ha-services-clustat-cli-CA',
    }
    ids = dict(
        srpm='rgmanager',
        rpm='rgmanager',
        rhbz='rgmanager',
    )


class CmanCmanTool(Executable):
    defaults = dict((
        LABEL('cman_tool'),
    ))
    summary = \
    "cman_tool is a program to manage CMAN cluster subsystem"
    location = '/usr/sbin/cman_tool'
    repo = dict(
        git='git://git.fedorahosted.org/git/cluster.git',
        web='https://git.fedorahosted.org/cgit/cluster.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/cluster-commits',
    )
    man = [
        'cman_tool(8)',
    ]
    doc = {
        'Updating a Configuration Using cman_tool version -r'
        :'https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/s1-admin-updating-config-CA.html#s2-admin-prop-config-ccstoolr-cli-CA',
    }
    ids = dict(
        srpm='cluster',
        rpm='cman',
        rhbz='cluster',
    )


class CmanFenceTool(Executable):
    defaults = dict((
        LABEL('fence_tool'),
    ))
    summary = \
    "fence_tool is a utility for the fenced daemon"
    location = '/usr/sbin/fence_tool'
    repo = dict(
        git='git://git.fedorahosted.org/git/cluster.git',
        web='https://git.fedorahosted.org/cgit/cluster.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/cluster-commits',
    )
    man = [
        'fence_tool(8)',
    ]
    ids = dict(
        srpm='cluster',
        rpm='cman',
        rhbz='cluster',
    )


class CmanRicci(Daemon):
    defaults = dict((
        LABEL('ricci'),
    ))
    summary = \
    "ricci daemon is an executive back-end within cluster management (conga)"
    #web = 'https://sourceware.org/cluster/conga/'
    location = '/usr/sbin/ricci'
    repo = dict(
        git='git://git.fedorahosted.org/git/conga.git',
        web='https://git.fedorahosted.org/cgit/conga.git',
    )
    man = [
        'ricci(8)',
    ]
    ids = dict(
        srpm='ricci',
        rpm='ricci',
        rhbz='ricci',
    )
    secprops = dict(
        euser='ricci',
        egroup='root',
        label='unconfined_u:system_r:ricci_t:s0',
        capabilities='CAP_SYS_BOOT (+ temporarily CAP_SETUID)'
    )
    miscprops = dict(
        common_thread_cnt=1,
        nice=-1,
        ppid=1,
    )


class CmanRicciWorker(Program):
    defaults = dict((
        LABEL('ricci-worker'),
    ))
    summary = \
    "ricci-worker is a ricci's slave to actually handle the task batches"
    #web = 'https://sourceware.org/cluster/conga/'
    location = '/usr/libexec/ricci/ricci-worker'
    repo = dict(
        git='git://git.fedorahosted.org/git/conga.git',
        web='https://git.fedorahosted.org/cgit/conga.git',
    )
    ids = dict(
        srpm='ricci',
        rpm='ricci',
        rhbz='ricci',
    )
    secprops = dict(
        euser='ricci',
        egroup='root',
        #label='unconfined_u:system_r:ricci_t:s0',
    )


class CmanCcs(Executable, CmanRicciRPCSrc):
    defaults = dict((
        LABEL('ccs'),
    ))
    summary = \
    "ccs is a CLI front-end within cluster management (conga)"
    location = '/usr/sbin/ccs'
    repo = dict(
        #git='git://git.fedorahosted.org/git/conga.git',
        git='git://github.com/feist/ccs.git',
        #web='https://git.fedorahosted.org/cgit/conga.git',
        web='https://github.com/feist/ccs',
    )
    man = [
        'ccs(8)',
    ]
    doc = {
        'Configuring Red Hat High Availability Add-On With the ccs Command'
        :'https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/ch-config-ccs-CA.html',
        'Managing Red Hat High Availability Add-On With ccs'
        :'https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/ch-mgmt-ccs-CA.html',
    }
    ids = dict(
        srpm='ricci',
        rpm='ccs',
        rhbz='ricci',
    )


class CmanCcsSync(Executable, CmanRicciRPCSrc):
    defaults = dict((
        LABEL('ccs_sync'),
    ))
    summary = \
    "ccs_sync is a program to distribute+propagate cluster configuration"
    location = '/usr/bin/ccs_sync'
    repo = dict(
        git='git://git.fedorahosted.org/git/conga.git',
        web='https://git.fedorahosted.org/cgit/conga.git',
    )
    man = [
        'ccs_sync(8)',
    ]
    ids = dict(
        srpm='ricci',
        rpm='ricci',
        rhbz='ricci',
    )


class CmanLuci(Daemon, CmanRicciRPCSrc, HTTPSDst):
    defaults = dict((
        LABEL('luci'),
    ))
    summary = \
    "luci is a web front-end within cluster management (conga)"
    #web = 'https://sourceware.org/cluster/conga/'
    web = 'https://fedorahosted.org/cluster/wiki/Luci'
    repo = dict(
        git='git://git.fedorahosted.org/git/luci.git',
        web='https://git.fedorahosted.org/cgit/luci.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/luci-commits',
    )
    ids = dict(
        srpm='luci',
        rpm='luci',
        rhbz='luci',
    )
    doc = {
        'Configuring Red Hat High Availability Add-On With Conga'
        :'https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/ch-config-conga-CA.html',
        'Managing Red Hat High Availability Add-On With Conga'
        :'https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Cluster_Administration/ch-mgmt-conga-CA.html',
    }
    secprops = dict(
        euser='luci',
        egroup='luci',
        label='system_u:system_r:initrc_t:s0',
    )
    miscprops = dict(
        common_thread_cnt=11,  # can be really variable
        nice=10,
        ppid=1,
    )


class CmanModclusterd(Daemon, CmanModclusterdUpdatesPeer):
    defaults = dict((
        LABEL('modclusterd'),
    ))
    summary = \
    "modclusterd is a deamon facilitating info about cluster status (to conga)"
    location = '/usr/sbin/modclusterd'
    repo = dict(
        git='git://git.fedorahosted.org/git/conga.git',
        web='https://git.fedorahosted.org/cgit/conga.git',
    )
    ids = dict(
        srpm='clustermon',
        rpm='modcluster',
        rhbz='clustermon',
    )
    secprops = dict(
        euser='root',
        egroup='root',
        label='system_u:system_r:ricci_modclusterd_t:s0',
    )
    miscprops = dict(
        common_thread_cnt=3,
        nice=-1,
        ppid=1,
    )



class CmanQdiskd(Daemon):
    defaults = dict((
        LABEL('qdiskd'),
    ))
    summary = \
    "qdiskd is the cluster quorum disk daemon"
    repo = dict(
        git='git://git.fedorahosted.org/git/cluster.git',
        web='https://git.fedorahosted.org/cgit/cluster.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/cluster-commits',
    )
    man = [
        'qdiskd(8)',
    ]
    ids = dict(
        srpm='cluster',
        rpm='cman',
        rhbz='cluster',
    )


class  CmanModcluster(Executable):
    defaults = dict((
        LABEL('modcluster'),
    ))
    summary = \
    "modcluster is a ricci's helper dealing with cluster config and status"
    location = '/usr/libexec/modcluster'
    repo = dict(
        git='git://git.fedorahosted.org/git/conga.git',
        web='https://git.fedorahosted.org/cgit/conga.git',
    )
    ids = dict(
        srpm='clustermon',
        rpm='modcluster',
        rhbz='clustermon',
    )
    secprops = dict(
        euser='',
        egroup='',
        label='',
    )


class CmanFenced(Daemon):
    defaults = dict((
        LABEL('fenced'),
    ))
    summary = \
    "fenced is an I/O fencing daemon"
    location = '/usr/sbin/fenced'
    repo = dict(
        git='git://git.fedorahosted.org/git/cluster.git',
        web='https://git.fedorahosted.org/cgit/cluster.git',
        ml='https://lists.fedorahosted.org/mailman/listinfo/cluster-commits',
    )
    man = [
        'fenced(8)',
    ]
    ids = dict(
        srpm='cluster',
        rpm='cman',
        rhbz='cman',
    )
    secprops = dict(
        euser='root',
        egroup='root',
        label='system_u:system_r:fenced_t:s0',
    )
    miscprops = dict(
        common_thread_cnt=3,  # ?
        nice=0,
        ppid=1,
    )