3
function ta_create_ta_and_volfile()
6
mkdir -p $b/.glusterfs/indices
14
type features/thin-arbiter
20
option notify-contention yes
21
subvolumes ta-thin-arbiter
26
option cache-invalidation off
31
type performance/io-threads
37
option xattrop-pending-watchlist trusted.afr.ta-
38
option xattrop-dirty-watchlist trusted.afr.dirty
39
option index-base $b/.glusterfs/indices
40
subvolumes ta-io-threads
45
option count-fop-hits off
46
option latency-measurement off
47
option log-level WARNING
54
option transport.listen-backlog 10
55
option transport.socket.keepalive-count 9
56
option transport.socket.keepalive-interval 2
57
option transport.socket.keepalive-time 20
58
option transport.tcp-user-timeout 0
59
option transport.socket.keepalive 1
60
option auth.addr.$b.allow *
62
option transport.address-family inet
63
option transport-type tcp
64
subvolumes ta-io-stats
69
function ta_create_brick_and_volfile()
72
mkdir -p $b/.glusterfs/indices
73
cat > $B0/${1}.vol <<EOF
81
subvolumes ${V0}-posix
87
subvolumes ${V0}-locks
92
option cache-invalidation off
93
subvolumes ${V0}-leases
96
volume ${V0}-io-threads
97
type performance/io-threads
98
subvolumes ${V0}-upcall
103
option xattrop-pending-watchlist trusted.afr.${V0}-
104
option xattrop-dirty-watchlist trusted.afr.dirty
105
option index-base $b/.glusterfs/indices
106
subvolumes ${V0}-io-threads
111
option count-fop-hits off
112
option latency-measurement off
113
option log-level INFO
115
subvolumes ${V0}-index
120
option transport.listen-backlog 1024
121
option transport.socket.keepalive-count 9
122
option transport.socket.keepalive-interval 2
123
option transport.socket.keepalive-time 20
124
option transport.tcp-user-timeout 0
125
option transport.socket.keepalive 1
126
option auth.addr.$b.allow *
128
option auth.login.459d48e8-2a92-4f11-89f2-077b29f6f86d.password a0ad63dd-8314-4f97-9160-1b93e3cb1f0b
129
option auth.login.$b.allow 459d48e8-2a92-4f11-89f2-077b29f6f86d
130
option transport.address-family inet
131
option transport-type tcp
137
function ta_set_port_by_name()
139
if [ -z ${PORTMAP[$1]} ]
141
PORTMAP[$1]=$PORTCURR
142
PORTCURR=$((PORTCURR+1))
146
function ta_start_brick_process()
148
ta_set_port_by_name $1
149
local p=${PORTMAP[$1]}
150
if glusterfs -p $B0/${1}.pid --volfile=$B0/${1}.vol -l $(gluster --print-logdir)/${1}.log --xlator-option ${V0}-server.listen-port=$p
159
function ta_start_ta_process()
161
ta_set_port_by_name $1
162
local p=${PORTMAP[$1]}
163
if glusterfs -p $B0/${1}.pid --volfile=$B0/${1}.vol -l $(gluster --print-logdir)/${1}.log --xlator-option ta-server.listen-port=$p
172
function ta_start_mount_process()
175
identifier=$(echo $1 | tr / .)
176
if glusterfs --entry-timeout=0 --attribute-timeout=0 -p $B0/${identifier}.pid --volfile=$B0/mount.vol $1
178
cat $B0/$identifier.pid
185
function ta_get_mount_pid()
188
identifier=$(echo $mount_path | tr / .)
189
cat $B0/${identifier}.pid
192
function ta_create_mount_volfile()
197
local b0_port=${PORTMAP[$1]}
198
local b1_port=${PORTMAP[$2]}
199
local ta_port=${PORTMAP[$3]}
200
cat > $B0/mount.vol <<EOF
203
option remote-host $H0
204
option client-bind-insecure off
205
option transport.socket.keepalive-interval 2
206
option transport.socket.keepalive-time 20
207
option transport.socket.ssl-enabled off
208
option remote-subvolume $b0
209
option transport.tcp-user-timeout 0
210
option transport.socket.keepalive-count 9
211
option transport-type tcp
212
option ping-timeout 42
214
option remote-port $b0_port
215
option password a0ad63dd-8314-4f97-9160-1b93e3cb1f0b
216
option username 459d48e8-2a92-4f11-89f2-077b29f6f86d
221
option remote-host $H0
222
option client-bind-insecure off
223
option transport.socket.keepalive-interval 2
224
option transport.socket.keepalive-time 20
225
option transport.socket.ssl-enabled off
226
option remote-subvolume $b1
227
option transport.tcp-user-timeout 0
228
option transport.socket.keepalive-count 9
229
option transport-type tcp
230
option ping-timeout 42
232
option remote-port $b1_port
233
option password a0ad63dd-8314-4f97-9160-1b93e3cb1f0b
234
option username 459d48e8-2a92-4f11-89f2-077b29f6f86d
237
volume ${V0}-thin-arbiter-client
239
option client-bind-insecure off
240
option transport.socket.ssl-enabled off
241
option remote-subvolume $ta
242
option ping-timeout 42
243
option remote-host $H0
245
option transport.socket.keepalive-interval 2
246
option remote-port $ta_port
247
option transport-type tcp
248
option transport.tcp-user-timeout 0
249
option transport.socket.keepalive-time 20
250
option transport.socket.keepalive-count 9
253
volume ${V0}-replicate-0
254
type cluster/replicate
255
option afr-dirty-xattr trusted.afr.dirty
256
option iam-self-heal-daemon off
257
option afr-pending-xattr ${V0}-client-0,${V0}-client-1,${V0}-ta-2
258
option thin-arbiter $H0:$ta
259
subvolumes ${V0}-client-0 ${V0}-client-1 ${V0}-thin-arbiter-client
262
volume ${V0}-distribute
263
type cluster/distribute
264
option rebal-throttle normal
265
option force-migration off
266
option lookup-optimize on
267
option weighted-rebalance on
268
option write-freq-threshold 0
269
option assert-no-child-down off
270
option lock-migration off
271
option lookup-unhashed on
272
option randomize-hash-range-by-gfid off
273
option unhashed-sticky-bit off
274
option use-readdirp on
275
option readdir-optimize off
276
option xattr-name trusted.glusterfs.dht
277
option read-freq-threshold 0
278
option min-free-disk 10%
279
option min-free-inodes 5%
280
option rebalance-stats off
281
subvolumes ${V0}-replicate-0
284
volume ${V0}-write-behind
285
type performance/write-behind
286
option strict-O_DIRECT off
287
option strict-write-ordering off
288
option resync-failed-syncs-after-fsync off
289
option aggregate-size 128KB
290
option flush-behind on
291
option cache-size 1MB
292
option trickling-writes on
293
subvolumes ${V0}-distribute
296
volume ${V0}-read-ahead
297
type performance/read-ahead
298
option force-atime-update false
300
option page-size 131072
301
option pass-through false
302
subvolumes ${V0}-write-behind
305
volume ${V0}-readdir-ahead
306
type performance/readdir-ahead
307
option rda-low-wmark 4096
308
option rda-high-wmark 128KB
309
option rda-cache-limit 10MB
310
option parallel-readdir off
311
option pass-through false
312
option rda-request-size 131072
313
subvolumes ${V0}-read-ahead
317
type performance/io-cache
318
option cache-timeout 1
319
option cache-size 32MB
320
option min-file-size 0
321
option max-file-size 0
322
option pass-through false
323
subvolumes ${V0}-readdir-ahead
326
volume ${V0}-quick-read
327
type performance/quick-read
328
option cache-invalidation false
329
option ctime-invalidation false
330
option cache-size 128MB
331
option cache-timeout 1
332
option max-file-size 64KB
333
subvolumes ${V0}-io-cache
336
volume ${V0}-open-behind
337
type performance/open-behind
338
option use-anonymous-fd yes
340
option read-after-open no
341
option pass-through false
342
subvolumes ${V0}-quick-read
346
type performance/md-cache
347
option pass-through false
348
option cache-capability-xattrs true
349
option cache-posix-acl false
350
option cache-swift-metadata true
351
option cache-samba-metadata false
352
option md-cache-timeout 1
353
option force-readdirp true
354
option cache-invalidation false
355
option md-cache-statfs off
356
option cache-selinux false
357
option cache-ima-xattrs true
358
subvolumes ${V0}-open-behind
361
volume ${V0}-io-threads
362
type performance/io-threads
363
option normal-prio-threads 16
364
option enable-least-priority on
366
option cleanup-disconnected-reqs off
367
option pass-through false
368
option thread-count 16
369
option high-prio-threads 16
370
option low-prio-threads 16
371
option least-prio-threads 1
372
subvolumes ${V0}-md-cache
377
option client-logger gluster-log
378
option client-log-buf-size 5
379
option latency-measurement off
380
option client-log-level INFO
381
option brick-log-level INFO
382
option count-fop-hits off
383
option sys-log-level CRITICAL
384
option brick-log-format with-msg-id
385
option brick-log-buf-size 5
386
option dump-fd-stats off
387
option ios-dump-interval 0
388
option ios-dump-format json
389
option client-log-format with-msg-id
390
option log-buf-size 5
391
option log-flush-timeout 120
392
option client-log-flush-timeout 120
393
option ios-sample-interval 0
394
option ios-sample-buf-size 65535
395
option brick-logger gluster-log
396
option ios-dnscache-ttl-sec 86400
397
option brick-log-flush-timeout 120
398
option unique-id /no/such/path
399
subvolumes ${V0}-io-threads
404
function ta_kill_brick()
406
local p=$(cat $B0/${1}.pid)
411
function ta_get_pid_by_brick_name()
416
function ta_up_status()
421
grep -E "^up = " $m/.meta/graphs/active/${v}-replicate-${replica_id}/private | cut -f2 -d'='
424
function ta_create_shd_volfile()
429
local b0_port=${PORTMAP[$1]}
430
local b1_port=${PORTMAP[$2]}
431
local ta_port=${PORTMAP[$3]}
432
cat > $B0/glustershd.vol <<EOF
433
volume ${V0}-replicate-0-client-0
436
option transport.socket.keepalive-interval 2
437
option remote-host $H0
438
option remote-subvolume $b0
439
option ping-timeout 42
440
option client-bind-insecure off
441
option transport.socket.own-thread off
442
option frame-timeout 1800
443
option non-blocking-io off
444
option transport.socket.keepalive 1
445
option transport.socket.keepalive-count 9
446
option transport.tcp-user-timeout 0
447
option transport.socket.nodelay 1
448
option transport.socket.keepalive-time 20
449
option transport.socket.read-fail-log off
450
option transport-type tcp
451
option filter-O_DIRECT disable
452
option event-threads 2
453
option transport.listen-backlog 1024
454
option transport.socket.ssl-enabled off
455
option password a0ad63dd-8314-4f97-9160-1b93e3cb1f0b
456
option username 459d48e8-2a92-4f11-89f2-077b29f6f86d
457
option remote-port $b0_port
460
volume ${V0}-replicate-0-client-1
462
option remote-host $H0
463
option transport.socket.keepalive-time 20
464
option transport.socket.keepalive-count 9
465
option transport.socket.own-thread off
466
option transport.socket.ssl-enabled off
467
option transport-type tcp
468
option remote-subvolume $b1
469
option event-threads 2
470
option transport.tcp-user-timeout 0
471
option transport.socket.keepalive 1
472
option transport.socket.nodelay 1
473
option transport.socket.read-fail-log off
474
option frame-timeout 1800
475
option ping-timeout 42
476
option client-bind-insecure off
477
option filter-O_DIRECT disable
479
option non-blocking-io off
480
option transport.listen-backlog 1024
481
option transport.socket.keepalive-interval 2
482
option password a0ad63dd-8314-4f97-9160-1b93e3cb1f0b
483
option username 459d48e8-2a92-4f11-89f2-077b29f6f86d
484
option remote-port $b1_port
487
volume ${V0}-replicate-0-thin-arbiter-client
489
option frame-timeout 1800
490
option event-threads 2
491
option transport.listen-backlog 1024
492
option transport.socket.nodelay 1
493
option transport.socket.keepalive-count 9
494
option transport.socket.ssl-enabled off
495
option transport-type tcp
496
option remote-subvolume $ta
497
option filter-O_DIRECT disable
498
option non-blocking-io off
499
option transport.socket.keepalive-interval 2
500
option transport.socket.read-fail-log off
501
option remote-host $H0
503
option transport.tcp-user-timeout 0
504
option transport.socket.keepalive-time 20
505
option ping-timeout 42
506
option client-bind-insecure off
507
option transport.socket.keepalive 1
508
option transport.socket.own-thread off
509
option remote-port $ta_port
512
volume ${V0}-replicate-0
513
type cluster/replicate
514
option background-self-heal-count 8
515
option metadata-self-heal on
516
option data-change-log on
517
option entrylk-trace off
518
option iam-self-heal-daemon yes
519
option afr-dirty-xattr trusted.afr.dirty
520
option heal-timeout 10
521
option read-hash-mode 1
522
option metadata-splitbrain-forced-heal off
523
option thin-arbiter $H0:$ta
524
option shd-max-threads 1
525
option afr-pending-xattr ${V0}-client-0,${V0}-client-1,${V0}-ta-2
526
option halo-max-latency 5
527
option halo-max-replicas 99999
528
option entry-change-log on
529
option halo-nfsd-max-latency 5
530
option inodelk-trace off
531
option pre-op-compat on
533
option self-heal-readdir-size 1KB
534
option ensure-durability on
535
option locking-scheme full
536
option halo-enabled False
537
option heal-wait-queue-length 128
538
option entry-self-heal on
539
option self-heal-daemon on
540
option quorum-reads no
541
option shd-wait-qlength 1024
542
option choose-local true
543
option halo-min-replicas 2
544
option data-self-heal on
545
option metadata-change-log on
546
option consistent-metadata no
548
option use-compound-fops no
549
option halo-shd-max-latency 99999
550
option quorum-type none
551
option favorite-child-policy none
552
option read-subvolume-index -1
553
option optimistic-change-log on
554
option iam-nfs-daemon off
555
option post-op-delay-secs 1
556
option granular-entry-heal no
557
option consistent-io no
558
option data-self-heal-window-size 1
559
subvolumes ${V0}-replicate-0-client-0 ${V0}-replicate-0-client-1 ${V0}-replicate-0-thin-arbiter-client
564
option log-buf-size 5
565
option ios-dump-format json
566
option latency-measurement off
567
option sys-log-level CRITICAL
568
option brick-log-level INFO
569
option client-logger gluster-log
570
option client-log-format with-msg-id
571
option brick-log-format with-msg-id
572
option client-log-buf-size 5
573
option log-flush-timeout 120
574
option ios-dump-interval 0
575
option ios-sample-interval 0
576
option ios-dnscache-ttl-sec 86400
577
option count-fop-hits off
578
option client-log-level INFO
579
option brick-logger gluster-log
580
option brick-log-buf-size 5
581
option ios-sample-buf-size 65535
582
option client-log-flush-timeout 120
583
option brick-log-flush-timeout 120
584
option unique-id /no/such/path
585
option dump-fd-stats off
586
subvolumes ${V0}-replicate-0
591
function ta_start_shd_process()
593
if glusterfs -p $B0/${1}.pid --volfile=$B0/${1}.vol -l $(gluster --print-logdir)/${1}.log --process-name=glustershd
602
function ta_mount_child_up_status()
605
#brick_id is (brick-num in volume info - 1)
608
local pid=$(ta_get_mount_pid $mount_path)
609
local fpath=$(generate_statedump $pid)
610
up=$(grep -a -B1 trusted.afr.$vol-client-$brick_id $fpath | head -1 | cut -f2 -d'=')