thin-arbiter : Provide scripts and service file to start thin-arbiter process
1 - setup-thin-arbiter.sh To setup directory path for thin-arbiter. This is the path where replica id file will be placed and used by TA process. By default it will be /mnt/thin-arbiter. It is better to use default path and once set it should not be changed. 2 - gluster-ta-volume.service This is the Unit file used by systemd to start and keep the thin-arbiter process running. 3 - thin-arbiter.vol This is the default volume file for thin-arbiter. It will be used to start thin-arbiter process. This should not be modified by user except the directory path which can be modified using [1]. Change-Id: I68f2164f24adfa326c1d1a7a98c6ac4ff04ed553 fixes: bz#1579786 Signed-off-by: Ashish Pandey <aspandey@redhat.com>
This commit is contained in:
parent
052fce3f31
commit
95e735b71b
@ -1,66 +0,0 @@
|
||||
volume rep-posix
|
||||
type storage/posix
|
||||
option shared-brick-count 3
|
||||
option volume-id dcd39537-006d-4bb5-abdd-b843636c18f6
|
||||
option directory /home/apandey/bricks/gluster/rep-3
|
||||
end-volume
|
||||
|
||||
volume rep-thin-arbiter
|
||||
type features/thin-arbiter
|
||||
subvolumes rep-posix
|
||||
end-volume
|
||||
|
||||
volume rep-locks
|
||||
type features/locks
|
||||
subvolumes rep-thin-arbiter
|
||||
end-volume
|
||||
|
||||
volume rep-upcall
|
||||
type features/upcall
|
||||
option cache-invalidation off
|
||||
subvolumes rep-locks
|
||||
end-volume
|
||||
|
||||
volume rep-io-threads
|
||||
type performance/io-threads
|
||||
subvolumes rep-upcall
|
||||
end-volume
|
||||
|
||||
volume rep-index
|
||||
type features/index
|
||||
option xattrop-pending-watchlist trusted.afr.rep-
|
||||
option xattrop-dirty-watchlist trusted.afr.dirty
|
||||
option index-base /home/apandey/bricks/gluster/rep-3/.glusterfs/indices
|
||||
subvolumes rep-io-threads
|
||||
end-volume
|
||||
|
||||
volume rep-io-stats
|
||||
type debug/io-stats
|
||||
option count-fop-hits off
|
||||
option latency-measurement off
|
||||
option log-level INFO
|
||||
option unique-id /home/apandey/bricks/gluster/rep-3
|
||||
subvolumes rep-index
|
||||
end-volume
|
||||
|
||||
volume /home/apandey/bricks/gluster/rep-3
|
||||
type performance/decompounder
|
||||
subvolumes rep-io-stats
|
||||
end-volume
|
||||
|
||||
volume rep-server
|
||||
type protocol/server
|
||||
option transport.listen-backlog 10
|
||||
option transport.socket.keepalive-count 9
|
||||
option transport.socket.keepalive-interval 2
|
||||
option transport.socket.keepalive-time 20
|
||||
option transport.tcp-user-timeout 0
|
||||
option transport.socket.keepalive 1
|
||||
option auth.addr./home/apandey/bricks/gluster/rep-3.allow *
|
||||
option auth-path /home/apandey/bricks/gluster/rep-3
|
||||
option auth.login.96d610de-c290-4ff9-ba22-783b5b1330ef.password b6f0db12-5e91-4aa7-9333-fd5339c6ea2d
|
||||
option auth.login./home/apandey/bricks/gluster/rep-3.allow 96d610de-c290-4ff9-ba22-783b5b1330ef
|
||||
option transport.address-family inet
|
||||
option transport-type tcp
|
||||
subvolumes /home/apandey/bricks/gluster/rep-3
|
||||
end-volume
|
13
extras/thin-arbiter/gluster-ta-volume.service
Normal file
13
extras/thin-arbiter/gluster-ta-volume.service
Normal file
@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description = Thin-arbiter process to maintain quorum for replica volume
|
||||
After = network.target
|
||||
|
||||
[Service]
|
||||
Environment = "LOG_LEVEL=WARNING"
|
||||
ExecStart = /usr/local/sbin/glusterfsd -N --volfile-id ta-vol -f /var/lib/glusterd/thin-arbiter/thin-arbiter.vol --brick-port 24007 --xlator-option ta-vol-server.transport.socket.listen-port=24007
|
||||
Restart = always
|
||||
KillMode=process
|
||||
SuccessExitStatus=15
|
||||
|
||||
[Install]
|
||||
WantedBy = multi-user.target
|
68
extras/thin-arbiter/setup-thin-arbiter.sh
Executable file
68
extras/thin-arbiter/setup-thin-arbiter.sh
Executable file
@ -0,0 +1,68 @@
|
||||
#! /bin/bash
|
||||
|
||||
volloc="/var/lib/glusterd/thin-arbiter"
|
||||
mkdir -p $volloc
|
||||
|
||||
cp -f extras/thin-arbiter/thin-arbiter.vol $volloc/thin-arbiter.vol
|
||||
tafile="$volloc/thin-arbiter.vol"
|
||||
|
||||
volfile_set_brick_path () {
|
||||
while read -r line
|
||||
do
|
||||
dir=`echo "$line" | cut -d' ' -f 2`
|
||||
if [ "$dir" = "directory" ]
|
||||
then
|
||||
bpath=`echo "$line" | cut -d' ' -f 3`
|
||||
sed -i -- 's?'$bpath'?'$1'?g' $tafile
|
||||
return
|
||||
fi
|
||||
done < $tafile
|
||||
}
|
||||
|
||||
tapath="/mnt/thin-arbiter"
|
||||
echo "Volume file to be used to start thin-arbiter process is :"
|
||||
echo "$tafile"
|
||||
echo " "
|
||||
echo "Default thin-arbiter path is : $tapath"
|
||||
echo -n "Do you want to change path for thin arbiter volumes. (y/N): "
|
||||
echo " "
|
||||
read moveon
|
||||
|
||||
if [ "${moveon}" = 'N' ] || [ "${moveon}" = 'n' ]; then
|
||||
echo "Default brick path, $tapath, has been set"
|
||||
echo "for all thin arbiter volumes using this node"
|
||||
echo " "
|
||||
else
|
||||
echo -n "Enter brick path for thin arbiter volumes: "
|
||||
read tapath
|
||||
echo "Entered brick path : $tapath "
|
||||
echo "Please note that this brick path will be used for ALL"
|
||||
echo "VOLUMES using this node to host thin-arbiter brick"
|
||||
echo " "
|
||||
fi
|
||||
|
||||
mkdir -p $tapath/.glusterfs/indices
|
||||
volfile_set_brick_path "$tapath"
|
||||
|
||||
echo "Directory path to be used for thin-arbiter volume is: $tapath"
|
||||
echo " "
|
||||
|
||||
echo "========================================================"
|
||||
|
||||
echo "Installing and starting service for thin-arbiter process"
|
||||
|
||||
cp extras/thin-arbiter/gluster-ta-volume.service /etc/systemd/system/
|
||||
|
||||
chmod 0777 /etc/systemd/system/gluster-ta-volume.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable gluster-ta-volume
|
||||
systemctl stop gluster-ta-volume
|
||||
systemctl start gluster-ta-volume
|
||||
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
echo "thin-arbiter process is setup and running"
|
||||
else
|
||||
echo "Failed to setup thin arbiter"
|
||||
fi
|
57
extras/thin-arbiter/thin-arbiter.vol
Normal file
57
extras/thin-arbiter/thin-arbiter.vol
Normal file
@ -0,0 +1,57 @@
|
||||
volume ta-posix
|
||||
type storage/posix
|
||||
option directory /mnt/thin-arbiter
|
||||
end-volume
|
||||
|
||||
volume ta-thin-arbiter
|
||||
type features/thin-arbiter
|
||||
subvolumes ta-posix
|
||||
end-volume
|
||||
|
||||
volume ta-locks
|
||||
type features/locks
|
||||
subvolumes ta-thin-arbiter
|
||||
end-volume
|
||||
|
||||
volume ta-upcall
|
||||
type features/upcall
|
||||
option cache-invalidation off
|
||||
subvolumes ta-locks
|
||||
end-volume
|
||||
|
||||
volume ta-io-threads
|
||||
type performance/io-threads
|
||||
subvolumes ta-upcall
|
||||
end-volume
|
||||
|
||||
volume ta-index
|
||||
type features/index
|
||||
option xattrop-pending-watchlist trusted.afr.ta-
|
||||
option xattrop-dirty-watchlist trusted.afr.dirty
|
||||
option index-base /mnt/thin-arbiter/.glusterfs/indices
|
||||
subvolumes ta-io-threads
|
||||
end-volume
|
||||
|
||||
volume ta-io-stats
|
||||
type debug/io-stats
|
||||
option count-fop-hits off
|
||||
option latency-measurement off
|
||||
option log-level WARNING
|
||||
option unique-id /mnt/thin-arbiter
|
||||
subvolumes ta-index
|
||||
end-volume
|
||||
|
||||
volume ta-server
|
||||
type protocol/server
|
||||
option transport.listen-backlog 10
|
||||
option transport.socket.keepalive-count 9
|
||||
option transport.socket.keepalive-interval 2
|
||||
option transport.socket.keepalive-time 20
|
||||
option transport.tcp-user-timeout 0
|
||||
option transport.socket.keepalive 1
|
||||
option auth.addr./mnt/thin-arbiter.allow *
|
||||
option auth-path /mnt/thin-arbiter
|
||||
option transport.address-family inet
|
||||
option transport-type tcp
|
||||
subvolumes ta-io-stats
|
||||
end-volume
|
Loading…
Reference in New Issue
Block a user