From 5ad3e3118142c96f6605be3cf8834957de27d940 Mon Sep 17 00:00:00 2001 From: Cormac Garvey Date: Mon, 27 Apr 2020 16:39:42 -0500 Subject: [PATCH] Initial glusterfs --- examples/glusterfs_lsv2_nvme/config.json | 195 +++++++++++++++++++++++ scripts/glusterfs_client.sh | 8 + scripts/glusterfs_pkgs.sh | 4 + scripts/glusterfs_pool.sh | 4 + scripts/glusterfs_vol.sh | 21 +++ 5 files changed, 232 insertions(+) create mode 100644 examples/glusterfs_lsv2_nvme/config.json create mode 100755 scripts/glusterfs_client.sh create mode 100755 scripts/glusterfs_pkgs.sh create mode 100755 scripts/glusterfs_pool.sh create mode 100755 scripts/glusterfs_vol.sh diff --git a/examples/glusterfs_lsv2_nvme/config.json b/examples/glusterfs_lsv2_nvme/config.json new file mode 100644 index 00000000..a3aa6bc7 --- /dev/null +++ b/examples/glusterfs_lsv2_nvme/config.json @@ -0,0 +1,195 @@ +{ + "location": "variables.location", + "resource_group": "variables.resource_group", + "install_from": "headnode", + "admin_user": "hpcadmin", + "vnet": { + "name": "hpcvnet", + "address_prefix": "10.2.0.0/20", + "subnets": { + "compute": "10.2.0.0/22", + "storage": "10.2.4.0/24" + } + }, + "variables": { + "resource_group": "", + "location": "southcentralus", + "image": "OpenLogic:CentOS:7.7:latest", + "glusterfsimage": "OpenLogic:CentOS:7.7:latest", + "hpcimage": "OpenLogic:CentOS-HPC:7.7:latest", + "compute_vm_type": "Standard_HB60rs", + "compute_instances": 2, + "glusterfs_instances": 4, + "low_priority": false, + "glusterfs_mount": "/glusterfs" + }, + "resources": { + "headnode": { + "type": "vm", + "vm_type": "Standard_D8s_v3", + "accelerated_networking": true, + "public_ip": true, + "image": "variables.image", + "subnet": "compute", + "tags": [ + "disable-selinux", + "cndefault", + "lfsrepo", + "lfsclient", + "lfsazimport", + "localuser", + "pbsserver", + "loginnode", + "nfsserver" + ] + }, + "compute": { + "type": "vmss", + "vm_type": "variables.compute_vm_type", + "accelerated_networking": true, + "instances": "variables.compute_instances", + "low_priority": "variables.low_priority", + "image": "variables.hpcimage", + "subnet": "compute", + "tags": [ + "disable-selinux", + "cndefault", + "lfsrepo", + "lfsclient", + "localuser", + "pbsclient", + "nfsclient", + "glusterfs_client" + ] + }, + "glusterfs": { + "type": "vmss", + "vm_type": "Standard_L16s_v2", + "instances": "variables.glusterfs_instances", + "accelerated_networking": true, + "image": "variables.glusterfsimage", + "subnet": "storage", + "tags": [ + "cndefault", + "lustre", + "lfsrepo", + "disable-selinux", + "create_raid0", + "make_filesystem", + "glusterfs_pkgs", + "glusterfs_vol", + "glusterfs_pool" + ] + } + }, + "install": [ + { + "script": "disable-selinux.sh", + "tag": "disable-selinux", + "sudo": true + }, + { + "script": "cndefault.sh", + "tag": "cndefault", + "sudo": true + }, + { + "script": "install-nfsserver.sh", + "tag": "nfsserver", + "args": [ + "/share" + ], + "sudo": true + }, + { + "script": "nfsclient.sh", + "args": [ + "$(> /etc/fstab +mount -a +chmod 777 $MOUNT_PT diff --git a/scripts/glusterfs_pkgs.sh b/scripts/glusterfs_pkgs.sh new file mode 100755 index 00000000..d876d02b --- /dev/null +++ b/scripts/glusterfs_pkgs.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +yum install -y centos-release-gluster +yum install -y glusterfs-server diff --git a/scripts/glusterfs_pool.sh b/scripts/glusterfs_pool.sh new file mode 100755 index 00000000..a2862895 --- /dev/null +++ b/scripts/glusterfs_pool.sh @@ -0,0 +1,4 @@ +#/bin/bash + +GLUSTERFSNODE0=$1 +gluster peer probe $GLUSTERFSNODE0 diff --git a/scripts/glusterfs_vol.sh b/scripts/glusterfs_vol.sh new file mode 100755 index 00000000..a6df18ae --- /dev/null +++ b/scripts/glusterfs_vol.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +HOSTLIST=$1 +REPLICA=$2 + +if [ "$PSSH_NODENUM" = "0" ]; then + for host in `cat hostlists/$HOSTLIST` + do + hosts_str=${host_str}"$host:/mnt/resource_nvme " + done + echo $hosts_str + + replica_str="" + if [ $REPLICAS -gt 0 ]; then + replica_str="replica $REPLICA" + fi + + gluster volume create flusterfs_vol $replica_str $hosts_str + + gluster volume info +fi