GlusterFS (cluster)

Deploy GlusterFS, an open source, distributed network filesystem designed to scale out and handle large amounts of data across compute instances. It replicates data across multiple servers into a single application mount point, allowing seamless access to files from client instances, and provides high availability and fault tolerance.

📘

Cluster deployment

This app deploys three Linode instances to create a distributed GlusterFS cluster, each with the plan type and size you select.

Each of these Linode instances will appear on your invoice as separate items.

1. Deploy GlusterFS cluster

 Estimated deployment time: 5–10 minutes

Follow the deployment instructions from the Get started section to configure the app, deploy it, and verify software installation.

For information on the app-specific configurations, see the Configuration options section.

Software included

Software installed on your Linode when deploying the app.

SoftwareDescription
GlusterFSA distributed network filesystem.
FirewalldA firewall to restrict port-level access to the cluster.

Base distribution and plan

  • Supported distribution: Ubuntu 24.04 LTS
  • Recommended plan: All plan types and sizes can be used depending on your storage needs.

Configuration options

Configure the required options to deploy your instance. For additional customization, add advanced options.

The table maps the Cloud Manager UI fields to their corresponding API/CLI keys (stackscript_data) required for automated deployments.

StackScript ID: 1350783

UI fieldAPI/CLI keyDescription
Required options
Linode API tokentoken_passwordA valid Linode API token used to deploy the additional Linode instances that make up this cluster.
Follow Manage personal access tokens to get a token on your account with Read/Write access to Linodes.
Limited sudo useruser_nameYour preferred username for the limited sudo user, entered without any capital letters, spaces, or special characters.
When adding a limited sudo user, the user is created with a strong generated password for your new Linode instance, and the account is assigned to the sudo group, which provides elevated permissions when running commands with the sudo prefix.
Note: For easier and more secure access with the sudo user, add an account SSH key for the Cloud Manager user during deployment and select that user as an authorized_user. Their SSH pubkey will be assigned to both the root and limited sudo users.
Advanced options
SSL InformationsslheaderSet to Yes by default. This requires providing details for a self-signed TLS/SSL certificate.
Add Account SSH Keys to All Nodesadd_ssh_keysWhen set to yes, any SSH Keys that are added to the root user account (in the SSH Keys section), are also added to your limited user account on all deployed Linode instances. Possible values are yes or no. Defaults to yes.
Cluster SettingsclusterheaderSet to Yes by default. Details of the cluster settings, including the cluster size and the list of IP addresses to allow.
Gluster cluster sizecluster_sizeThe number of Linode instances created as part of this cluster. Value is fixed at 3.
List of IP addresses to whitelistclient_ipsA comma-separated list of client IP addresses allowed to access the GlusterFS cluster. SSL certificates are created for the provided IP addresses.

Note: After the app deployment completes, the password for your limited sudo user is generated and stored in the .credentials file in the home directory, along with application-specific passwords. Log in to your instance as root through the Lish console or SSH, then run cat /home/$USERNAME/.credentials to view its contents.

Use API, CLI, or Terraform

In addition to deploying the app to a new Linode instance via Cloud Manager, you can also use the Linode API, CLI, or Terraform. When running the operation, you need to provide the StackScript ID, supported Linux distribution, and app-specific fields along with the standard Linode deployment configurations.

Note: Generate a personal access token to authenticate your API, CLI, or Terraform requests.

curl --location 'https://api.linode.com/v4/linode/instances' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer abc123def456hij789klm' \
    --data-raw '{
        "region": "us-east",
        "type": "g6-standard-2",
        "image": "linode/ubuntu24.04",
        "label": "my-glusterfs-cluster-one-click-app",
        "root_pass": "@C0mpl3x#P@ssw0rd",
        "stackscript_id": 1350783,
        "stackscript_data": {
            "token_password": "abc123def456hij789klm",
            "user_name": "jsmith"
        }
    }'
linode-cli linodes create \
    --region us-east \
    --type g6-standard-2 \
    --label my-glusterfs-cluster-one-click-app \
    --image linode/ubuntu24.04 \
    --root_pass @C0mpl3x#P@ssw0rd \
    --stackscript_id 1350783 \
    --stackscript_data '{"token_password":"abc123def456hij789klm", "user_name":"jsmith"}'
resource "linode_instance" "my-linode" {
    region         = "us-east"
    type           = "g6-standard-2"
    label          = "my-glusterfs-cluster-one-click-app"
    image          = "linode/ubuntu24.04"
    root_pass      = "@C0mpl3x#P@ssw0rd"
    stackscript_id = 1350783
    stackscript_data = {
        "token_password" = "abc123def456hij789klm"
        "user_name"      = "jsmith"
    }
}

2. Use GlusterFS

Install the client

Before you can use your new GlusterFS cluster, your clients need to install a single dependency to mount GlusterFS as a filesystem. On every client node, install the GlusterFS client.

sudo apt install glusterfs-client

Configure secure access

Ensure that the GlusterFS client knows you're using SSL certificates. On every client node, create the secure-access file.

mkdir /var/lib/glusterd
touch /var/lib/glusterd/secure-access

Copy client certificates

If you provided client IPs during cluster creation, SSL certificates are on the first GlusterFS server in /usr/lib/ssl.

(env) root@gluster1:/usr/lib/ssl# ls -l
total 68
lrwxrwxrwx 1 root root    14 Mar 16  2022 certs -> /etc/ssl/certs
-rw-r--r-- 1 root root  1630 Mar 28 14:40 client1.csr
-rw------- 1 root root  3243 Mar 28 14:40 client1.key
-rw-r--r-- 1 root root  1761 Mar 28 14:40 client1.pem
-rw-r--r-- 1 root root  1630 Mar 28 14:40 client2.csr
-rw------- 1 root root  3243 Mar 28 14:40 client2.key
-rw-r--r-- 1 root root  1761 Mar 28 14:40 client2.pem
-rw-r--r-- 1 root root  1630 Mar 28 14:40 client3.csr
-rw------- 1 root root  3243 Mar 28 14:40 client3.key
-rw-r--r-- 1 root root  1761 Mar 28 14:40 client3.pem
-rw-r--r-- 1 root root   769 Mar 28 14:40 dhparams.pem
-rw-r--r-- 1 root root 10584 Mar 28 14:40 glusterfs.ca
-rw-r--r-- 1 root root  1635 Mar 28 14:40 glusterfs.csr
-rw------- 1 root root  3243 Mar 28 14:40 glusterfs.key
-rw-r--r-- 1 root root  1765 Mar 28 14:40 glusterfs.pem
drwxr-xr-x 2 root root  4096 Mar 28 14:16 misc
lrwxrwxrwx 1 root root    20 Feb 16 08:51 openssl.cnf -> /etc/ssl/openssl.cnf
lrwxrwxrwx 1 root root    16 Mar 16  2022 private -> /etc/ssl/private

The output assumes you created three client certificates. For each client, copy the following from the first server to the client's /usr/lib/ssl directory.

  • client[N].pem → /usr/lib/ssl/glusterfs.pem
  • client[N].key → /usr/lib/ssl/glusterfs.key
  • glusterfs.ca → /usr/lib/ssl/glusterfs.ca

Mount the filesystem

  1. Mount GlusterFS from a client node, replacing gluster1 with the private IP address of the first GlusterFS instance.

    mount -t glusterfs gluster1:/data-volume /mnt
  2. Update the client's /etc/hosts file with your GlusterFS IP addresses.

    192.168.139.160 gluster1
    192.168.201.13 gluster2
    192.168.230.83 gluster3
  3. To mount the GlusterFS filesystem automatically on boot, add the following to /etc/fstab, replacing MYMOUNT with your mount location.

    gluster1:/data-volume  /MYMOUNT  glusterfs defaults,_netdev,backup-volfile-servers=gluster2:gluster3 0 0

Repeat the steps for each additional client that needs to be configured.

Additional resources

For more information about the installed packages, see their official documentation.

📘

Note that we can't vouch for the accuracy or timeliness of externally hosted resources.


Did this page help you?