Configuring and Managing Red Hat Storage Server
Edition 1
Legal Notice
Abstract
- Preface
- I. Introduction
- II. Red Hat Storage Administration On-Premise
- 6. Managing the glusterd Service
- 7. Setting up Trusted Storage Pools
- 8. Setting up Red Hat Storage Volumes
- 8.1. Formatting and Mounting Bricks
- 8.2. Encrypted Disk
- 8.3. Creating Distributed Volumes
- 8.4. Creating Replicated Volumes
- 8.5. Creating Distributed Replicated Volumes
- 8.6. Creating Striped Volumes
- 8.7. Creating Striped Replicated Volumes
- 8.8. Creating Distributed Striped Volumes
- 8.9. Creating Distributed Striped Replicated Volumes
- 8.10. Starting Volumes
- 9. Accessing Data - Setting Up Clients
- 10. Managing Red Hat Storage Volumes
- 11. Managing Geo-replication
- 11.1. Replicated Volumes vs Geo-replication
- 11.2. Preparing to Deploy Geo-replication
- 11.3. Starting Geo-replication
- 11.4. Restoring Data from the Slave
- 11.5. Triggering Geo-replication Failover and Failback
- 11.6. Best Practices
- 11.7. Troubleshooting Geo-replication
- 11.7.1. Locating Log Files
- 11.7.2. Rotating Geo-replication Logs
- 11.7.3. Synchronization is not complete
- 11.7.4. Issues in Data Synchronization
- 11.7.5. Geo-replication status displays Faulty very often
- 11.7.6. Intermediate Master goes to Faulty State
- 11.7.7. Remote gsyncd Not Found
- 11.7.8. Remote gsyncd Not Found
- 12. Managing Directory Quota
- 13. Monitoring your Red Hat Storage Workload
- 13.1. Running Volume Profile Command
- 13.2. Running Volume Top Command
- 13.2.1. Viewing Open File Descriptor Count and Maximum File Descriptor Count
- 13.2.2. Viewing Highest File Read Calls
- 13.2.3. Viewing Highest File Write Calls
- 13.2.4. Viewing Highest Open Calls on Directory
- 13.2.5. Viewing Highest Read Calls on Directory
- 13.2.6. Viewing List of Read Performance
- 13.2.7. Viewing List of Write Performance
- 13.3. Listing Volumes
- 13.4. Displaying Volume Information
- 13.5. Performing Statedump on a Volume
- 13.6. Displaying Volume Status
- 14. Managing Red Hat Storage Volume Life-Cycle Extensions
- III. Red Hat Storage Administration on Public Cloud
- IV. Data Access with Other Interfaces
- V. Appendices
- A. Revision History
Mono-spaced Bold
To see the contents of the filemy_next_bestselling_novelin your current working directory, enter thecat my_next_bestselling_novelcommand at the shell prompt and press Enter to execute the command.
Press Enter to execute the command.Press Ctrl+Alt+F2 to switch to a virtual terminal.
mono-spaced bold. For example:
File-related classes includefilesystemfor file systems,filefor files, anddirfor directories. Each class has its own associated set of permissions.
Choose → → from the main menu bar to launch Mouse Preferences. In the Buttons tab, select the Left-handed mouse check box and click to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand).To insert a special character into a gedit file, choose → → from the main menu bar. Next, choose → from the Character Map menu bar, type the name of the character in the Search field and click . The character you sought will be highlighted in the Character Table. Double-click this highlighted character to place it in the Text to copy field and then click the button. Now switch back to your document and choose → from the gedit menu bar.
Mono-spaced Bold Italic or Proportional Bold Italic
To connect to a remote machine using ssh, typesshat a shell prompt. If the remote machine isusername@domain.nameexample.comand your username on that machine is john, typessh john@example.com.Themount -o remountcommand remounts the named file system. For example, to remount thefile-system/homefile system, the command ismount -o remount /home.To see the version of a currently installed package, use therpm -qcommand. It will return a result as follows:package.package-version-release
Publican is a DocBook publishing system.
mono-spaced roman and presented thus:
books Desktop documentation drafts mss photos stuff svn books_tests Desktop1 downloads images notes scripts svgs
mono-spaced roman but add syntax highlighting as follows:
static int kvm_vm_ioctl_deassign_device(struct kvm *kvm,
struct kvm_assigned_pci_dev *assigned_dev)
{
int r = 0;
struct kvm_assigned_dev_kernel *match;
mutex_lock(&kvm->lock);
match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,
assigned_dev->assigned_dev_id);
if (!match) {
printk(KERN_INFO "%s: device hasn't been assigned before, "
"so cannot be deassigned\n", __func__);
r = -EINVAL;
goto out;
}
kvm_deassign_device(kvm, match);
kvm_free_assigned_device(kvm, match);
out:
mutex_unlock(&kvm->lock);
return r;
}Note
Important
Warning
- search or browse through a knowledgebase of technical support articles about Red Hat products.
- submit a support case to Red Hat Global Support Services (GSS).
- access other product documentation.
Table of Contents
Note
- Elastic ScalabilityStorage volumes are abstracted from the hardware, allowing each of the volume to be managed independently. Volumes can be expanded or shrunk by adding or removing systems from the storage pool, or by adding or removing storage from individual machines in the pool, all while data remains available and with no application interruption.
- CompatibilityDue to native POSIX compatibility and support for SMB, NFS, and HTTP protocols, Red Hat Storage Server is readily supported by industry standard storage management and backup software.
- High AvailabilityAutomatic replication ensures high levels of data protection and resiliency, if hardware fails. Self-healing capabilities restore data to the correct state following recovery.
- Unified Global NamespaceAn unified global namespace aggregates disk and memory resources into a single common pool, simplifying management of the storage environment and eliminating data silos. Namespaces can be expanded or shrunk dynamically, with no interruption to client access.
- Efficient Data AccessRed Hat Storage Server provides fast and efficient random access, ensuring speedy data recovery when needed.
- Petabyte ScalabilityRed Hat Storage Server’s fully distributed architecture and advanced file management algorithms allow it to support multi-petabyte repositories with ease.
- High Performance with no bottleneckRed Hat Storage Server enables quick fast file access by algorithmically spreading files evenly throughout the system, without a centralized metadata server. As the nodes can access storage nodes directly, hot spots, choke points, and other I/O bottlenecks are eliminated. Hence, contention for data is reduced and there is no single point of failure.
- Elastic ScalabilityStorage volumes are abstracted from hardware, allowing each to be managed independently. Storage can be added or removed from the storage pools while data continues to be available, with no application interruption. Volumes can be expanded or shrink across machines. It can be migrated within the system to rebalance capacity or add/remove systems on-the-fly, allowing HPC environments to scale seamlessly.
- Infiniband SupportRed Hat Storage Server supports IP over Infiniband (IPoIB). Infiniband as a back-end interconnect for the storage pool is recommended as it provides additional options for maximizing performance. Using RDMA as a mount protocol for its native client is a technology preview feature.
- CompatibilityDue to native POSIX compatibility and support for the SMB, NFS and HTTP protocols, Red Hat Storage Server supports existing applications with no code changes required.
- ElasticityStorage volumes are abstracted from hardware, allowing each to be managed independently. Storage can be added or removed from the storage pools while data continues to be available, with no application interruption. Volumes can be expanded or shrink across machines. It can be migrated within the system to rebalance capacity or add/remove systems on-the-fly and scale seamlessly.
- Petabyte ScalabilityRed Hat Storage Server’s fully distributed architecture and advanced file management algorithms allow it to support multi-petabyte repositories with ease.
- High PerformanceRed Hat Storage Server enables quick fast file access by algorithmically spreading files evenly throughout the system, without a centralized metadata server. As the nodes can access storage nodes directly, hot spots, choke points, and other I/O bottlenecks are eliminated. Hence, contention for data is reduced and there is no single point of failure.
- CompatibilityDue to native POSIX compatibility and support for the SMB, NFS and HTTP protocols, Red Hat Storage Server supports existing applications with no code changes required.
- Unified File and Object AccessFiles may be accessed through a simple Web Service REST (Representational State Transfer) interface, enabling easy sharing of files across the Internet, without sacrificing the convenience of loading and managing files through native Unix, Linux, and Windows protocols.
- ReliabilityReplication ensures high levels of data protection and resiliency, even in the event of hardware failure. Self-healing capabilities restore data to the correct state after recovery.
- Brick
- A brick is the glusterFS basic unit of storage, represented by an export directory on a server in the trusted storage pool. A Brick is expressed by combining a server with an export directory in the following format:
SERVER:EXPORTFor example:myhostname:/exports/myexportdir/ - Block Storage
- Block special files or block devices correspond to devices through which the system moves data in the form of blocks. These device nodes often represent addressable devices such as hard disks, CD-ROM drives, or memory-regions. Red Hat Storage supports XFS file system with extended attributes.
- Cluster
- A trusted pool of linked computers, working together closely thus in many respects forming a single computer. In Red Hat Storage terminology a cluster is called as trusted storage pool.
- Client
- The machine which mounts the volume (this may also be a server)
- Distributed File System
- A file system that allows multiple clients to concurrently access data spread across multiple servers/bricks in a trusted storage pool. Data sharing among multiple locations is fundamental to all distributed file systems.
- File System
- A method of storing and organizing computer files and their data. Essentially, it organizes these files into a database for the storage, organization, manipulation, and retrieval by the computer's operating system.Source: Wikipedia
- FUSE
- Filesystem in Userspace (FUSE) is a loadable kernel module for Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in user space while the FUSE module provides only a "bridge" to the actual kernel interfaces.Source: Wikipedia
- Geo-Replication
- Geo-replication provides a continuous, asynchronous, and incremental replication service from site to another over Local Area Networks (LAN), Wide Area Network (WAN), and across the Internet.
- glusterd
- The glusterFS management daemon that needs to run on all servers in the trusted storage pool.
- Metadata
- Metadata is data providing information about one or more other pieces of data.
- N-way Replication
- Local synchronous data replication typically deployed across campus or Amazon Web Services Availability Zones.
- Namespace
- Namespace is an abstract container or environment created to hold a logical grouping of unique identifiers or symbols. Each Red Hat Storage trusted storage pool exposes a single namespace as a POSIX mount point that contains every file in the trusted storage pool.
- Petabyte
- A petabyte (derived from the SI prefix peta- ) is a unit of information equal to one quadrillion (short scale) bytes, or 1000 terabytes. The unit symbol for the petabyte is PB. The prefix peta- (P) indicates a power of 1000:1 PB = 1,000,000,000,000,000 B = 1000^5 B = 10^15 B.The term "pebibyte" (PiB), using a binary prefix, is used for the corresponding power of 1024.Source: Wikipedia
- POSIX
- Portable Operating System Interface (for Unix) is the name of a family of related standards specified by the IEEE to define the application programming interface (API), along with shell and utilities interfaces for software compatible with variants of the UNIX operating system. Red Hat Storage exports a fully POSIX compatible file system.
- RAID
- Redundant Array of Inexpensive Disks (RAID) is a technology that provides increased storage reliability through redundancy, combining multiple low-cost, less-reliable disk drives components into a logical unit where all drives in the array are interdependent.
- RRDNS
- Round Robin Domain Name Service (RRDNS) is a method to distribute load across application servers. RRDNS is implemented by creating multiple A records with the same name and different IP addresses in the zone file of a DNS server.
- Server
- The machine (virtual or bare metal) which hosts the actual file system in which data will be stored.
- Scale-Up Storage
- Increases the capacity of the storage device, but only in a single dimension. An example might be adding additional disk capacity to a single computer in a trusted storage pool.
- Scale-Out Storage
- Increases the capability of a storage device in multiple dimensions. For example adding a server to a trusted storage pool increases CPU, disk capacity, and throughput for the trusted storage pool.
- Subvolume
- A brick after being processed by at least one translator.
- Translator
- A translator connects to one or more subvolumes, does something with them, and offers a subvolume connection.
- Trusted Storage Pool
- A storage pool is a trusted network of storage servers. When you start the first server, the storage pool consists of that server alone.
- User Space
- Applications running in user space do not directly interact with hardware, instead using the kernel to moderate access. User Space applications are generally more portable than applications in kernel space. glusterFS is a user space application.
- Virtual File System (VFS)
- VFS is a kernel software layer that handles all system calls related to the standard Linux file system. It provides a common interface to several kinds of file systems
- Volfile
- Volfile is a configuration file used by glusterFS process. Volfile will be usually located at
/var/lib/glusterd/vols/VOLNAME. - Volume
- A volume is a logical collection of bricks. Most of the Red Hat Storage management operations happen on the volume.
Table of Contents
- 6. Managing the glusterd Service
- 7. Setting up Trusted Storage Pools
- 8. Setting up Red Hat Storage Volumes
- 8.1. Formatting and Mounting Bricks
- 8.2. Encrypted Disk
- 8.3. Creating Distributed Volumes
- 8.4. Creating Replicated Volumes
- 8.5. Creating Distributed Replicated Volumes
- 8.6. Creating Striped Volumes
- 8.7. Creating Striped Replicated Volumes
- 8.8. Creating Distributed Striped Volumes
- 8.9. Creating Distributed Striped Replicated Volumes
- 8.10. Starting Volumes
- 9. Accessing Data - Setting Up Clients
- 10. Managing Red Hat Storage Volumes
- 11. Managing Geo-replication
- 11.1. Replicated Volumes vs Geo-replication
- 11.2. Preparing to Deploy Geo-replication
- 11.3. Starting Geo-replication
- 11.4. Restoring Data from the Slave
- 11.5. Triggering Geo-replication Failover and Failback
- 11.6. Best Practices
- 11.7. Troubleshooting Geo-replication
- 11.7.1. Locating Log Files
- 11.7.2. Rotating Geo-replication Logs
- 11.7.3. Synchronization is not complete
- 11.7.4. Issues in Data Synchronization
- 11.7.5. Geo-replication status displays Faulty very often
- 11.7.6. Intermediate Master goes to Faulty State
- 11.7.7. Remote gsyncd Not Found
- 11.7.8. Remote gsyncd Not Found
- 12. Managing Directory Quota
- 13. Monitoring your Red Hat Storage Workload
- 13.1. Running Volume Profile Command
- 13.2. Running Volume Top Command
- 13.2.1. Viewing Open File Descriptor Count and Maximum File Descriptor Count
- 13.2.2. Viewing Highest File Read Calls
- 13.2.3. Viewing Highest File Write Calls
- 13.2.4. Viewing Highest Open Calls on Directory
- 13.2.5. Viewing Highest Read Calls on Directory
- 13.2.6. Viewing List of Read Performance
- 13.2.7. Viewing List of Write Performance
- 13.3. Listing Volumes
- 13.4. Displaying Volume Information
- 13.5. Performing Statedump on a Volume
- 13.6. Displaying Volume Status
- 14. Managing Red Hat Storage Volume Life-Cycle Extensions
glusterd service manually.
glusterd.
glusterd command line, logical storage volumes are decoupled from physical hardware, allowing you to grow, shrink and migrate storage volumes without any application downtime. As storage is added, Red Hat Storage volumes are rebalanced across the trusted storage pool making it always available online regardless of changes to the underlying hardware.
Note
- The hostnames used to create the storage pool must be resolvable by DNS.To add a server to the storage pool:
# gluster peer probeserverFor example, to create a trusted storage pool of four servers, add three servers to the storage pool from server1:# gluster peer probe server2 Probe successful # gluster peer probe server3 Probe successful # gluster peer probe server4 Probe successful
- Verify the peer status from all servers using the following command:
# gluster peer status Number of Peers: 3 Hostname: server2 Uuid: 5e987bda-16dd-43c2-835b-08b7d55e94e5 State: Peer in Cluster (Connected) Hostname: server3 Uuid: 1e0ca3aa-9ef7-4f66-8f15-cbc348f29ff7 State: Peer in Cluster (Connected) Hostname: server4 Uuid: 3e0caba-9df7-4f66-8e5d-cbc348f29ff7 State: Peer in Cluster (Connected)
- 8.1. Formatting and Mounting Bricks
- 8.2. Encrypted Disk
- 8.3. Creating Distributed Volumes
- 8.4. Creating Replicated Volumes
- 8.5. Creating Distributed Replicated Volumes
- 8.6. Creating Striped Volumes
- 8.7. Creating Striped Replicated Volumes
- 8.8. Creating Distributed Striped Volumes
- 8.9. Creating Distributed Striped Replicated Volumes
- 8.10. Starting Volumes
Warning
- Volumes of the following types can be created in your storage environment:
- Distributed - Distributed volumes distributes files across bricks in the volume. You can use distributed volumes where the requirement is to scale storage and redundancy is either not important or is provided by other hardware/software layers. For more information, see Section 8.3, “Creating Distributed Volumes” .
- Replicated – Replicated volumes replicates files across bricks in the volume. You can use replicated volumes in environments where high-availability and high-reliability are critical. For more information, see Section 8.4, “Creating Replicated Volumes ”.
- Distributed Replicated - Distributed replicated volumes distributes files across replicated bricks in the volume. You can use distributed replicated volumes in environments where the requirement is to scale storage and high-reliability is critical. Distributed replicated volumes also offer improved read performance in most environments. For more information, see Section 8.5, “Creating Distributed Replicated Volumes ”.
Important
Striped, Striped-Replicated, Distributed-Striped, and Distributed-Striped-Replicated volume types are under technology preview. Technology Preview features are not fully supported under Red Hat subscription level agreements (SLAs), may not be functionally complete, and are not intended for production use. However, these features provide early access to upcoming product innovations, enabling customers to test functionality and provide feedback during the development process. - Striped – Striped volumes stripes data across bricks in the volume. For best results, you should use striped volumes only in high concurrency environments accessing very large files. For more information, see Section 8.6, “Creating Striped Volumes”.
- Striped Replicated – Striped replicated volumes stripes data across replicated bricks in the trusted storage pool. For best results, you should use striped replicated volumes in highly concurrent environments where there is parallel access of very large files and performance is critical. In this release, configuration of this volume type is supported only for Map Reduce workloads. For more information, see Section 8.7, “Creating Striped Replicated Volumes ”.
- Distributed Striped - Distributed striped volumes stripe data across two or more nodes in the trusted storage pool. You should use distributed striped volumes where the requirement is to scale storage and in high concurrency environments where accessing very large files is critical. For more information, see Section 8.8, “Creating Distributed Striped Volumes ”.
- Distributed Striped Replicated – Distributed striped replicated volumes distributes striped data across replicated bricks in the trusted storage pool. For best results, you should use distributed striped replicated volumes in highly concurrent environments where parallel access of very large files and performance is critical. Configuration of this volume type is supported only for Map Reduce workloads. For more information, see Section 8.9, “Creating Distributed Striped Replicated Volumes ”.
Note
# yum groupinstall "Infiniband Support"
# mkfs.xfs -i size=512 DEVICE
- Obtain the UUID (universally unique identifier) of the device using the following command:
# blkidDEVICE - Create a directory to link the brick using the following command:
# mkdir /mountpoint - Add an entry to
/etc/fstabusing the obtained UUID from theblkidcommand:UUID=
uuid/mountpointxfs defaults 1 2 - Mount the brick using the following command:
# mount /mountpoint - Run
df -hcommand to verify that the brick is successfully mounted:# df -h
/dev/vg_bricks/lv_exp116G 1.2G 15G 7%/exp1
Important
# setfattr -x trusted.glusterfs.volume-id brick
# setfattr -x trusted.gfid brick
Warning
- Create a trusted storage pool as described earlier in Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create the distributed volume:
# gluster volume createNEW-VOLNAME[transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, to create a distributed volume with two storage servers using tcp:# gluster volume create test-volume server1:/exp1 server2:/exp2 Creation of test-volume has been successful Please start the volume to access data.
(Optional) You can display the volume information:# gluster volume info Volume Name: test-volume Type: Distribute Status: Created Number of Bricks: 2 Transport-type: tcp Bricks: Brick1: server1:/exp1 Brick2: server2:/exp2
For example, to create a distributed volume with four storage servers over InfiniBand:# gluster volume create test-volume transport rdma server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 Creation of test-volume has been successful Please start the volume to access data.
If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such as auth.allow or auth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
Important
Note
- Create a trusted storage pool as described earlier in Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create the replicated volume:
# gluster volume createNEW-VOLNAME[replicaCOUNT] [transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, to create a replicated volume with two storage servers:# gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2 Creation of test-volume has been successful Please start the volume to access data.
The order in which the bricks are specified determines the mirroring of bricks with each other. For example, firstnbricks, wherenis the replica count. Hence, the first two bricks specified will mirror each other, and the third and fourth bricks will mirror each other.If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such as auth.allow or auth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
Important
Note
- Create a trusted storage pool as described earlier in Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create the distributed replicated volume:
# gluster volume createNEW-VOLNAME[replicaCOUNT] [transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, four node distributed (replicated) volume with a two-way mirror:# gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 Creation of test-volume has been successful Please start the volume to access data.
For example, to create a six node distributed (replicated) volume with a two-way mirror:# gluster volume create test-volume replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 Creation of test-volume has been successful Please start the volume to access data.
The order in which the bricks are specified determines the mirroring of bricks with each other. For example, firstnbricks, wherenis the replica count. Hence, the first two bricks specified will mirror each other, and the third and fourth bricks will mirror each other.If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such as auth.allow or auth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
Important
Note
- Create a trusted storage pool as described earlier in Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create the striped volume:
# gluster volume createNEW-VOLNAME[stripeCOUNT] [transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, to create a striped volume across two storage servers:# gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server2:/exp2 Creation of test-volume has been successful Please start the volume to access data.
If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such as auth.allow or auth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
Important
Note
- Create a trusted storage pool consisting of the storage servers that will comprise the volume.For more information, see Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create a striped replicated volume :
# gluster volume createNEW-VOLNAME[stripeCOUNT] [replicaCOUNT] [transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, to create a striped replicated volume across four storage servers:# gluster volume create test-volume stripe 2 replica 2 transport tcp server1:/exp1 server2:/exp3 server3:/exp2 server4:/exp4 Creation of test-volume has been successful Please start the volume to access data.
To create a striped replicated volume across six storage servers:# gluster volume create test-volume stripe 3 replica 2 transport tcp server1:/exp1 server2:/exp2 server3:/exp3 server4:/exp4 server5:/exp5 server6:/exp6 Creation of test-volume has been successful Please start the volume to access data.
The order in which the bricks are specified determines the mirroring of bricks with each other. For example, firstnbricks, wherenis the replica count. Hence, the first two bricks specified will mirror each other, and the third and fourth bricks will mirror each other.If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such asauth.alloworauth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
Important
Note
- Create a trusted storage pool as described earlier in Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create the distributed striped volume:
# gluster volume createNEW-VOLNAME[stripeCOUNT] [transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, to create a distributed striped volume across four storage servers:# gluster volume create test-volume stripe 2 transport tcp server1:/exp1 server1:/exp2 server2:/exp3 server2:/exp4 Creation of test-volume has been successful Please start the volume to access data.
If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such as auth.allow or auth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
Important
Note
- Create a trusted storage pool as described earlier in Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Create a distributed striped replicated volume using the following command:
# gluster volume createNEW-VOLNAME[stripeCOUNT] [replicaCOUNT] [transport tcp | rdma | tcp,rdma]NEW-BRICK...For example, to create a distributed replicated striped volume across eight storage servers:# gluster volume create test-volume stripe 2 replica 2 transport tcp server1:/exp1 server1:/exp2 server2:/exp3 server2:/exp4 server3:/exp5 server3:/exp6 server4:/exp7 server4:/exp8 Creation of test-volume has been successful Please start the volume to access data.
The order in which the bricks are specified determines the mirroring of bricks with each other. For example, firstnbricks, wherenis the replica count. Hence, the first two bricks specified will mirror each other, and the third and fourth bricks will mirror each other.If the transport type is not specified, tcp is used as the default. You can also set additional options if required, such as auth.allow or auth.reject. For more information, see Section 10.1, “Tuning Volume Options”Note
Make sure you start your volumes before you try to mount them or else client operations after the mount will hang, see Section 8.10, “Starting Volumes ” for details.
- Run the
rhn_registercommand to register the system with Red Hat Network. To complete registration successfully you will need to supply your Red Hat Network username and password.# rhn_registerIn the select operating system release page, select All available updates and follow the on screen prompts and complete the registration of the system.The system is now registered to rhel-x86_64-server-6 channel. Subscribe to Red Hat Storage Native ClientYou must subscribe the system to the Red Hat Storage Native Client channel using either the web interface to Red Hat Network or the command linerhn-channelcommand.- Using the
rhn-channelcommandRun therhn-channelcommand to subscribe the system to Red Hat Storage Native Client channel. The command which need to be run is:# rhn-channel --add --channel=rhel-x86_64-server-rhsclient-6
Using the Web Interface to Red Hat Network.To add a channel subscription to a system from the web interface:- Log on to Red Hat Network (http://rhn.redhat.com).
- Move the mouse cursor over the
Subscriptionslink at the top of the screen, and then click theRegistered Systemslink in the menu that appears. - Select the system to which you are adding Red Hat Storage Native Client channel from the list presented on the screen, by clicking the name of the system.
- Click
Alter Channel Subscriptionsin theSubscribed Channelssection of the screen. - On this screen, expand the node for Additional Services Channels for
Red Hat Enterprise Linux 6 for x86_64for RHEL 6 or Additional Services Channels forRed Hat Enterprise Linux 5 for x86_64for RHEL 5. - Click the
Change Subscriptionsbutton to finalize the changes.After the page refreshes, select theDetailstab to verify if your system is subscribed to the appropriate channels.
Run the following command to verify if the system is registered successfully.# rhn-channel -l rhel-x86_64-server-6 rhel-x86_64-server-rhsclient-6
The system is now registered with Red Hat Network and subscribed to theRed Hat Storage Native Clientchannel. Now install the native client RPMs using the following command:# yum install glusterfs glusterfs-fuse
Important
# modprobe fuse
Note
/etc/hosts entries or a DNS server to resolve server names to IP addresses.
mount -t glusterfs command. Note that you need to separate all options with commas.
backupvolfile-server=server name- name of the backup volfile server to mount the client. If this option is added while mounting fuse client, when the first volfile server fails, then the server specified inbackupvolfile-serveroption is used as volfile server to mount the client.fetch-attempts=number- number of attempts to fetch volume files while mounting a volume. This option is useful when you mount a server with multiple IP addresses or when round-robin DNS is configured for the server name.log-level- logs only specified level or higher severity messages in the log-file.log-file- logs the messages in the specified file.direct-io-mode=[enable|disable]ro- mounts the file system as read only.acl- enables POSIX Access Control List on mount.selinux- enables handling of SELinux xattrs through the mount point.- background-qlen=length - this option enables FUSE to handle
nnumber of requests to be queued before stopping to accept new requests. Default value ofnis 64. - enable-ino32 - this option enables file system to present 32-bit inodes instead of 64- bit inodes.
# mount -t glusterfs -o backupvolfile-server=volfile_server2,fetch-attempts=2,log-level=WARNING,log-file=/var/log/gluster.log server1:/test-volume /mnt/glusterfs
- To mount a volume, use the following command:
# mount -t glusterfs HOSTNAME-OR-IPADDRESS:/VOLNAME MOUNTDIR
For example:# mount -t glusterfs server1:/test-volume /mnt/glusterfs
Note
The server specified in the mount command is only used to fetch the glusterFS configuration volfile describing the volume name. Subsequently, the client will communicate directly with the servers mentioned in the volfile (which might not even include the one used for mount).If you see a usage message like Usage: mount.glusterfs, mount usually requires you to create a directory to be used as the mount point. Runmkdir /mnt/glusterfscommand before you attempt to run the mount command listed above.
- To mount a volume, edit the
/etc/fstabfile and add the following line:HOSTNAME-OR-IPADDRESS:/VOLNAME MOUNTDIR glusterfs defaults,_netdev 0 0
For example:server1:/test-volume /mnt/glusterfs glusterfs defaults,_netdev 0 0
- Use the following command:
# mountFor example, if the Red Hat Storage volume was successfully mounted, the output of the mount command on the client will display an entry like the following:server1:/test-volume on /mnt/glusterfs type fuse.glusterfs(rw,allow_other,default_permissions,max_read=131072
- Use the following command:
# dfThe output ofdfcommand on the client will display the aggregated storage space from all the bricks in a volume similar to this example:# df -h /mnt/glusterfs Filesystem Size Used Avail Use% Mounted on server1:/test-volume 28T 22T 5.4T 82% /mnt/glusterfs
- Change to the directory and list the contents by entering the following:
# cd MOUNTDIR# ls - For example,
# cd /mnt/glusterfs # ls
- To mount a volume, use the following command:
# mount -t nfs -o vers=3 HOSTNAME-OR-IPADDRESS:/VOLNAME MOUNTDIR
For example:# mount -t nfs -o vers=3 server1:/test-volume /mnt/glusterfs
Note
glusterFS NFS server does not support UDP. If a NFS client such as Solaris client, connects by default using UDP, the following message appears:requested NFS version or transport protocol is not supported.To connect using TCP - Add the following option to the mount command:
-o mountproto=tcp
For example:# mount -o mountproto=tcp -t nfs server1:/test-volume /mnt/glusterfs
- Use the following command:
# mount -o proto=tcp,vers=3 nfs://hostname-or-IPaddress:38467/volname mountdir
For example:# mount -o proto=tcp,vers=3 nfs://server1:38467/test-volume /mnt/glusterfs
- To mount a volume, edit the
/etc/fstabfile and add the following line:hostname-or-IPaddress:/volname mountdir nfs defaults,_netdev,vers=3 0 0
For example:server1:/test-volume /mnt/glusterfs nfs defaults,_netdev,vers=3 0 0
Note
glusterFS NFS server does not support UDP. If a NFS client such as Solaris client, connects by default using UDP, the following message appears:requested NFS version or transport protocol is not supported.To connect using TCP - Add the following entry in /etc/fstab file:
hostname-or-IPaddress:/volname mountdir nfs defaults,_netdev,mountproto=tcp 0 0
For example:server1:/test-volume /mnt/glusterfs nfs defaults,_netdev,mountproto=tcp 0 0
/etc/auto.master and /etc/auto.misc and restart the autofs service. After that, whenever a user or process attempts to access the directory it will be mounted in the background.
- Use the mount command by entering the following:
# mount
For example, the output of the mount command on the client will display an entry similar to the following:server1:/test-volume on /mnt/glusterfs type nfs (rw,vers=3,addr=server1)
- Use the df command by entering the following:
# df
For example, the output ofdfcommand on the client will display the aggregated storage space from all the bricks in a volume.# df -h /mnt/glusterfs Filesystem Size Used Avail Use% Mounted on server1:/test-volume 28T 22T 5.4T 82% /mnt/glusterfs
- Change to the directory and list the contents by entering the following:
# cd MOUNTDIR # ls
For example:# cd /mnt/glusterfs # ls
# /etc/init.d/rpcbind start
[2010-05-26 23:33:47] E [rpcsvc.c:2598:rpcsvc_program_register_portmap] rpc-service: Could notregister with portmap [2010-05-26 23:33:47] E [rpcsvc.c:2682:rpcsvc_program_register] rpc-service: portmap registration of program failed [2010-05-26 23:33:47] E [rpcsvc.c:2695:rpcsvc_program_register] rpc-service: Program registration failed: MOUNT3, Num: 100005, Ver: 3, Port: 38465 [2010-05-26 23:33:47] E [nfs.c:125:nfs_init_versions] nfs: Program init failed [2010-05-26 23:33:47] C [nfs.c:531:notify] nfs: Failed to initialize protocols [2010-05-26 23:33:49] E [rpcsvc.c:2614:rpcsvc_program_unregister_portmap] rpc-service: Could not unregister with portmap [2010-05-26 23:33:49] E [rpcsvc.c:2731:rpcsvc_program_unregister] rpc-service: portmap unregistration of program failed [2010-05-26 23:33:49] E [rpcsvc.c:2744:rpcsvc_program_unregister] rpc-service: Program unregistration failed: MOUNT3, Num: 100005, Ver: 3, Port: 38465
- Start the rpcbind service on the NFS server by running the following command:
# /etc/init.d/rpcbind start
After starting rpcbind service, glusterFS NFS server needs to be restarted. - Stop another NFS server running on the same machine.Such an error is also seen when there is another NFS server running on the same machine but it is not the glusterFS NFS server. On Linux systems, this could be the kernel NFS server. Resolution involves stopping the other NFS server or not running the glusterFS NFS server on the machine. Before stopping the kernel NFS server, ensure that no critical service depends on access to that NFS server's exports.On Linux, kernel NFS servers can be stopped by using either of the following commands depending on the distribution in use:
# /etc/init.d/nfs-kernel-server stop # /etc/init.d/nfs stop
- Restart glusterFS NFS server.
[2010-05-26 23:40:49] E [rpc-socket.c:126:rpcsvc_socket_listen] rpc-socket: binding socket failed:Address already in use [2010-05-26 23:40:49] E [rpc-socket.c:129:rpcsvc_socket_listen] rpc-socket: Port is already in use [2010-05-26 23:40:49] E [rpcsvc.c:2636:rpcsvc_stage_program_register] rpc-service: could not create listening connection [2010-05-26 23:40:49] E [rpcsvc.c:2675:rpcsvc_program_register] rpc-service: stage registration of program failed [2010-05-26 23:40:49] E [rpcsvc.c:2695:rpcsvc_program_register] rpc-service: Program registration failed: MOUNT3, Num: 100005, Ver: 3, Port: 38465 [2010-05-26 23:40:49] E [nfs.c:125:nfs_init_versions] nfs: Program init failed [2010-05-26 23:40:49] C [nfs.c:531:notify] nfs: Failed to initialize protocols
rpcbind service on the NFS client.
rpcbind service is not running on the NFS client. The resolution for this is to start rpcbind service by running the following command:
# /etc/init.d/rpcbind start
mount: mount to NFS server '10.1.10.11' failed: timed out (retrying).
- Disable name lookup requests from NFS server to a DNS server.The NFS server attempts to authenticate NFS clients by performing a reverse DNS lookup to match hostnames in the volume file with the client IP addresses. There can be a situation where the NFS server either is not able to connect to the DNS server or the DNS server is taking too long to respond to DNS request. These delays can result in delayed replies from the NFS server to the NFS client resulting in the timeout error seen above.NFS server provides a work-around that disables DNS requests, instead relying only on the client IP addresses for authentication. The following option can be added for successful mounting in such situations:
option rpc-auth.addr.namelookup off
Note
Remember that disabling the NFS server forces authentication of clients to use only IP addresses and if the authentication rules in the volume file use hostnames, those authentication rules will fail and disallow mounting for those clients.or - NFS version used by the NFS client is other than version 3 by default.glusterFS NFS server supports version 3 of NFS protocol by default. In recent Linux kernels, the default NFS version has been changed from 3 to 4. It is possible that the client machine is unable to connect to the glusterFS NFS server because it is using version 4 messages which are not understood by glusterFS NFS server. The timeout can be resolved by forcing the NFS client to use version 3. The vers option to mount command is used for this purpose:
# mountnfsserver:export-o vers=3mount-point
NFS.enable-ino32 <on | off>
- built 32-bit and run on 32-bit machines such that they do not support large files by default
- built 32-bit on 64-bit systems
-D_FILE_OFFSET_BITS=64
Note
# yum install samba-winbind# yum install samba-client# yum install krb5-workstation
- Mount a Red Hat Storage volume. For more information on mounting volumes, see Section 9.1.2, “Mounting Red Hat Storage Volumes”.
- Setup the Samba configuration to export the mount point of the Red Hat Storage volume.For example, if a Red Hat Storage volume is mounted on
/mnt/gluster, you must edit the/etc/samba/smb.conffile to enable sharing of Red Hat Storage volumes over SMB. Open the/etc/samba/smb.conffile in a text editor and add the following lines for a simple configuration:[glustertest] comment = For testing a Red Hat Storage volume exported over SMB path = /mnt/gluster read only = no guest ok = yes
Save the changes and start or restart the SMB (Server Message Block) service using your system's init scripts (/etc/init.d/smb [re]start). - Set the SMB password using the following command:
# smbpasswd -a
usernameYou will be prompted for a password, provide the SMB password. This password will be used during the SMB mount.
Note
gluster volume start VOLNAME command, the volume is automatically exported through Samba on all Red Hat Storage servers running Samba. The Red Hat Storage volume is mounted using the Red Hat Storage Native Client at /mnt/samba/VOLNAME. It is exported as a Samba share named as gluster-VOLNAME.
S30samba-start.sh located at /var/lib/glusterd/hooks/1/start/post to K30samba-start.sh.
- Mount the Samba exported SMB share using the following command:
# mount -t cifs
Samba_Server_IP_Address:/Share_Name Mount_PointFor example, if a Red Hat Storage volume is exported through SMB using the/etc/samba/smb.conffile with the following entry:[glustertest] comment = For testing a Red Hat Storage volume exported over SMB path = /mnt/gluster read only = no guest ok = yes
Perform the SMB mount of the Red Hat Storage volume using the following command:# mount -t cifs 192.168.1.60:/glustertest /mnt/smb
- Using Windows Explorer, choose Tools > Map Network Drive… from the menu. The Map Network Drive window appears.
- Choose the drive letter using the Drive drop-down list.
- In the Folder text box, enter the path of the server and the shared resource in the following format:
\\SERVER_NAME\VOLNAME. - Click Finish.
- Click , and then click .
- In the box, enter
cmd. - Enter
net use z: \\, whereSERVER_NAME\VOLNAMEz:is the drive letter you want to assign to the shared volume.For example,net use y: \\server1\test-volume
- To automatically mount a volume, edit the
/etc/fstabfile and add the following line:hostname-or-IPaddress:/Share_Name mountdir smb credentials=filename,_netdev 0 0
For example,server1:/glustertest /mnt/glusterfs smb credentials=/etc/samba/passwd,_netdev 0 0
You must specify the filename and its path that contains username and/or password in thecredentialsoption in/etc/fstabfile. Refer to themount.cifsman page for more information.
- Using Windows Explorer, choose Tools > Map Network Drive… from the menu. The Map Network Drive window appears.
- Choose the drive letter using the Drive drop-down list.
- In the Folder text box, enter the path of the server and the shared resource in the following format:
\\SERVER_NAME\VOLNAME. - Click the Reconnect at logon checkbox.
- Click Finish.
- Use the
smsbtatuscommand by entering the following:# smbstatus -S
For example, the output of the status command on the client will display an entry similar to the following:Service pid machine Connected at ------------------------------------------------------------------- glustertest 11967 __ffff_192.168.1.60 Mon Aug 6 02:23:25 2012
- You can confirm that Red Hat Storage directories are mounting successfully by navigating to the directory using Windows Explorer.
Note
- Create a replicated volume.Ensure that the bricks are in different machines.
- Update the
META=allto the newly created volume name on all Red Hat Storage servers which require IP failover in the hook scripts available at/var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.shand/var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh. - Start the volume.The
S29CTDBsetup.shscript runs on all Red Hat Storage servers and adds the following lines to the[global]section of your Samba configurationclustering = yes idmap backend = tdb2
The script stops Samba server, modifies Samba configuration, adds an entry in/etc/fstab/for the mount, and mounts the volume at/gluster/lock. It also enables automatic start of CTDB service on a reboot.Note
When you stop a volume,S29CTDB-teardown.shscript runs on all Red Hat Storage servers and removes the following lines from[global]section of your Samba configurationclustering = yes idmap backend = tdb2
It also removes an entry in/etc/fstab/for the mount and unmount the volume at/gluster/lock. - Create
/gluster/lock/ctdbfile and add the following entries:CTDB_RECOVERY_LOCK=/gluster/lock/lockfile #SMB only CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses CTDB_MANAGES_SAMBA=yes #SMB only CTDB_NODES=/etc/ctdb/nodes
- Create
/gluster/lock/nodesfile and list the IPs of Red Hat Storage servers which require IP failover.192.168.1.60 192.168.1.61 192.168.1.62 192.168.1.63
- Create
/etc/ctdb/public_addressesfile on all Red Hat Storage servers which require IP failover and list the Virtual IPs that CTDB should create. Replaceeth0with the interface available on that node for CTDB to use.192.168.1.20/24 eth0 192.168.1.21/24 eth0
- Run the following commands on all Red Hat Storage servers which require IP failover to create symbolic links:
# ln -s /gluster/lock/ctdb /etc/sysconfig/ctdb# ln -s /gluster/lock/nodes /etc/ctdb/nodes
Note
- Start CTDB service using the following command:
# service ctdb start - When CTDB starts it will start Samba automatically. To avoid Samba from starting automatically on reboot, run the following command:
# chkconfig smb off - Verify that CTDB is running using the following command:
# ctdb status # ctdb ip # ctdb ping -n all
- Mount a Red Hat Storage volume using any one of the VIPs.When you shutdown the Red Hat Storage Server serving the VIP (run
ctdb ipcommand to find the physical server serving the VIP), there will be a pause for few seconds and then I/O will resume.
- Per user
- Per group
- Via the effective right mask
- For users not in the user group for the file
# setfacl –m entry type file
r (read), w (write), and x (execute). You must specify the ACL entry in the following format and can specify multiple entry types separated by commas.
| ACL Entry | Description |
|---|---|
| u:uid:<permission> | Sets the access ACLs for a user. You can specify user name or UID |
| g:gid:<permission> | Sets the access ACLs for a group. You can specify group name or GID. |
| m:<permission> | Sets the effective rights mask. The mask is the combination of all access permissions of the owning group and all of the user and group entries. |
| o:<permission> | Sets the access ACLs for users other than the ones in the group for the file. |
# setfacl -m u:antony:rw /mnt/gluster/data/testfile
# setfacl –m –-set entry type directory
/data directory to read for users not in the user group:
# setfacl –m --set o::r /mnt/gluster/data
Note
- A subdirectory inherits the default ACLs of the parent directory both as its default ACLs and as an access ACLs.
- A file inherits the default ACLs as its access ACLs.
- View the existing access ACLs of a file using the following command:
# getfaclpath/filenameFor example, to view the existing POSIX ACLs for sample.jpg# getfacl /mnt/gluster/data/test/sample.jpg # owner: antony # group: antony user::rw- group::rw- other::r--
- View the default ACLs of a directory using the following command:
# getfacldirectory nameFor example, to view the existing ACLs for /data/doc# getfacl /mnt/gluster/data/doc # owner: antony # group: antony user::rw- user:john:r-- group::r-- mask::r-- other::r-- default:user::rwx default:user:antony:rwx default:group::r-x default:mask::rwx default:other::r-x
# setfacl -x ACL entry type file# setfacl -x u:antony /mnt/gluster/data/test-file--with-acl-support option, so no special flags are required when accessing or mounting a Samba share.
- Tune volume options using the following command:
# gluster volume setVOLNAME OPTION PARAMETERFor example, to specify the performance cache size for test-volume:# gluster volume set test-volume performance.cache-size 256MB Set volume successful
The following table lists the Volume options along with its description and default value:Note
The default value listed in the table is subject to change and may not be the same for all versions.Option Value Description Allowed Values Default Value auth.allow IP addresses or hostnames of the clients which should be allowed to access the volume. Valid hostnames or IP addresses which includes wild card patterns including *, such as 192.168.1.*. A list of comma separated addresses is accepted, but a single hostname must not exceed 256 characters. * (allow all) auth.reject IP addresses or hostnames of the clients which should be denied access to the volume. Valid hostnames or IP addresses which includes wild card patterns including *, such as 192.168.1.*. A list of comma separated addresses is accepted, but a single hostname must not exceed 256 characters. none (reject none) cluster.min-free-disk Specifies the percentage of disk space that must be kept free. Might be useful for non-uniform bricks. Percentage of required minimum free disk space 10% cluster.self-heal-daemon Allows you to turn-off proactive self-heal on replicated volumes. on | off on cluster.server-quorum-type If set to server, enables the specified volume to participate in quorum. For more information on configuring quorum, see Section 10.9, “Configuring Server-Side Quorum”none | server none cluster.server-quorum-ratio Sets the quorum percentage for the trusted storage pool. 0 - 100 >50% diagnostics.brick-log-level Changes the log-level of the bricks. info | debug | warning | error | critical | none | trace info diagnostics.client-log-level Changes the log-level of the clients. info | debug | warning | error | critical | none | trace info features.read-only Enables you to mount the entire volume as read-only for all the clients accessing it. on | off off geo-replication.indexing Use this option to automatically sync the changes in the file system from Master to Slave. on | off off network.ping-timeout The time duration for which the client waits to check if the server is responsive. When a ping timeout occurs, network disconnects between the client and server. All resources held by server on behalf of the client gets cleaned up. When network connects, all resources needs to be re-acquired before the client can resume its operations on the server. Additionally, the locks are acquired and the lock tables updated. This reconnect is a very expensive operation and should be avoided.42 seconds 42 seconds nfs.export-dir By default, all volumes of NFS are exported as individual exports. Now, this option allows you to export only the specified subdirectory or subdirectories in the volume. This option can also be used in conjunction with nfs.export-volumesoption to restrict exports only to the subdirectories specified through this option.An absolute path or a comma separated list of absolute paths of subdirectories of the volumes. None nfs.export-dirs By default, all subvolumes of NFS are exported as individual exports. Enabling this option allows any directory on a volumes to be exported separately. on | off on nfs.export-volumes Enables or disables exporting entire volumes. If used in conjunction with nfs.export-dir, can allow setting up only subdirectories as exports.on | off on nfs.rpc-auth-allow<IP- Addresses> Allows a comma separated list of addresses to connect to the server. By default, all clients are allowed. IP address accept all nfs.rpc-auth-reject <IP- Addresses> Rejects a comma separated list of addresses from connecting to the server. By default, all connections are allowed. IP address reject none nfs.ports-insecure Allows client connections from unprivileged ports. By default only privileged ports are allowed. This is a global setting in case insecure ports are to be enabled for all exports using a single option. on | off off nfs.addr-namelookup Turn-off name lookup for incoming client connections using this option. In some setups, the name server can take too long to reply to DNS queries resulting in timeouts of mount requests. Use this option to turn off name lookups during address authentication. Note, turning this off will prevent you from using hostnames in nfs.rpc-auth-* filters. on | off on nfs.port <port- number> Use this option on systems that need glusterFS NFS to be associated with a non-default port number. 1025-65535 38465- 38467 nfs.disable Disables NFS export of individual volumes. on | off off performance.io-thread-count The number of threads in IO threads translator. 0 - 65 16 performance.cache-max-file-size Sets the maximum file size cached by the io-cache translator. Can use the normal size descriptors of KB, MB, GB,TB or PB (for example, 6GB). Maximum size unit 64. size in bytes 2 ^ 64-1 bytes performance.cache-min-file-size Sets the minimum file size cached by the io-cache translator. Values same as maxabove.size in bytes 0 B performance.cache-refresh-timeout The cached data for a file will be retained till cache-refresh-timeoutseconds, after which data re-validation is performed.0 - 61 seconds 1 second performance.cache-size Size of the read cache. size in bytes 32 MB server.allow-insecure Allows client connections from unprivileged ports. By default, only privileged ports are allowed. This is a global setting in case insecure ports are to be enabled for all exports using a single option. on | off off server.root-squash Prevents root users from having root privileges and assigns them the privileges of nfsnobody. This effectively squashes the power of the root user to the user nfsnobody, preventing unauthorized modification of files on the Red Hat Storage Servers. on | off off Important
Red Hat recommends you to setserver.allow-insecureoption toonif there are too many bricks in each volume or if there are too many services which have already utilized all the privileged ports in the system. Turning this optiononallows ports to accept/reject messages from insecure ports. So, use this option only if your deployment requires it.You can view the changed volume settings using thegluster volume infocommand.VOLNAME
Note
- From any server in the trusted storage pool, probe the server to which you want to add the new brick using the following command:
# gluster peer probeHOSTNAMEFor example:# gluster peer probe server4 Probe successful
- Add the brick using the following command:
# gluster volume add-brickVOLNAME NEW-BRICKFor example:# gluster volume add-brick test-volume server4:/exp4 Add Brick successful
- Check the volume information using the following command:
# gluster volume infoThe command displays information similar to the following:Volume Name: test-volume Type: Distribute Status: Started Number of Bricks: 4 Bricks: Brick1: server1:/exp1 Brick2: server2:/exp2 Brick3: server3:/exp3 Brick4: server4:/exp4
- Rebalance the volume to ensure that files are distributed to the new brick.You can use the rebalance command as described in Section 10.5, “Rebalancing Volumes”.
Note
force or without any option. With start option, the data gets migrated to the other bricks and only the configuration information is removed - you can continue to access the data directly from the brick.
- Remove the brick using the following command:
# gluster volume remove-brickVOLNAMEBRICKstartFor example, to remove server2:/exp2:# gluster volume remove-brick test-volume server2:/exp2 start Remove Brick start successful
- (Optional) View the status of the remove brick operation using the following command:
# gluster volume remove-brickVOLNAMEBRICKstatusFor example, to view the status of remove brick operation on server2:/exp2 brick:# gluster volume remove-brick test-volume server2:/exp2 status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 16 16777216 52 0 in progress 192.168.1.1 13 16723211 47 0 in progress - When the data migration is complete and when the
gluster volume remove-brickVOLNAMEBRICKstatuscommand displays the status as Completed, run the following command:# gluster volume remove-brickVOLNAME BRICKcommitFor example,# gluster volume remove-brick test-volume server2:/exp2 commit - Enter
yto confirm the operation. The command displays the following message indicating that the remove brick operation is successfully started:Remove Brick successful
- Check the volume information using the following command:
# gluster volume infoThe command displays information similar to the following:# gluster volume info Volume Name: test-volume Type: Distribute Status: Started Number of Bricks: 3 Bricks: Brick1: server1:/exp1 Brick3: server3:/exp3 Brick4: server4:/exp4
Important
stop command. The files which are already migrated during remove-brick operation, will not be migrated back to the same brick.
- Stop the remove brick operation using the following command:
# gluster volume remove-brickVOLNAME BRICKstopFor example:# gluster volume rebalance test-volume stop Node Rebalanced-files size scanned status --------- ---------------- ---- ------- ----------- 617c923e-6450-4065-8e33-865e28d9428f 59 590 244 stopped Stopped rebalance process on volume test-volume
Note
replace-brick operation, review the known issues related to replace-brick operation in the Red Hat Storage 2.0 Update 4 Release Notes.
- Make sure the new brick, server5 in this example, is successfully added to the trusted storage pool.For more information, see Section 7.1, “Adding Servers to Trusted Storage Pool”.
- Migrate the data from one brick to another using the following command:
# gluster volume replace-brickVOLNAMEBRICKNEW-BRICKstartFor example, to migrate the data in server3:/exp3 to server5:/exp5 in test-volume:# gluster volume replace-brick test-volume server3:/exp3 server5:exp5 start Replace brick start operation successful
Note
You need to have the FUSE package installed on the server on which you are running the replace-brick command for the command to work. - To pause the migration operation, if needed, use the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKpauseFor example, to pause the data migration from server3:/exp3 to server5:/exp5 in test-volume:# gluster volume replace-brick test-volume server3:/exp3 server5:exp5 pause Replace brick pause operation successful
- To abort the migration operation, if needed, use the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKabortFor example, to abort the data migration from server3:/exp3 to server5:/exp5 in test-volume:# gluster volume replace-brick test-volume server3:/exp3 server5:exp5 abort Replace brick abort operation successful
- Check the status of the migration operation using the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKstatusFor example, to check the data migration status from server3:/exp3 to server5:/exp5 in test-volume:# gluster volume replace-brick test-volume server3:/exp3 server5:/exp5 status Current File = /usr/src/linux-headers-2.6.31-14/block/Makefile Number of files migrated = 10567 Migration complete
The status command shows the current file being migrated along with the current total number of files migrated. After completion of migration, it displays Migration complete. - Commit the migration of data from one brick to another using the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKcommitFor example, to commit the data migration from server3:/exp3 to server5:/exp5 in test-volume:# gluster volume replace-brick test-volume server3:/exp3 server5:/exp5 commit replace-brick commit successful
- Verify the migration of brick by viewing the volume info using the following command:
# gluster volume infoVOLNAMEFor example, to check the volume information of new brick server5:/exp5 in test-volume:# gluster volume info test-volume Volume Name: testvolume Type: Replicate Status: Started Number of Bricks: 4 Transport-type: tcp Bricks: Brick1: server1:/exp1 Brick2: server2:/exp2 Brick3: server4:/exp4 Brick4: server5:/exp5 The new volume details are displayed.
The new volume details are displayed.In the above example, previously, there were bricks; 1,2,3, and 4 and now brick 3 is replaced by brick 5.
Important
- Start the rebalance operation on any one of the servers using the following command:
# gluster volume rebalanceVOLNAMEstartFor example:# gluster volume rebalance test-volume start Starting rebalancing on volume test-volume has been successful
- Start the migration operation forcefully on any one of the servers using the following command:
# gluster volume rebalanceVOLNAMEstart forceFor example:# gluster volume rebalance test-volume start force Starting rebalancing on volume test-volume has been successful
- Check the status of the rebalance operation, using the following command:
# gluster volume rebalanceVOLNAMEstatusFor example:# gluster volume rebalance test-volume status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 112 14567 150 0 in progress 10.16.156.72 140 2134 201 2 in progressThe time to complete the rebalance operation depends on the number of files on the volume along with the corresponding file sizes. Continue checking the rebalance status, verifying that the number of files rebalanced or total files scanned keeps increasing.For example, running the status command again might display a result similar to the following:# gluster volume rebalance test-volume status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 112 14567 150 0 in progress 10.16.156.72 140 2134 201 2 in progressThe rebalance status displays the following when the rebalance is complete:# gluster volume rebalance test-volume status Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 112 15674 170 0 completed 10.16.156.72 140 3423 321 2 completed
- Stop the rebalance operation using the following command:
# gluster volume rebalanceVOLNAMEstopFor example:# gluster volume rebalance test-volume stop Node Rebalanced-files size scanned failures status --------- ----------- ----------- ----------- ----------- ------------ localhost 102 12134 130 0 stopped 10.16.156.72 110 2123 121 2 stopped Stopped rebalance process on volume test-volume
- Stop the volume using the following command:
# gluster volume stopVOLNAMEFor example, to stop test-volume:# gluster volume stop test-volume Stopping volume will make its data inaccessible. Do you want to continue? (y/n)
- Enter
yto confirm the operation. The output of the command displays the following:Stopping volume test-volume has been successful
- Delete the volume using the following command:
# gluster volume deleteVOLNAMEFor example, to delete test-volume:# gluster volume delete test-volume Deleting volume will erase all information about the volume. Do you want to continue? (y/n)
- Enter
yto confirm the operation. The command displays the following:Deleting volume test-volume has been successful
- Trigger self-heal only on the files which require healing:
# gluster volume healVOLNAMEFor example, to trigger self-heal on files which require healing of test-volume:# gluster volume heal test-volume Heal operation on volume test-volume has been successful
- Trigger self-heal on all the files of a volume:
# gluster volume healVOLNAMEfullFor example, to trigger self-heal on all the files of of test-volume:# gluster volume heal test-volume full Heal operation on volume test-volume has been successful
- View the list of files that need healing:
# gluster volume healVOLNAMEinfoFor example, to view the list of files on test-volume that need healing:# gluster volume heal test-volume info Brick server1:/gfs/test-volume_0 Number of entries: 0 Brick server2:/gfs/test-volume_1 Number of entries: 101 /95.txt /32.txt /66.txt /35.txt /18.txt /26.txt /47.txt /55.txt /85.txt ...
- View the list of files that are self-healed:
# gluster volume healVOLNAMEinfo healedFor example, to view the list of files on test-volume that are self-healed:# gluster volume heal test-volume info healed Heal information on volume test-volume has been successful Brick server1:/gfs/test-volume_0 Number of entries: 0 Brick server2:/gfs/test-volume_1 Number of entries: 51 at path on brick ---------------------------------- 2012-06-13 04:02:05 /dir/file.50 2012-06-13 04:02:05 /dir/file.49 2012-06-13 04:02:05 /dir/file.48 2012-06-13 04:02:05 /dir/file.47 2012-06-13 04:02:05 /dir/file.46 2012-06-13 04:02:05 /dir/file.45 2012-06-13 04:02:05 /dir/file.44 ...
- View the list of files of a particular volume on which the self-heal failed:
# gluster volume healVOLNAMEinfo heal-failedFor example, to view the list of files of test-volume that are not self-healed:# gluster volume heal test-volume info heal-failed Brick server1:/gfs/test-volume_0 Number of entries: 0 Brick server2:/gfs/test-volume_3 Number of entries: 72 at path on brick ---------------------------------- 2012-06-13 04:02:05 /dir/file.90 2012-06-13 04:02:05 /dir/file.95 2012-06-13 04:02:05 /dir/file.71 2012-06-13 04:02:05 /dir/file.67 2012-06-13 04:02:05 /dir/file.86 2012-06-13 04:02:05 /dir/file.55 2012-06-13 04:02:05 /dir/file.44 ... - View the list of files of a particular volume which are in split-brain state:
# gluster volume healVOLNAMEinfo split-brainFor example, to view the list of files of test-volume which are in split-brain state:# gluster volume heal test-volume info split-brain Brick server1:/gfs/test-volume_2 Number of entries: 12 at path on brick ---------------------------------- 2012-06-13 04:02:05 /dir/file.83 2012-06-13 04:02:05 /dir/file.28 2012-06-13 04:02:05 /dir/file.69 Brick server2:/gfs/test-volume_2 Number of entries: 12 at path on brick ---------------------------------- 2012-06-13 04:02:05 /dir/file.83 2012-06-13 04:02:05 /dir/file.28 2012-06-13 04:02:05 /dir/file.69 ...
cluster.server-quorum-type volume option. For more information on this volume setting option, see Section 10.1, “Tuning Volume Options”.
# gluster volume set all cluster.server-quorum-ratio percentage%
# gluster volume set all cluster.server-quorum-ratio 51%
- 11.1. Replicated Volumes vs Geo-replication
- 11.2. Preparing to Deploy Geo-replication
- 11.3. Starting Geo-replication
- 11.4. Restoring Data from the Slave
- 11.5. Triggering Geo-replication Failover and Failback
- 11.6. Best Practices
- 11.7. Troubleshooting Geo-replication
- 11.7.1. Locating Log Files
- 11.7.2. Rotating Geo-replication Logs
- 11.7.3. Synchronization is not complete
- 11.7.4. Issues in Data Synchronization
- 11.7.5. Geo-replication status displays Faulty very often
- 11.7.6. Intermediate Master goes to Faulty State
- 11.7.7. Remote gsyncd Not Found
- 11.7.8. Remote gsyncd Not Found
- Master – a Red Hat Storage volume
- Slave – a slave which can be of the following types:
- A local directory which can be represented as file URL like
file:///path/to/dir. You can use shortened form, for example,/path/to/dir. - A Red Hat Storage Volume - Slave volume can be either a local volume like
gluster://localhost:volname(shortened form -:volname) or a volume served by different host likegluster://host:volname(shortened form -host:volname).
Note
Both of the above types can be accessed remotely using an SSH tunnel. To use SSH, add an SSH prefix to either a file URL or glusterFS type URL. For example,ssh://root@remote-host:/path/to/dir(shortened form -root@remote-host:/path/to/dir) orssh://root@remote-host:gluster://localhost:volname(shortened from -root@remote-host::volname).
| Replicated Volumes | Geo-replication |
|---|---|
| Mirrors data across bricks within one trusted storage pool | Mirrors data across geographically distributed trusted storage pools |
| Provides high-availability | Ensures backing up of data for disaster recovery |
| Synchronous replication (each and every file operation is sent across all the bricks) | Asynchronous replication (checks for the changes in files periodically and syncs them on detecting differences) |
- Geo-replication over LAN
- Geo-replication over WAN
- Geo-replication over the Internet
- Multi-site cascading Geo-replication




- Verify that your environment matches the minimum system requirement. For more information, see Section 11.2.3, “Pre-requisite”.
- Determine the appropriate deployment scenario. For more information, see Section 11.2.1, “Exploring Geo-replication Deployment Scenarios”.
- Start Geo-replication on master and slave systems, as required. For more information, see Section 11.3, “Starting Geo-replication”.
- On bricks of a geo-replication master volume, all the servers' time must be uniform. You are recommended to set up NTP (Network Time Protocol) service to keep the bricks sync in time and avoid out-of-time sync effect.For example: In a Replicated volume where brick1 of the master is at 12.20 hrs and brick 2 of the master is at 12.10 hrs with 10 minutes time lag, all the changes in brick2 between this period may go unnoticed during synchronization of files with Slave.For more information on setting up NTP, see https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Migration_Planning_Guide/ch04s07.html.
- Create a new user account on slave. This can be an alias user of an existing user (another user with same user ID). You can also use an alias of privileged user. For example:
user@slavehost. - On the node where geo-replication sessions are to be set up, run the following commands:
# ssh-keygen -f /var/lib/glusterd/geo-replication/secret.pemPress Enter twice to avoid passphrase. - Run the following command on master for all the slave hosts to copy
ssh-id:# ssh-copy-id -i /var/lib/glusterd/geo-replication/secret.pem.pubuser@slavehost - Change the shell of the user created in Step 1 to
/usr/libexec/glusterfs/gsyncdby running the following command:# usermod -s /usr/libexec/glusterfs/gsyncdUSERNAME
- Choose an user account on slave. This can be a new account or an existing one; using root account is possible. For example:
user@slavehost - On the node where geo-replication sessions are to be set up, run the following commands:
# ssh-keygen -f /var/lib/glusterd/geo-replication/secret.pem.tmpPress Enter twice to avoid passphrase.# cat /var/lib/glusterd/geo-replication/secret.pem.tmp > /var/lib/glusterd/geo-replication/secret.pem# echo -n 'command="/usr/libexec/glusterfs/gsyncd" ' > /var/lib/glusterd/geo-replication/secret.pem.pub# cat /var/lib/glusterd/geo-replication/secret.pem.tmp.pub >> /var/lib/glusterd/geo-replication/secret.pem.pub# rm /var/lib/glusterd/geo-replication/secret.pem.tmp# rm /var/lib/glusterd/geo-replication/secret.pem.tmp.pub - Run the following command on master for all the slave hosts:
# ssh-copy-id -i /var/lib/glusterd/geo-replication/secret.pem.pubuser@slavehost
- Using unprivileged Red Hat Storage Over SSH
- Using IP based access control
- The process of secure reconfiguration affects only the glusterFS instance on slave. The changes are transparent to master with the exception that you may have to change the SSH target to an unprivileged account on slave.
- The following are the some exceptions where this might not work:
- Geo-replication URLs which specify the slave resource when configuring master will include the following special characters: space, *, ?, [;
- Slave must have a running instance of glusterd, even if there is no Red Hat Storage volume among the mounted slave resources (that is, file tree slaves are used exclusively) .
mountbroker, an internal service of glusterd which manages the mounts for unprivileged slave accounts. You must perform additional steps to configure glusterd with the appropriate mountbroker's access control directives. The following example demonstrates this process:
- Create a new group. For example,
geogroup. - Create a unprivileged account. For example,
geoaccount. Make it a member ofgeogroup. - Create a new directory owned by root and with permissions 0711. Ensure that the location where this directory is created is writable only by root but geoaccount is able to access it. For example, create a
mountbroker-rootdirectory at/var/mountbroker-root. - Add the following options to the glusterd volfile, assuming the name of the slave Red Hat Storage volume as
slavevol:option mountbroker-root /var/mountbroker-rootoption mountbroker-geo-replication.geoaccount slavevol option geo-replication-log-group geogroupIf you are unable to locate the glusterd volfile at/var/lib/glusterfs/glusterd.vol, you can create a volfile containing both the default configuration and the above options and place it at/var/lib/glusterfs/.A sample glusterd volfile along with default options:volume management type mgmt/glusterd option working-directory /var/lib/glusterd option transport-type socket,rdma option transport.socket.keepalive-time 10 option transport.socket.keepalive-interval 2 option transport.socket.read-fail-log off option mountbroker-root /var/mountbroker-root option mountbroker-geo-replication.geoaccount slavevol option geo-replication-log-group geogroup end-volumeIf you host multiple slave volumes on Slave, you can repeat step 2. for each of them and add the following options to thevolfile:option mountbroker-geo-replication.geoaccount2 slavevol2 option mountbroker-geo-replication.geoaccount3 slavevol3
- Setup Master to access Slave as
geoaccount@Slave.You can add multiple slave volumes within the same account (geoaccount) by providing comma-separated list (without spaces) as the argument ofmountbroker-geo-replication.geogroup. You can also have multiple options of the formmountbroker-geo-replication.*. It is recommended to use one service account per Master machine. For example, if there are multiple slave volumes on Slave for the master machines Master1, Master2, and Master3, then create a dedicated service user on Slave for them by repeating Step 2. for each (like geogroup1, geogroup2, and geogroup3), and then add the following corresponding options to the volfile:option mountbroker-geo-replication.geoaccount1 slavevol11,slavevol12,slavevol13option mountbroker-geo-replication.geoaccount2 slavevol21,slavevol22option mountbroker-geo-replication.geoaccount3 slavevol31Now set up Master1 to ssh to geoaccount1@Slave, etc.You must restartglusterdafter making changes in the configuration to effect the updates.
- Set a general restriction for accessibility of file tree resources:
# gluster volume geo-replication '/*' config allow-network ::1,127.0.0.1This will refuse all requests for spawning slave agents except for requests initiated locally. - If you want the to lease file tree at
/data/slave-treeto Master, enter the following command:# gluster volume geo-replication/data/slave-treeconfig allow-networkMasterIPMasterIPis the IP address of Master. The slave agent spawn request from master will be accepted if it is executed at/data/slave-tree.
# gluster volume geo-replication '*' config allow-network ::1,127.0.0.1
- Start geo-replication between the hosts using the following command:
# gluster volume geo-replicationMASTER SLAVEstartFor example:# gluster volume geo-replication Volume1 example.com:/data/remote_dir start Starting geo-replication session between Volume1 example.com:/data/remote_dir has been successful
Note
You must configure the service before starting Geo-replication. For more information, see Section 11.3.4, “Configuring Geo-replication”.
Warning
status command to verify the status of Geo-replication in your environment.
- Verify the status by issuing the following command on host:
# gluster volume geo-replicationMASTER SLAVEstatusFor example:# gluster volume geo-replication Volume1 example.com:/data/remote_dir status# gluster volume geo-replication Volume1 example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 root@example.com:/data/remote_dir Starting....
- Display information of all geo-replication sessions using the following command:
# gluster volume geo-replication Volume1 example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 root@example.com:/data/remote_dir Starting....
- Display information of a particular master slave session using the following command:
# gluster volume geo-replicationMASTER SLAVEstatusFor example, to display information of Volume1 and example.com:/data/remote_dir# gluster volume geo-replication Volume1 example.com:/data/remote_dir statusThe status of the geo-replication between Volume1 and example.com:/data/remote_dir is displayed. - Display information of all geo-replication sessions belonging to a master
# gluster volume geo-replication MASTER statusFor example, to display information of Volume1# gluster volume geo-replication Volume1 example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 ssh://example.com:gluster://127.0.0.1:remove_volume OK Volume1 ssh://example.com:file:///data/remote_dir OK
The status of a session could be one of the following four: - Starting: This is the initial phase of the Geo-replication session; it remains in this state for a minute, to make sure no abnormalities are present.
- OK: The geo-replication session is in a stable state.
- Faulty: The geo-replication session has witnessed some abnormality and the situation has to be investigated further. For further information, see Section 11.7, “Troubleshooting Geo-replication ” section.
- Corrupt: The monitor thread which is monitoring the geo-replication session has died. This situation should not occur normally, if it persists contact Red Hat Support www.redhat.com/support/.
- Use the following command at the glusterFS command line:
# gluster volume geo-replicationMASTER SLAVEconfig [options]For more information about the options, see Chapter 20, Command Reference .For example:To view list of all option/value pair, use the following command:# gluster volume geo-replication Volume1 example.com:/data/remote_dir configTo delete a setting for a geo-replication config option, prefix the option with ! (exclamation) mark. For example, to reset the log-level to default value:# gluster volume geo-replication Volume1 example.com:/data/remote_dir config '!log-level'
- Set checkpoint to a geo-replication session
# gluster volume geo-replicationMASTER SLAVEconfig checkpoint [LABEL | now]For example, to set checkpoint between Volume1 and example.com:/data/remote_dir# gluster volume geo-replication Volume1 example.com:/data/remote_dir config checkpoint now geo-replication config updated successfully
- Display the status of checkpoint for a geo-replication session
# gluster volume geo-replicationMASTER SLAVEstatusFor example, to display the status of set checkpoint between Volume1 and example.com:/data/remote_dir# gluster volume geo-replication Volume1 example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 ssh://example.com:/data/remote_dir OK | checkpoint as of 2012-06-22 11:47:01 not reached yet
If the set checkpoint is complete, the following status is displayed:# gluster volume geo-replication Volume1 example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 ssh://example.com:/data/remote_dir OK | checkpoint as of 2012-06-21 11:47:01 completed at 2012-06-21 12:23:16
If you set checkpoints on a regular base, you can specify custom labels for them. For example, to set checkpoint between Volume1 and example.com:/data/remote_dir with label NEW_ACCOUNTS_CREATED as view its status# gluster volume geo-replication Volume1 example.com:/data/remote_dir config checkpoint NEW_ACCOUNTS_CREATED geo-replication config updated successfully. # gluster volume geo-replication Volume1 example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 ssh://example.com:/data/remote_dir OK | checkpoint NEW_ACCOUNTS_CREATED completed at 2012-06-22 11:32:23
- Delete a set checkpoint for a geo-replication session
# gluster volume geo-replication'MASTER SLAVEconfig '!checkpointFor example, to delete the checkpoint set between Volume1 and example.com:/data/remote_dir# gluster volume geo-replication Volume1 example.com:/data/remote_dir config '!checkpoint' geo-replication config updated successfully
- View the history of checkpoints for a geo-replication session
# gluster volume geo-replicationMASTER SLAVEconfig log-file | xargs grep checkpointFor example, to display the checkpoint history including set, delete, and completion events between Volume1 and example.com:/data/remote_dir# gluster volume geo-replication Volume1 example.com:/data/remote_dir config log-file | xargs grep checkpoint [2012-06-04 12:40:03.436563] I [gsyncd(conf):359:main_i] <top>: checkpoint as of 2012-06-04 12:40:02 set [2012-06-04 12:41:03.617508] I master:448:checkpt_service] _GMaster: checkpoint as of 2012-06-04 12:40:02 completed [2012-06-22 03:01:17.488917] I [gsyncd(conf):359:main_i] <top>: checkpoint as of 2012-06-22 03:01:12 set [2012-06-22 03:02:29.10240] I master:448:checkpt_service] _GMaster: checkpoint as of 2012-06-22 03:01:12 completed
stop command to stop Geo-replication (syncing of data from Master to Slave) in your environment.
- Stop geo-replication between the hosts using the following command:
# gluster volume geo-replicationMASTER SLAVEstopFor example:# gluster volume geo-replication Volume1 example.com:/data/remote_dir stop Stopping geo-replication session between Volume1 and example.com:/data/remote_dir has been successful
See Chapter 20, Command Reference for more information about the glusterFS commands.
machine1# gluster volume info Type: Distribute Status: Started Number of Bricks: 2 Transport-type: tcp Bricks: Brick1: machine1:/export/dir16 Brick2: machine2:/export/dir16 Options Reconfigured: geo-replication.indexing: on
# gluster volume geo-replication Volume1 root@example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 root@example.com:/data/remote_dir OK
/mnt/gluster on one of the client machines (client). Run the following command on client machine to view the list of files:
client# ls /mnt/gluster | wc –l 100
example.com# ls /data/remote_dir/ | wc –l 100
# gluster volume geo-replication Volume1 root@example.com:/data/remote_dir status MASTER SLAVE STATUS ______ ______________________________ ____________ Volume1 root@example.com:/data/remote_dir Faulty
client # ls /mnt/gluster | wc –l 52
Example.com# # ls /data/remote_dir/ | wc –l 100
- Stop all Master's geo-replication sessions using the following command:
# gluster volume geo-replicationMASTER SLAVEstopFor example:machine1# gluster volume geo-replication Volume1 example.com:/data/remote_dir stop Stopping geo-replication session between Volume1 & example.com:/data/remote_dir has been successful
Note
Repeatgluster volume geo-replicationcommand on all active geo-replication sessions of master volume.MASTER SLAVEstop - Replace the faulty brick in the master by using the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKstartFor example:machine1# gluster volume replace-brick Volume1 machine2:/export/dir16 machine3:/export/dir16 start Replace-brick started successfully
- Commit the migration of data using the following command:
# gluster volume replace-brickVOLNAME BRICK NEW-BRICKcommit forceFor example:machine1# gluster volume replace-brick Volume1 machine2:/export/dir16 machine3:/export/dir16 commit force Replace-brick commit successful
- Verify the migration of brick by viewing the volume info using the following command:
# gluster volume infoVOLNAMEFor example:machine1# gluster volume info Volume Name: Volume1 Type: Distribute Status: Started Number of Bricks: 2 Transport-type: tcp Bricks: Brick1: machine1:/export/dir16 Brick2: machine3:/export/dir16 Options Reconfigured: geo-replication.indexing: on
- Run rsync command manually to sync data from slave to master volume's client (mount point).For example:
example.com# rsync -PavhS --xattrs --ignore-existing /data/remote_dir/ client:/mnt/glusterVerify that the data is synced by using the following command:On master volume, run the following command:Client # ls | wc –l 100
On the Slave run the following command:example.com# ls /data/remote_dir/ | wc –l 100
Now Master volume and Slave directory is synced. - Restart geo-replication session from master to slave using the following command:
# gluster volume geo-replicationMASTER SLAVEstartFor example:machine1# gluster volume geo-replication Volume1 example.com:/data/remote_dir start Starting geo-replication session between Volume1 & example.com:/data/remote_dir has been successful
Warning
- Start rsyncd between OS and OM to sync the missing namespaces and data by running the following:
# rsync -PvSza --numeric-ids --ignore-existing /mnt/OS-VOLNAMEPRI_HOST:/mnt/OM-VOLNAME - Enable blind-sync mode in OS by running the following command:
# gluster volume geo-replicationOS OMconfig special-sync-mode blind - Start gsyncd between OS and OM by running the following command:
# gluster volume geo-replicationOS OMstart - Set a checkpoint by running the following command:
# gluster volume geo-replicationOS OMconfig checkpoint nowCheckpoint provides status on syncing state. - Monitor the checkpoint till reaches status displays
OK "completed at <time of completion>".# gluster volume geo-replicationOS OMstatus - Enable wrapup-sync mode by running the following command:
# gluster volume geo-replicationOS OMconfig special-sync-mode wrapupImportant
You must shutdown the user application before proceeding to Step 8 so that no writes happen on OS. - Repeat steps 4, 5, and 6 to know when the sync is complete. Set checkpoint again and wait for its completion.
- Stop geo-replication between the master and slave using the following command:
# gluster volume geo-replicationMASTER SLAVEstop - Stop the geo-replication indexing using the following command:
# gluster volume setMASTERgeo-replication.indexing off - Set uniform time on all bricks.
- Restart your geo-replication sessions by using the following command:
# gluster volume geo-replicationMASTER SLAVEstart
start command is initiated. Hence it would be easier to locate the log-files when required.
- Master-log-file - log file for the process which monitors the Master volume
- Slave-log-file - log file for process which initiates the changes in slave
- Master-gluster-log-file - log file for the maintenance mount point that Geo-replication module uses to monitor the master volume
- Slave-gluster-log-file - is the slave's counterpart of it
# gluster volume geo-replication MASTER SLAVE config log-file
# gluster volume geo-replication Volume1 example.com:/data/remote_dir config log-file
- On master, run the following command:
# gluster volume geo-replication Volume1 example.com:/data/remote_dir config session-owner 5f6e5200-756f-11e0-a1f0-0800200c9a66
Displays the session owner details. - On slave, run the following command:
# gluster volume geo-replication /data/remote_dir config log-file /var/log/gluster/${session-owner}:remote-mirror.log - Replace the session owner details (output of Step 1) to the output of the Step 2 to get the location of the log file.
/var/log/gluster/5f6e5200-756f-11e0-a1f0-0800200c9a66:remote-mirror.log
log-rotate command, the log file is backed up with the current timestamp suffixed to the file name and signal is sent to gsyncd to start logging to a new log file.
- Rotate log file for a particular master-slave session using the following command:
# gluster volume geo-replicationmaster slavelog-rotateFor example, to rotate the log file of masterVolume1and slaveexample.com:/data/remote_dir:# gluster volume geo-replication Volume1 example.com:/data/remote_dir log rotate log rotate successful
- Rotate log file for all sessions for a master volume using the following command:
# gluster volume geo-replicationmasterlog-rotateFor example, to rotate the log file of masterVolume1:# gluster volume geo-replication Volume1 log rotate log rotate successful
- Rotate log file for all sessions using the following command:
# gluster volume geo-replication log-rotateFor example, to rotate the log file for all sessions:# gluster volume geo-replication log rotate log rotate successful
- Password-less SSH is set up properly between the host and the remote machine.
- If FUSE is installed in the machine, because geo-replication module mounts the Red Hat Storage volume using FUSE to sync data.
- If the Slave is a volume, check if that volume is started.
- If the Slave is a plain directory, verify if the directory has been created already with the required permissions.
ssh://root@remote-host:/path/to/dir) and get the following connection refused error:
[2012-02-29 15:32:14.832443] E [resource:166:errfail] Popen: command "ssh ... -N --listen --timeout 120 file:///root/geo" returned with 1, saying: [2012-02-29 15:32:14.833977] E [resource:169:errfail] Popen: ssh> [2012-02-29 05:02:43.412096] E [socket.c:1724:socket_connect_finish] 0-glusterfs: connection to failed (Connection refused)
Important
Note
- Directory level – limits the usage at the directory level
- Volume level – limits the usage at the volume level
Note
- Enable the quota using the following command:
# gluster volume quotaVOLNAMEenableFor example, to enable quota on test-volume:# gluster volume quota test-volume enable Quota is enabled on /test-volume
- Disable the quota using the following command:
# gluster volume quotaVOLNAMEdisableFor example, to disable quota translator on test-volume:# gluster volume quota test-volume disable Quota translator is disabled on /test-volume
- Set the disk limit on a directory using the following command:
# gluster volume quotaVOLNAMElimit-usage /directorylimit-valueFor example, to set limit ondatadirectory ontest-volumewhere data is a directory under the export directory:# gluster volume quota test-volume limit-usage /data 10GB Usage limit has been set on /data
- Set the disk limit on a volume using the following command:
# gluster volume quotaVOLNAMElimit-usage /limit-valueFor example, to set limit on test-volume:# gluster volume quota test-volume limit-usage / 100GB Usage limit has been set on /
In this example,/refers to Red Hat Storage mount point. If the mount point is/mnt/rhs1then the quota limit set on/is considered for/mnt/rsh1.
Note
- Display disk limit information of all the directories on which limit is set, using the following command:
# gluster volume quotaVOLNAMElistFor example, to see the set disks limit on test-volume:# gluster volume quota test-volume list Path__________Limit______Set Size /Test/data 10 GB 6 GB /Test/data1 10 GB 4 GB - Display disk limit information on a particular directory on which limit is set, using the following command:
# gluster volume quotaVOLNAMElist/directory nameFor example, to see the set limit on /data directory of test-volume:# gluster volume quota test-volume list /data Path__________Limit______Set Size /Test/data 10 GB 6 GB
- Update the timeout of size cache using the following command:
# gluster volume setVOLNAMEfeatures.quota-timeoutvalueFor example, to update the timeout of size cache every 5 seconds on test-volume:# gluster volume set test-volume features.quota-timeout 5 Set volume successful
- Remove disk limit set on a particular directory using the following command:
# gluster volume quotaVOLNAMEremove/directory nameFor example, to remove the disk limit on /data directory of test-volume:# gluster volume quota test-volume remove /data Usage limit set on /data is removed
- 13.1. Running Volume Profile Command
- 13.2. Running Volume Top Command
- 13.2.1. Viewing Open File Descriptor Count and Maximum File Descriptor Count
- 13.2.2. Viewing Highest File Read Calls
- 13.2.3. Viewing Highest File Write Calls
- 13.2.4. Viewing Highest Open Calls on Directory
- 13.2.5. Viewing Highest Read Calls on Directory
- 13.2.6. Viewing List of Read Performance
- 13.2.7. Viewing List of Write Performance
- 13.3. Listing Volumes
- 13.4. Displaying Volume Information
- 13.5. Performing Statedump on a Volume
- 13.6. Displaying Volume Status
Top and Profile commands to view the performance and identify bottlenecks of each brick of a volume. This helps system administrators to get vital performance information whenever performance needs to be probed.
Note
Profile and Top information will be reset.
Profile command provides an interface to get the per-brick or NFS server I/O information for each File Operation (FOP) of a volume. This information helps in identifying bottlenecks in the storage system.
Profile command by performing the following operations:
- Start profiling using the following command:
# gluster volume profile VOLNAME start
# gluster volume profile test-volume start Profiling started on test-volume
diagnostics.count-fop-hits: on diagnostics.latency-measurement: on
- Display the I/O information of the bricks of a volume using the following command:
# gluster volume profileVOLNAMEinfoFor example, to see the I/O information on test-volume:# gluster volume profile test-volume info Brick: Test:/export/2 Cumulative Stats: Block 1b+ 32b+ 64b+ Size: Read: 0 0 0 Write: 908 28 8 Block 128b+ 256b+ 512b+ Size: Read: 0 6 4 Write: 5 23 16 Block 1024b+ 2048b+ 4096b+ Size: Read: 0 52 17 Write: 15 120 846 Block 8192b+ 16384b+ 32768b+ Size: Read: 52 8 34 Write: 234 134 286 Block 65536b+ 131072b+ Size: Read: 118 622 Write: 1341 594 %-latency Avg- Min- Max- calls Fop latency Latency Latency ___________________________________________________________ 4.82 1132.28 21.00 800970.00 4575 WRITE 5.70 156.47 9.00 665085.00 39163 READDIRP 11.35 315.02 9.00 1433947.00 38698 LOOKUP 11.88 1729.34 21.00 2569638.00 7382 FXATTROP 47.35 104235.02 2485.00 7789367.00 488 FSYNC ------------------ ------------------ Duration : 335 BytesRead : 94505058 BytesWritten : 195571980 - Display the I/O information of a NFS server of the specified volume using the following command:
# gluster volume profileVOLNAMEinfo nfsFor example, to see the I/O information of NFS server:# gluster volume profile test-volume info nfs NFS Server : localhost ---------------------- Cumulative Stats: Block Size: 32768b+ 65536b+ No. of Reads: 0 0 No. of Writes: 1000 1000 %-latency Avg-latency Min-Latency Max-Latency No. of calls Fop --------- ----------- ----------- ----------- ------------ ---- 0.01 410.33 us 194.00 us 641.00 us 3 STATFS 0.60 465.44 us 346.00 us 867.00 us 147 FSTAT 1.63 187.21 us 67.00 us 6081.00 us 1000 SETATTR 1.94 221.40 us 58.00 us 55399.00 us 1002 ACCESS 2.55 301.39 us 52.00 us 75922.00 us 968 STAT 2.85 326.18 us 88.00 us 66184.00 us 1000 TRUNCATE 4.47 511.89 us 60.00 us 101282.00 us 1000 FLUSH 5.02 3907.40 us 1723.00 us 19508.00 us 147 READDIRP 25.42 2876.37 us 101.00 us 843209.00 us 1012 LOOKUP 55.52 3179.16 us 124.00 us 121158.00 us 2000 WRITE Duration: 7074 seconds Data Read: 0 bytes Data Written: 102400000 bytes Interval 1 Stats: Block Size: 32768b+ 65536b+ No. of Reads: 0 0 No. of Writes: 1000 1000 %-latency Avg-latency Min-Latency Max-Latency No. of calls Fop --------- ----------- ----------- ----------- ------------ ---- 0.01 410.33 us 194.00 us 641.00 us 3 STATFS 0.60 465.44 us 346.00 us 867.00 us 147 FSTAT 1.63 187.21 us 67.00 us 6081.00 us 1000 SETATTR 1.94 221.40 us 58.00 us 55399.00 us 1002 ACCESS 2.55 301.39 us 52.00 us 75922.00 us 968 STAT 2.85 326.18 us 88.00 us 66184.00 us 1000 TRUNCATE 4.47 511.89 us 60.00 us 101282.00 us 1000 FLUSH 5.02 3907.40 us 1723.00 us 19508.00 us 147 READDIRP 25.41 2878.07 us 101.00 us 843209.00 us 1011 LOOKUP 55.53 3179.16 us 124.00 us 121158.00 us 2000 WRITE Duration: 330 seconds Data Read: 0 bytes Data Written: 102400000 bytes
- Stop profiling using the following command:
# gluster volume profileVOLNAMEstopFor example, to stop profiling on test-volume:# gluster volume profiletest-volumestopProfiling stopped on test-volume
Top command allows you to view the glusterFS bricks’ performance metrics like read, write, file open calls, file read calls, file write calls, directory open calls, and directory real calls. The Top command displays up to 100 results.
Top commands:
- View open file descriptor count and maximum file descriptor count using the following command:
# gluster volume topVOLNAMEopen [nfs | brickBRICK-NAME] [list-cntcnt]For example, to view open file descriptor count and maximum file descriptor count on brickserver:/exportoftest-volumeand list top 10 open calls:# gluster volume top
test-volumeopen brick server:/export/ list-cnt 10 Brick: server:/export/dir1 Current open fd's: 34 Max open fd's: 209 ==========Open file stats======== open file name call count 2 /clients/client0/~dmtmp/PARADOX/ COURSES.DB 11 /clients/client0/~dmtmp/PARADOX/ ENROLL.DB 11 /clients/client0/~dmtmp/PARADOX/ STUDENTS.DB 10 /clients/client0/~dmtmp/PWRPNT/ TIPS.PPT 10 /clients/client0/~dmtmp/PWRPNT/ PCBENCHM.PPT 9 /clients/client7/~dmtmp/PARADOX/ STUDENTS.DB 9 /clients/client1/~dmtmp/PARADOX/ STUDENTS.DB 9 /clients/client2/~dmtmp/PARADOX/ STUDENTS.DB 9 /clients/client0/~dmtmp/PARADOX/ STUDENTS.DB 9 /clients/client8/~dmtmp/PARADOX/ STUDENTS.DB
- View highest file Read calls using the following command:
# gluster volume topVOLNAMEread [nfs | brickBRICK-NAME] [list-cntcnt]For example, to view highest Read calls on brick server:/export of test-volume:# gluster volume top test-volume read brick server:/export list-cnt 10 Brick: server:/export/dir1 ==========Read file stats======== read filename call count 116 /clients/client0/~dmtmp/SEED/LARGE.FIL 64 /clients/client0/~dmtmp/SEED/MEDIUM.FIL 54 /clients/client2/~dmtmp/SEED/LARGE.FIL 54 /clients/client6/~dmtmp/SEED/LARGE.FIL 54 /clients/client5/~dmtmp/SEED/LARGE.FIL 54 /clients/client0/~dmtmp/SEED/LARGE.FIL 54 /clients/client3/~dmtmp/SEED/LARGE.FIL 54 /clients/client4/~dmtmp/SEED/LARGE.FIL 54 /clients/client9/~dmtmp/SEED/LARGE.FIL 54 /clients/client8/~dmtmp/SEED/LARGE.FIL
- View highest file Write calls using the following command:
# gluster volume topVOLNAMEwrite [nfs | brickBRICK-NAME] [list-cntcnt]For example, to view highest Write calls on brickserver:/exportoftest-volume:# gluster volume toptest-volumewrite brickserver:/exportlist-cnt10Brick: server:/export/dir1# gluster volume top test-volume write brick server:/export/ list-cnt 10 Brick: server:/export/dir1 ==========Write file stats======== write call count filename 83 /clients/client0/~dmtmp/SEED/LARGE.FIL 59 /clients/client7/~dmtmp/SEED/LARGE.FIL 59 /clients/client1/~dmtmp/SEED/LARGE.FIL 59 /clients/client2/~dmtmp/SEED/LARGE.FIL 59 /clients/client0/~dmtmp/SEED/LARGE.FIL 59 /clients/client8/~dmtmp/SEED/LARGE.FIL 59 /clients/client5/~dmtmp/SEED/LARGE.FIL 59 /clients/client4/~dmtmp/SEED/LARGE.FIL 59 /clients/client6/~dmtmp/SEED/LARGE.FIL 59 /clients/client3/~dmtmp/SEED/LARGE.FIL
- View list of open calls on each directory using the following command:
# gluster volume topVOLNAMEopendir [brickBRICK-NAME] [list-cntcnt]For example, to view open calls on brick server:/export/ of test-volume:# gluster volume top test-volume opendir brick server:/export/ list-cnt 10 Brick: server:/export/dir1 ==========Directory open stats======== Opendir count directory name 1001 /clients/client0/~dmtmp 454 /clients/client8/~dmtmp 454 /clients/client2/~dmtmp 454 /clients/client6/~dmtmp 454 /clients/client5/~dmtmp 454 /clients/client9/~dmtmp 443 /clients/client0/~dmtmp/PARADOX 408 /clients/client1/~dmtmp 408 /clients/client7/~dmtmp 402 /clients/client4/~dmtmp
- View list of highest directory read calls on each brick using the following command:
# gluster volume topVOLNAMEreaddir [nfs | brickBRICK-NAME] [list-cntcnt]For example, to view highest directory read calls on brickserver:/export/oftest-volume:# gluster volume top test-volume readdir brick server:/export/ list-cnt 10 Brick: server:/export/dir1 ==========Directory readdirp stats======== readdirp count directory name 1996 /clients/client0/~dmtmp 1083 /clients/client0/~dmtmp/PARADOX 904 /clients/client8/~dmtmp 904 /clients/client2/~dmtmp 904 /clients/client6/~dmtmp 904 /clients/client5/~dmtmp 904 /clients/client9/~dmtmp 812 /clients/client1/~dmtmp 812 /clients/client7/~dmtmp 800 /clients/client4/~dmtmp
- View list of read performance on each brick using the following command:
# gluster volume topVOLNAMEread-perf [bsblk-sizecountcount] [nfs | brickBRICK-NAME] [list-cntcnt]For example, to view read performance on brickserver:/export/of test-volume, 256 block size of count 1, and list count 10:# gluster volume top test-volume read-perf bs 256 count 1 brick server:/export/ list-cnt 10 Brick: server:/export/dir1 256 bytes (256 B) copied, Throughput: 4.1 MB/s ==========Read throughput file stats======== read filename Time through put(MBp s) 2912.00 /clients/client0/~dmtmp/PWRPNT/ -2012-05-09 TRIDOTS.POT 15:38:36.896486 2570.00 /clients/client0/~dmtmp/PWRPNT/ -2012-05-09 PCBENCHM.PPT 15:38:39.815310 2383.00 /clients/client2/~dmtmp/SEED/ -2012-05-09 MEDIUM.FIL 15:52:53.631499 2340.00 /clients/client0/~dmtmp/SEED/ -2012-05-09 MEDIUM.FIL 15:38:36.926198 2299.00 /clients/client0/~dmtmp/SEED/ -2012-05-09 LARGE.FIL 15:38:36.930445 2259.00 /clients/client0/~dmtmp/PARADOX/ -2012-05-09 COURSES.X04 15:38:40.549919 2221.00 /clients/client9/~dmtmp/PARADOX/ -2012-05-09 STUDENTS.VAL 15:52:53.298766 2221.00 /clients/client8/~dmtmp/PARADOX/ -2012-05-09 COURSES.DB 15:39:11.776780 2184.00 /clients/client3/~dmtmp/SEED/ -2012-05-09 MEDIUM.FIL 15:39:10.251764 2184.00 /clients/client5/~dmtmp/WORD/ -2012-05-09 BASEMACH.DOC 15:39:09.336572
- View list of write performance on each brick using the following command:
# gluster volume topVOLNAMEwrite-perf [bsblk-sizecountcount] [nfs | brickBRICK-NAME] [list-cntcnt]For example, to view write performance on brickserver:/export/oftest-volume, 256 block size of count 1, and list count 10:# gluster volume toptest-volumewrite-perf bs 256 count 1 brickserver:/export/list-cnt10Brick:server:/export/dir1256 bytes (256 B) copied, Throughput: 2.8 MB/s# gluster volume top test-volume write-perf bs 256 count 1 brick server:/export/ list-cnt 10 Brick: server:/export/dir1 256 bytes (256 B) copied, Throughput: 2.8 MB/s ==========Write throughput file stats======== write filename Time throughput (MBps) 1170.00 /clients/client0/~dmtmp/SEED/ -2012-05-09 SMALL.FIL 15:39:09.171494 1008.00 /clients/client6/~dmtmp/SEED/ -2012-05-09 LARGE.FIL 15:39:09.73189 949.00 /clients/client0/~dmtmp/SEED/ -2012-05-09 MEDIUM.FIL 15:38:36.927426 936.00 /clients/client0/~dmtmp/SEED/ -2012-05-09 LARGE.FIL 15:38:36.933177 897.00 /clients/client5/~dmtmp/SEED/ -2012-05-09 MEDIUM.FIL 15:39:09.33628 897.00 /clients/client6/~dmtmp/SEED/ -2012-05-09 MEDIUM.FIL 15:39:09.27713 885.00 /clients/client0/~dmtmp/SEED/ -2012-05-09 SMALL.FIL 15:38:36.924271 528.00 /clients/client5/~dmtmp/SEED/ -2012-05-09 LARGE.FIL 15:39:09.81893 516.00 /clients/client6/~dmtmp/ACCESS/ -2012-05-09 FASTENER.MDB 15:39:01.797317
- List all volume using the following command:
# gluster volume listFor example, to list all volumes in the trusted storage pool:# gluster volume list test-volume volume1 volume2 volume3
- Display information about a specific volume using the following command:
# gluster volume infoVOLNAMEFor example, to display information about test-volume:# gluster volume info test-volume Volume Name: test-volume Type: Distribute Status: Created Number of Bricks: 4 Bricks: Brick1: server1:/exp1 Brick2: server2:/exp2 Brick3: server3:/exp3 Brick4: server4:/exp4
- Display information about all volumes using the following command:
# gluster volume info all# gluster volume info all Volume Name: test-volume Type: Distribute Status: Created Number of Bricks: 4 Bricks: Brick1: server1:/exp1 Brick2: server2:/exp2 Brick3: server3:/exp3 Brick4: server4:/exp4 Volume Name: mirror Type: Distributed-Replicate Status: Started Number of Bricks: 2 X 2 = 4 Bricks: Brick1: server1:/brick1 Brick2: server2:/brick2 Brick3: server3:/brick3 Brick4: server4:/brick4 Volume Name: Vol Type: Distribute Status: Started Number of Bricks: 1 Bricks: Brick: server:/brick6
- mem - Dumps the memory usage and memory pool details of the bricks.
- iobuf - Dumps iobuf details of the bricks.
- priv - Dumps private information of loaded translators.
- callpool - Dumps the pending calls of the volume.
- fd - Dumps the open file descriptor tables of the volume.
- inode - Dumps the inode tables of the volume.
- history - Dumps the event history of the volume
- Perform statedump of a volume or NFS server using the following command:
# gluster volume statedumpVOLNAME[nfs] [all|mem|iobuf|callpool|priv|fd|inode|history]For example, to display statedump of test-volume:# gluster volume statedump test-volume Volume statedump successful
The statedump files are created on the brick servers in the/tmpdirectory or in the directory set usingserver.statedump-pathvolume option. The naming convention of the dump file is<brick-path>.<brick-pid>.dump. - You can change the directory of the statedump file using the following command:
# gluster volume setVOLNAMEserver.statedump-pathpathFor example, to change the location of the statedump file of test-volume:# gluster volume set test-volume server.statedump-path /usr/local/var/log/glusterfs/dumps/ Set volume successful
You can view the changed path of the statedump file using the following command:# gluster volume infoVOLNAME
- detail - Displays additional information about the bricks.
- clients - Displays the list of clients connected to the volume.
- mem - Displays the memory usage and memory pool details of the bricks.
- inode - Displays the inode tables of the volume.
- fd - Displays the open file descriptor tables of the volume.
- callpool - Displays the pending calls of the volume.
- Display information about a specific volume using the following command:
# gluster volume status [all|VOLNAME[nfs | shd |BRICKNAME]] [detail |clients | mem | inode | fd |callpool]For example, to display information about test-volume:# gluster volume status test-volume Status of volume: test-volume Gluster process Port Online Pid ------------------------------------------------------------ Brick arch:/export/rep1 24010 Y 18474 Brick arch:/export/rep2 24011 Y 18479 NFS Server on localhost 38467 Y 18486 Self-heal Daemon on localhost N/A Y 18491
The self-heal daemon status will be displayed only for replicated volumes. - Display information about all volumes using the following command:
# gluster volume status all# gluster volume status all Status of volume: test Gluster process Port Online Pid ----------------------------------------------------------- Brick 192.168.56.1:/export/test 24009 Y 29197 NFS Server on localhost 38467 Y 18486 Status of volume: test-volume Gluster process Port Online Pid ------------------------------------------------------------ Brick arch:/export/rep1 24010 Y 18474 Brick arch:/export/rep2 24011 Y 18479 NFS Server on localhost 38467 Y 18486 Self-heal Daemon on localhost N/A Y 18491
- Display additional information about the bricks using the following command:
# gluster volume statusVOLNAMEdetailFor example, to display additional information about the bricks of test-volume:# gluster volume status detail Status of volume: test-vol ------------------------------------------------------------------------------ Brick : Brick arch:/exp Port : 24012 Online : Y Pid : 18649 File System : ext4 Device : /dev/sda1 Mount Options : rw,relatime,user_xattr,acl,commit=600,barrier=1,data=ordered Inode Size : 256 Disk Space Free : 22.1GB Total Disk Space : 46.5GB Inode Count : 3055616 Free Inodes : 2577164
Detail information is not available for NFS and self-heal daemon. - Display the list of clients accessing the volumes using the following command:
# gluster volume statusVOLNAMEclientsFor example, to display the list of clients connected to test-volume:# gluster volume status test-volume clients Brick : arch:/export/1 Clients connected : 2 Hostname Bytes Read BytesWritten -------- --------- ------------ 127.0.0.1:1013 776 676 127.0.0.1:1012 50440 51200
Clients information is not available for self-heal daemon. - Display the memory usage and memory pool details of the bricks using the following command:
# gluster volume statusVOLNAMEmemFor example, to display the memory usage and memory pool details of the bricks of test-volume:Memory status for volume : test-volume ---------------------------------------------- Brick : arch:/export/1 Mallinfo -------- Arena : 434176 Ordblks : 2 Smblks : 0 Hblks : 12 Hblkhd : 40861696 Usmblks : 0 Fsmblks : 0 Uordblks : 332416 Fordblks : 101760 Keepcost : 100400 Mempool Stats ------------- Name HotCount ColdCount PaddedSizeof AllocCount MaxAlloc ---- -------- --------- ------------ ---------- -------- test-volume-server:fd_t 0 16384 92 57 5 test-volume-server:dentry_t 59 965 84 59 59 test-volume-server:inode_t 60 964 148 60 60 test-volume-server:rpcsvc_request_t 0 525 6372 351 2 glusterfs:struct saved_frame 0 4096 124 2 2 glusterfs:struct rpc_req 0 4096 2236 2 2 glusterfs:rpcsvc_request_t 1 524 6372 2 1 glusterfs:call_stub_t 0 1024 1220 288 1 glusterfs:call_stack_t 0 8192 2084 290 2 glusterfs:call_frame_t 0 16384 172 1728 6
- Display the inode tables of the volume using the following command:
# gluster volume statusVOLNAMEinodeFor example, to display the inode tables of the test-volume:# gluster volume status test-volume inode inode tables for volume test-volume ---------------------------------------------- Brick : arch:/export/1 Active inodes: GFID Lookups Ref IA type ---- ------- --- ------- 6f3fe173-e07a-4209-abb6-484091d75499 1 9 2 370d35d7-657e-44dc-bac4-d6dd800ec3d3 1 1 2 LRU inodes: GFID Lookups Ref IA type ---- ------- --- ------- 80f98abe-cdcf-4c1d-b917-ae564cf55763 1 0 1 3a58973d-d549-4ea6-9977-9aa218f233de 1 0 1 2ce0197d-87a9-451b-9094-9baa38121155 1 0 2
- Display the open file descriptor tables of the volume using the following command:
# gluster volume statusVOLNAMEfdFor example, to display the open file descriptor tables of the test-volume:# gluster volume status test-volume fd FD tables for volume test-volume ---------------------------------------------- Brick : arch:/export/1 Connection 1: RefCount = 0 MaxFDs = 128 FirstFree = 4 FD Entry PID RefCount Flags -------- --- -------- ----- 0 26311 1 2 1 26310 3 2 2 26310 1 2 3 26311 3 2 Connection 2: RefCount = 0 MaxFDs = 128 FirstFree = 0 No open fds Connection 3: RefCount = 0 MaxFDs = 128 FirstFree = 0 No open fds
FD information is not available for NFS and self-heal daemon. - Display the pending calls of the volume using the following command:
# gluster volume statusVOLNAMEcallpoolEach call has a call stack containing call frames.For example, to display the pending calls of test-volume:# gluster volume status test-volume callpool Pending calls for volume test-volume ---------------------------------------------- Brick : arch:/export/1 Pending calls: 2 Call Stack1 UID : 0 GID : 0 PID : 26338 Unique : 192138 Frames : 7 Frame 1 Ref Count = 1 Translator = test-volume-server Completed = No Frame 2 Ref Count = 0 Translator = test-volume-posix Completed = No Parent = test-volume-access-control Wind From = default_fsync Wind To = FIRST_CHILD(this)->fops->fsync Frame 3 Ref Count = 1 Translator = test-volume-access-control Completed = No Parent = repl-locks Wind From = default_fsync Wind To = FIRST_CHILD(this)->fops->fsync Frame 4 Ref Count = 1 Translator = test-volume-locks Completed = No Parent = test-volume-io-threads Wind From = iot_fsync_wrapper Wind To = FIRST_CHILD (this)->fops->fsync Frame 5 Ref Count = 1 Translator = test-volume-io-threads Completed = No Parent = test-volume-marker Wind From = default_fsync Wind To = FIRST_CHILD(this)->fops->fsync Frame 6 Ref Count = 1 Translator = test-volume-marker Completed = No Parent = /export/1 Wind From = io_stats_fsync Wind To = FIRST_CHILD(this)->fops->fsync Frame 7 Ref Count = 1 Translator = /export/1 Completed = No Parent = test-volume-server Wind From = server_fsync_resume Wind To = bound_xl->fops->fsync
- Creating a volume
- Starting a volume
- Adding a brick
- Removing a brick
- Tuning volume options
- Stopping a volume
- Deleting a volume
Note
- /var/lib/glusterd/hooks/1/create/
- /var/lib/glusterd/hooks/1/delete/
- /var/lib/glusterd/hooks/1/start/
- /var/lib/glusterd/hooks/1/stop/
- /var/lib/glusterd/hooks/1/set/
- /var/lib/glusterd/hooks/1/add-brick/
- /var/lib/glusterd/hooks/1/remove-brick/
--volname=VOLNAME. Command specific additional arguments are provided for the following volume operations:
- Start volume
- --first=yes, if the volume is the first to be started
- --first=no, for otherwise
- Stop volume
- --last=yes, if the volume is to be stopped last.
- --last=no, for otherwise
- Set volume
- -o key=valueFor every key, value is specified in volume set command.
/var/lib/glusterd/hooks/1/start/post and /var/lib/glusterd/hooks/1/stop/pre By default, the scripts are enabled.
# gluster volume start VOLNAME
S30samba-start.sh script performs the following:
- Adds Samba share configuration details of the volume to the
smb.conffile - Mounts the volume through FUSE and adds an entry in
/etc/fstabfor the same. - Restarts Samba to run with updated configuration
# gluster volume stop VOLNAME
S30samba-stop.sh script performs the following:
- Removes the Samba share details of the volume from the
smb.conffile - Unmounts the FUSE mount point and removes the corresponding entry in
/etc/fstab - Restarts Samba to run with updated configuration
Table of Contents
Note
- Navigate to the Amazon Web Services home page at http://aws.amazon.com. The Amazon Web Services home page appears.

- Login to Amazon Web Services. The Amazon Web Services main screen appears.
- Click the Amazon EC2 tab. The Amazon EC2 Console Dashboard appears.

- Click the Launch Instance button. The Choose an AMI step of the Request Instances Wizard appears.

- Click the Select button for the corresponding AMI. The Instance Details screen appears.

- Choose Large using the Instance Type menu, and click Continue. The Instance Details screen continues.

- Accept the default settings, and click Continue. The Instance Details screen continues..

- Type a name for the instance in the Value field for Name in Key field , and click Continue. You can use this name later to verify that the instance is operating correctly.The Create Key Pair screen appears.

- Choose an existing key pair or create a new key pair, and click Continue. The Configure Firewall screen appears.

- Select a security group from the Security Groups field, and click Continue. You must ensure to open the following TCP port numbers in the selected security group:
- 22
- 6000, 6001, 6002, 443, and 8080 ports if Unified File and Object Storage is enabled
The screen is displayed to review your settings.
- Review your settings, and click Launch. A screen appears indicating that the instance is launching.

- Click Close. The Amazon EC2 Console Dashboard appears.
- On the Amazon Web Services home page, click the Amazon EC2 tab. The Amazon EC2 Console Dashboard appears.

- Click the Instances link in the Instances section on the left. The My Instances screen appears showing your current instances.

- Check the Status column and verify that the instance is running. A yellow circle indicates a status of pending while a green circle indicates that the instance is running.Click the instance and verify the details displayed in the Description tab.

- Note the domain name in the Public DNS field. You can use this domain to perform a remote login to the instance.

- Using SSH and the domain from the previous step, login to the Red Hat Amazon Machine Image instance. Use the key pair that you selected or created when launching the instance.Example:Enter the following in command line:
# ssh -i rhs-aws.pem root ec2-23-20-52-123.compute-1.amazonaws.com
- At the command line, enter the following command:.
# service glusterd statusVerify that the command indicates that the glusterd daemon is running.
Important
- Create an EBS volume using the following command:
# ec2-create-volume -s SIZE -z ZONEFor example,# ec2-create-volume -s 16 -z us-east-1a vol-239289
This command creates a volume of 16 GB and returns the volume ID. - Use the generated volume ID to attach the created volume to an existing Red Hat Storage instance, using the following command:
# ec2-attach-volume volumeid -i instanceid -dDEVICEFor example,# ec2-attach-volume vol-239289 -i i-343833 -d /dev/sdf1The device/dev/sdf1appears as/dev/xvdf1in the instance.Important
You must repeat the above steps to add remaining 7 Amazon EBS volumes to the existing instances. - Amazon EBS volumes are assembled in to a RAID volume in support of configuration as a brick. Assemble software RAID 0 (stripe) using the following command:
# mdadm --createarrayname--level=0 --raid-devices=8list of all devicesFor example, to create a software raid of eight volumes# mdadm --create /dev/md0 --level=0 --raid-devices=8 /dev/xvdf1 /dev/xvdf2 /dev/xvdf3 /dev/xvdf4 /dev/xvdf5 /dev/xvdf6 /dev/xvdf7 /dev/xvdf8# mdadm --examine --scan > /etc/mdadm.conf - Tag the attached EBS volumes using the following command:
ec2-create-tags VOLID \--tag Domain=gluster \--tag Device=DEVICE \--tag Instance=INSTANCE_ID\--tag Array=UUIDTable 16.1. Field Description
Variable Description VOLID EBS volume ID DEVICE Device path of the EBS volume in the instance INSTANCE_ID Instance Id to which the volume is attached UUID UUID of the array device. You can obtain the UUID of the array device by running # mdadm --detailcommand.DEVICE| grep UUIDFor example, to tag/dev/xvdf1device, run the following command:# ec2-create-tags vol-239289 \ --tag Domain=gluster \ --tag Device=/dev/xvdf1 \ --tag Instance=i-343833 \ --tag Array=e35641fc:621a9fa8:276a0ee4:a1bc6b5f
Repeat Step 4 to tag all eight EBS volumes. - Create a LVM Logical Volume (LV) by running the following commands:
# pvcreate/dev/md0# vgcreateglustervg /dev/md0# vgchange -a yglustervg# lvcreate -a y -l 100%VG -nglusterlv glustervgHereglustervgis the name of the volume group andglusterlvis the name of the logical volume. This LVM logical volume created over EBS RAID volumes is used as Red Hat Storage bricks.For more information on creating LVM, refer to https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/index.html. - Format the LVM LV using the following command:
# mkfs.xfs -i size=512DEVICEFor example, to format/dev/glustervg/glusterlvrun the following command:# mkfs.xfs -i size=512 /dev/glustervg/glusterlv - Mount the device using the following commands:
# mkdir -p /export/glusterlv# mount /dev/glustervg/glusterlv /export/glusterlv - Add the device entry to
/etc/fstabto mount the device automatically on every reboot. Run the following command to automatically add the device entry tofstab# echo "/dev/glustervg/glusterlv /export/glusterlv xfs defaults 0 2" >> /etc/fstab
Table of Contents
Note
tempauth.
- No limit on upload and download files sizes as compared to OpenStack Swift which limits the object size to 5 GB.
- A unified view of data across NAS and Object Storage technologies.
- Using Red Hat Storage's Unified File and Obect Storage has other advantages like the following:
- High availability
- Scalability
- Replication
- Elastic Volume Management
memcached service using the following command:
# service memcached start- 6000 - Object Server
- 6001 - Container Server
- 6002 - Account Server
- Proxy Server
- 443 - for HTTPS request
- 8080 - for HTTP request
- admin user
- normal user
/etc/swift/proxy-server.conf file:
user_<account-name>_<user-name> = <password> [.admin]user_test_tester = testing .adminImportant
proxy-server.conf file. It is highly recommended that you remove all the default sample user entries from the configuration file.
/etc/swift/proxy-server.conf. The following is the sample proxy-server.conf file:
[app:proxy-server] use = egg:swift#proxy allow_account_management = true account_autocreate = true [filter:tempauth] use = egg:swift#tempauth user_admin_admin = admin.admin.reseller_admin user_test_tester = testing .admin user_test2_tester2 = testing2 .admin user_test_tester3 = testing3 [filter:healthcheck] use = egg:swift#healthcheck [filter:cache] use = egg:swift#memcache
tempauth .
- Create self-signed cert for SSL using the following commands:
cd /etc/swift openssl req -new -x509 -nodes -out cert.crt -keyout cert.key
- Add the following lines to
/etc/swift/proxy-server.confunder[DEFAULT]bind_port = 443 cert_file = /etc/swift/cert.crt key_file = /etc/swift/cert.key
- Restart the servers using the following commands:
swift-init main stop swift-init main start
Table 18.1. Proxy Server - Configurable Default Options
| Option | Default | Description |
|---|---|---|
| bind_ip | 127.0.0.1 | IP Address for server to bind. |
| bind_port | 8080 | Port for server to bind. |
| swift_dir | /etc/swift | Swift configuration directory. |
| workers | 1 | Number of workers to fork. |
| user | swift | Swift user. |
| cert_file |
Path to the ssl.crt file.
| |
| key_file |
Path to the ssl.key file.
|
Note
Table 18.2. Proxy Server - Configurable Server Options
| Option | Default | Description |
|---|---|---|
| use | egg:swift#container | Entry point for paste.deploy for the container server. |
| log_name | proxy-server | Label used when logging. |
| log_facility | LOG_LOCAL0 | Syslog log facility. |
| log_level | INFO | Log level. |
| log_headers | True | If True, log headers in each request. |
| recheck_account_existence | 60 | Cache timeout in seconds to send memcached for account existence. |
| recheck_container_existence | 60 | Cache timeout in seconds to send memcached for container existence. |
| object_chunk_size | 65536 | Chunk size to read from object servers. |
| client_chunk_size | 65536 | Chunk size to read from clients. |
| memcache_servers | 127.0.0.1:11211 | Comma separated list of memcached servers ip:port. |
| node_timeout | 10 | Request timeout to external services. |
| client_timeout | 60 | Timeout to read one chunk from a client. |
| conn_timeout | 0.5 | Connection timeout to external services. |
| error_suppression_interval | 60 | Time in seconds that must elapse since the last error for a node to be considered no longer error limited. |
| error_suppression_limit | 10 | Error count to consider a node error limited. |
| allow_account_management | false |
Whether account PUTs and DELETEs are even callable.
|
Enabling Distributed Caching with Memcached
memcache_servers config option in the proxy-server.conf and list all memcached servers.
proxy-server.conf file.
[filter:cache] use = egg:swift#memcache memcache_servers = 192.168.1.20:11211,192.168.1.21:11211,192.168.1.22:11211
/etc/swift/object-server/1.conf. The following is the sample object-server/1.conf file:
[DEFAULT] devices = /srv/1/node mount_check = false bind_port = 6010 user = root log_facility = LOG_LOCAL2 [pipeline:main] pipeline = gluster object-server [app:object-server] use = egg:swift#object [filter:gluster] use = egg:swift#gluster [object-replicator] vm_test_mode = yes [object-updater] [object-auditor]
Table 18.3. Object Server - Configurable Default Options
| Option | Default | Description |
|---|---|---|
| swift_dir | /etc/swift | Swift configuration directory. |
| devices | /srv/node | Mount parent directory where devices are mounted. |
| mount_check | true | Whether or not check if the devices are mounted to prevent accidentally writing to the root device. |
| bind_ip | 0.0.0.0 | IP Address for server to bind. |
| bind_port | 6000 | Port for server to bind. |
| workers | 1 | Number of workers to fork. |
Table 18.4. Object Server - Configurable Server Options
| Option | Default | Description |
|---|---|---|
| use | egg:swift#object |
Entry point for paste.deploy for the object server. For most cases, this should be egg:swift#object.
|
| log_name | object-server | Log name used when logging. |
| log_facility | LOG_LOCAL0 | Syslog log facility. |
| log_level | INFO | Logging level. |
| log_requests | True | Whether or not to log each request. |
| user | swift | Swift user. |
| node_timeout | 3 | Request timeout to external services. |
| conn_timeout | 0.5 | Connection timeout to external services. |
| network_chunk_size | 65536 | Size of chunks to read or write over the network. |
| disk_chunk_size | 65536 | Size of chunks to read or write to disk. |
| max_upload_time | 65536 | Maximum time allowed to upload an object. |
| slow | 0 |
If > 0, minimum time in seconds for a PUT or DELETE request to complete.
|
/etc/swift/container-server/1.conf file. The following is the sample container-server/1.conf file:
[DEFAULT] devices = /srv/1/node mount_check = false bind_port = 6011 user = root log_facility = LOG_LOCAL2 [pipeline:main] pipeline = gluster container-server [app:container-server] use = egg:swift#container [filter:gluster] use = egg:swift#gluster [container-replicator] [container-updater] [container-auditor]
Table 18.5. Container Server - Configurable Default Options
| Option | Default | Description |
|---|---|---|
| swift_dir | /etc/swift | Swift configuration directory. |
| devices | /srv/node | Mount parent directory where devices are mounted. |
| mount_check | true | Whether or not check if the devices are mounted to prevent accidentally writing to the root device. |
| bind_ip | 0.0.0.0 | IP address for server to bind. |
| bind_port | 6001 | Port for server to bind. |
| workers | 1 | Number of workers to fork. |
| user | swift | Swift user. |
Table 18.6. Container Server - Configurable Server Options
| Option | Default | Description |
|---|---|---|
| use | egg:swift#container | Entry point for paste.deploy for the container server. |
| log_name | container-server | Label used when logging. |
| log_facility | LOG_LOCAL0 | Syslog log facility. |
| log_level | INFO | Logging level. |
| node_timeout | 3 | Request timeout to external services. |
| conn_timeout | 0.5 | Connection timeout to external services. |
/etc/swift/account-server/1.conf file. The following is the sample account-server/1.conf file:
[DEFAULT] devices = /srv/1/node mount_check = false bind_port = 6012 user = root log_facility = LOG_LOCAL2 [pipeline:main] pipeline = gluster account-server [app:account-server] use = egg:swift#account [filter:gluster] use = egg:swift#gluster [account-replicator] vm_test_mode = yes [account-auditor] [account-reaper]
Table 18.7. Account Server - Configurable Default Options
| Option | Default | Description |
|---|---|---|
| swift_dir | /etc/swift | Swift configuration directory. |
| devices | /srv/node | Mount parent directory where devices are mounted. |
| mount_check | true | Whether or not check if the devices are mounted to prevent accidentally writing to the root device. |
| bind_ip | 0.0.0.0 | IP address for server to bind. |
| bind_port | 6002 | Port for server to bind. |
| workers | 1 | Number of workers to fork. |
| user | swift | Swift user. |
Table 18.8. Account Server - Configurable Server Options
| Option | Default | Description |
|---|---|---|
| use | egg:swift#container | Entry point for paste.deploy for the container server. |
| log_name | account-server | Label used when logging. |
| log_facility | LOG_LOCAL0 | Syslog log facility. |
| log_level | INFO | Logging level. |
- To start the server, enter the following command:
# swift-init main start - To stop the server, enter the following command:
# swift-init main stop
# chkconfig memcached on
# chkconfig gluster-swift-proxy on
# chkconfig gluster-swift-account on
# chkconfig gluster-swift-container on
# chkconfig gluster-swift-object on
X-Storage-URL HTTP header obtained during successful authentication.
- To authenticate, run the following command:
GET auth/v1.0 HTTP/1.1 Host: <auth URL> X-Auth-User: <account name>:<user name> X-Auth-Key: <user-Password>
For example,GET auth/v1.0 HTTP/1.1 Host: auth.example.com X-Auth-User: test:tester X-Auth-Key: testing HTTP/1.1 200 OK X-Storage-Url: https:/example.storage.com:443/v1/AUTH_test X-Storage-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554 X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554 Content-Length: 0 Date: Wed, 10 jul 2011 06:11:51 GMT
To authenticate access using cURL (for the above example), run the following command:curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass:testing' -k https://auth.example.com:443/auth/v1.0
The X-Auth-Url has to be parsed and used in the connection and request line of all subsequent requests to the server. In the example output, users connecting to server will send most container/object requests with a host header of example.storage.com and the request line's version and account as v1/AUTH_test.
Note
GET command. You can use the following optional parameters with GET request to refine the results:
Table 18.9. Parameters - Container Information
| Parameter | Description |
|---|---|
| limit | Limits the number of results to nth value. |
| marker | Returns object names greater in value than the specified marker. |
| format |
Specify either JSON or XML to return the respective serialized response.
|
- List all the containers of an account using the following command:
GET /<apiversion>/<account> HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key>
For example,GET /v1/AUTH_test HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 200 Ok Date: Wed, 13 Jul 2011 16:32:21 GMT Server: Apache Content-Type: text/plain; charset=UTF-8 Content-Length: 39 songs movies documents reports
curl -v -X GET -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test -k
HEAD command to the storage service to view the number of containers and the total bytes stored in the account.
- To display containers and storage used, run the following command:
HEAD /<apiversion>/<account> HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key>
For example,HEAD /v1/AUTH_test HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 204 No Content Date: Wed, 13 Jul 2011 16:52:21 GMT Server: Apache X-Account-Container-Count: 4 X-Account-Total-Bytes-Used: 394792
To display account metadata information using cURL (for the above example), run the following command:curl -v -X HEAD -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test -k
PUT command to create containers. Containers are the storage folders for your data. The URL encoded name must be less than 256 bytes and cannot contain a forward slash '/' character.
- To create a container, run the following command:
PUT /<apiversion>/<account>/<container>/ HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key>
For example,PUT /v1/AUTH_test/pictures/ HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 201 Created Date: Wed, 13 Jul 2011 17:32:21 GMT Server: Apache Content-Type: text/plain; charset=UTF-8
To create container using cURL (for the above example), run the following command:curl -v -X PUT -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/pictures -k
The status code of 201 (Created) indicates that you have successfully created the container. If a container with a same name already exists, the 202 status code is displayed.
GET command. You can use the following optional parameters with the GET request to refine the results:
Table 18.10. Parameters - Container Objects
| Parameter | Description |
|---|---|
| limit | Limits the number of results to nth value. |
| marker | Returns object names greater in value than the specified marker. |
| prefix | Displays the results limited to object names beginning with the substring x. beginning with the substring x. |
| path | Returns the object names nested in the pseudo path. |
| format |
Specify either JSON or XML to return the respective serialized response.
|
| delimiter | Returns all the object names nested in the container. |
- List objects of a specific container using the following command:
GET /<apiversion>/<account>/<container>[parm=value] HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key>
GET /v1/AUTH_test/images HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 200 Ok Date: Wed, 13 Jul 2011 15:42:21 GMT Server: Apache Content-Type: text/plain; charset=UTF-8 Content-Length: 139 sample file.jpg test-file.pdf You and Me.pdf Puddle of Mudd.mp3 Test Reports.doc
curl -v -X GET-H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images -k
HEAD command to the storage service to view the number of objects in a container and the total bytes of all the objects stored in the container.
- To display list of objects and storage used, run the following command:
HEAD /<apiversion>/<account>/<container> HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key>
For example,HEAD /v1/AUTH_test/images HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 204 No Content Date: Wed, 13 Jul 2011 19:52:21 GMT Server: Apache X-Account-Object-Count: 8 X-Container-Bytes-Used: 472
To display list of objects and storage used in a container using cURL (for the above example), run the following command:curl -v -X HEAD -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images -k
DELETE command to permanently delete containers. The container must be empty before it can be deleted.
HEAD command to determine if it contains any objects.
- To delete a container, run the following command:
DELETE /<apiversion>/<account>/<container>/ HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key>
For example,DELETE /v1/AUTH_test/pictures HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 204 No Content Date: Wed, 13 Jul 2011 17:52:21 GMT Server: Apache Content-Length: 0 Content-Type: text/plain; charset=UTF-8
To delete a container using cURL (for the above example), run the following command:curl -v -X DELETE -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/pictures -k
The status code of 204 (No Content) indicates that you have successfully deleted the container. If that container does not exist, the status code 404 (Not Found) is displayed, and if the container is not empty, the status code 409 (Conflict) is displayed.
- To update the metadata of the object, run the following command:
POST /<apiversion>/<account>/<container> HTTP/1.1 Host: <storage URL> X-Auth-Token: <Authentication-token-key> X-Container-Meta-<key>: <new value> X-Container-Meta-<key>: <new value>
For example,POST /v1/AUTH_test/images HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 X-Container-Meta-Zoo: Lion X-Container-Meta-Home: Dog HTTP/1.1 204 No Content Date: Wed, 13 Jul 2011 20:52:21 GMT Server: Apache Content-Type: text/plain; charset=UTF-8
To update the metadata of the object using cURL (for the above example), run the following command:curl -v -X POST -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images -H ' X-Container-Meta-Zoo: Lion' -H 'X-Container-Meta-Home: Dog' -k
The status code of 204 (No Content) indicates the container's metadata is updated successfully. If that object does not exist, the status code 404 (Not Found) is displayed.
POST command on container with x-container-read and x-container-write keys.
[item[,item...]]. Each item can be a group name to give access to or a referrer designation to grant or deny based on the HTTP Referer header.
.r:[-]value.
.r can also be .ref, .referer, or .referrer; though it will be shortened to .r for decreased character count usage. The value can be * to specify any referrer host is allowed access. The leading minus sign (-) indicates referrer hosts that should be denied access.
.r:* .r:*,bobs_account,sues_account:sue bobs_account,sues_account:sue
.r: .r:-
.r will not allow listing objects in the container but allows retrieving objects from the container. Use the .rlistings directive to turn on listings. Also, .r designations are not allowed in headers whose names include the word write.
curl -v -X POST -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images -H 'X-Container-Read: .r:*' -k
PUT command to write or update an object's content and metadata.
PUT request. The objects created with custom metadata via HTTP headers are identified with the X-Object-Meta-prefix.
- To create or update an object, run the following command:
PUT /<apiversion>/<account>/<container>/<object> HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key> ETag: da1e100dc9e7becc810986e37875ae38 Content-Length: 342909 X-Object-Meta-PIN: 2343
For example,PUT /v1/AUTH_test/pictures/dog HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 ETag: da1e100dc9e7becc810986e37875ae38 HTTP/1.1 201 Created Date: Wed, 13 Jul 2011 18:32:21 GMT Server: Apache ETag: da1e100dc9e7becc810986e37875ae38 Content-Length: 0 Content-Type: text/plain; charset=UTF-8
To create or update an object using cURL (for the above example), run the following command:curl -v -X PUT -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/pictures/dog -H 'Content- Length: 0' -k
The status code of 201 (Created) indicates that you have successfully created or updated the object. If there is a missing content-Length or Content-Type header in the request, the status code of 412 (Length Required) is displayed. (Optionally) If the MD5 checksum of the data written to the storage system does not match the ETag value, the status code of 422 (Unprocessable Entity) is displayed.
- To create or update an object, run the following command:
PUT /<apiversion>/<account>/<container>/<object> HTTP/1.1 Host: <storage URL> X-Auth-Token: <authentication-token-key> Transfer-Encoding: chunked X-Object-Meta-PIN: 2343
For example,PUT /v1/AUTH_test/pictures/cat HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 Transfer-Encoding: chunked X-Object-Meta-PIN: 2343 19 A bunch of data broken up D into chunks. 0
- To add a new object and designate the source of the data from another container, run the following command:
COPY /<apiversion>/<account>/<container>/<sourceobject> HTTP/1.1 Host: <storage URL> X-Auth-Token: < authentication-token-key> Destination: /<container>/<destinationobject>
For example,COPY /v1/AUTH_test/images/dogs HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 Destination: /photos/cats HTTP/1.1 201 Created Date: Wed, 13 Jul 2011 18:32:21 GMT Server: Apache Content-Length: 0 Content-Type: text/plain; charset=UTF-8
To copy an object using cURL (for the above example), run the following command:curl -v -X COPY -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' -H 'Destination: /photos/cats' -k https://example.storage.com:443/v1/AUTH_test/images/dogs
The status code of 201 (Created) indicates that you have successfully copied the object. If there is a missing content-Length or Content-Type header in the request, the status code of 412 (Length Required) is displayed.You can also usePUTcommand to copy object by using additional headerX-Copy-From: container/obj. - To use
PUTcommand to copy an object, run the following command:PUT /v1/AUTH_test/photos/cats HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 X-Copy-From: /images/dogs HTTP/1.1 201 Created Date: Wed, 13 Jul 2011 18:32:21 GMT Server: Apache Content-Type: text/plain; charset=UTF-8
To copy an object using cURL (for the above example), run the following command:curl -v -X PUT -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' -H 'X-Copy-From: /images/dogs' –k https://example.storage.com:443/v1/AUTH_test/images/cats
The status code of 201 (Created) indicates that you have successfully copied the object.
GET command on an object to view the object data of the object.
- To display the content of an object run the following command:
GET /<apiversion>/<account>/<container>/<object> HTTP/1.1 Host: <storage URL> X-Auth-Token: <Authentication-token-key>
For example,GET /v1/AUTH_test/images/cat HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 200 Ok Date: Wed, 13 Jul 2011 23:52:21 GMT Server: Apache Last-Modified: Thu, 14 Jul 2011 13:40:18 GMT ETag: 8a964ee2a5e88be344f36c22562a6486 Content-Length: 534210 [.........]
To display the content of an object using cURL (for the above example), run the following command:curl -v -X GET -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images/cat -k
The status code of 200 (Ok) indicates the object's data is displayed successfully. If that object does not exist, the status code 404 (Not Found) is displayed.
HEAD command on an object to view the object metadata and other standard HTTP headers. You must send only authorization token as header.
- To display the metadata of the object, run the following command:
HEAD /<apiversion>/<account>/<container>/<object> HTTP/1.1 Host: <storage URL> X-Auth-Token: <Authentication-token-key>
HEAD /v1/AUTH_test/images/cat HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 204 No Content Date: Wed, 13 Jul 2011 21:52:21 GMT Server: Apache Last-Modified: Thu, 14 Jul 2011 13:40:18 GMT ETag: 8a964ee2a5e88be344f36c22562a6486 Content-Length: 512000 Content-Type: text/plain; charset=UTF-8 X-Object-Meta-House: Cat X-Object-Meta-Zoo: Cat X-Object-Meta-Home: Cat X-Object-Meta-Park: Cat
curl -v -X HEAD -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images/cat -k
POST command on an object name only to set or overwrite arbitrary key metadata. You cannot change the object's other headers such as Content-Type, ETag and others using POST operation. The POST command will delete all the existing metadata and replace it with the new arbitrary key metadata.
- To update the metadata of an object, run the following command:
POST /<apiversion>/<account>/<container>/<object> HTTP/1.1 Host: <storage URL> X-Auth-Token: <Authentication-token-key> X-Object-Meta-<key>: <new value> X-Object-Meta-<key>: <new value>
For example,POST /v1/AUTH_test/images/cat HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 X-Object-Meta-Zoo: Lion X-Object-Meta-Home: Dog HTTP/1.1 202 Accepted Date: Wed, 13 Jul 2011 22:52:21 GMT Server: Apache Content-Length: 0 Content-Type: text/plain; charset=UTF-8
To update the metadata of an object using cURL (for the above example), run the following command:curl -v -X POST -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/images/cat -H ' X-Object- Meta-Zoo: Lion' -H 'X-Object-Meta-Home: Dog' -k
The status code of 202 (Accepted) indicates that you have successfully updated the object's metadata. If that object does not exist, the status code 404 (Not Found) is displayed.
DELETE command to permanently delete the object.
DELETE command on an object will be processed immediately and any subsequent operations like GET, HEAD, POST, or DELETE on the object will display 404 (Not Found) error.
- To delete an object, run the following command:
DELETE /<apiversion>/<account>/<container>/<object> HTTP/1.1 Host: <storage URL> X-Auth-Token: <Authentication-token-key>
For example,DELETE /v1/AUTH_test/pictures/cat HTTP/1.1 Host: example.storage.com X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554 HTTP/1.1 204 No Content Date: Wed, 13 Jul 2011 20:52:21 GMT Server: Apache Content-Type: text/plain; charset=UTF-8
To delete an object using cURL (for the above example), run the following command:curl -v -X DELETE -H 'X-Auth-Token: AUTH_tkde3ad38b087b49bbbac0494f7600a554' https://example.storage.com:443/v1/AUTH_test/pictures/cat -k
The status code of 204 (No Content) indicates that you have successfully deleted the object. If that object does not exist, the status code 404 (Not Found) is displayed.
Important
Note

- Provides simultaneous file-based and object-based access within Hadoop.
- Eliminates the centralized metadata server.
- Provides compatibility with MapReduce applications and code rewrite is not required.
- Provides a fault tolerant file system.
- Hadoop 0.20.2 is installed, configured, and is running on all the machines in the trusted storage pool.For more information on installing, configuring, and running Hadoop, see http://hadoop.apache.org/common/docs/r0.15.2/cluster_setup.html.
- Java Runtime Environment.To install Java Runtime Environment, run
# yum install java-1.6.0-openjdkcommand.
- Edit the
core-site.xmlfile available at/usr/share/java/conf. The following is the samplecore-site.xmlfile:<configuration> <property> <name>fs.glusterfs.impl</name> <value>org.apache.hadoop.fs.glusterfs.GlusterFileSystem</value> </property> <property> <name>fs.default.name</name> <value>glusterfs://192.168.1.36:9000</value> </property> <property> <name>fs.glusterfs.volname</name> <value>hadoopvol</value> </property> <property> <name>fs.glusterfs.mount</name> <value>/mnt/glusterfs</value> </property> <property> <name>fs.glusterfs.server</name> <value>192.168.1.36</value> </property> <property> <name>quick.slave.io</name> <value>Off</value> </property> </configuration>The following table lists the fields ofcore-site.xmlfile that you can configure:Table 19.1. Configurable Fields
Property Name Default Value Description fs.default.name glusterfs://192.168.1.36:9000 Any hostname in the trusted storage pool as the server and any port number. fs.glusterfs.volname volume-dist-rep Red Hat Storage volume to mount. fs.glusterfs.mount /mnt/glusterfs The directory used to fuse mount the volume. fs.glusterfs.server 192.168.1.36 Any hostname or IP address on the trusted storage pool. quick.slave.io Off Performance tunable option. If this option is set to On, the plugin will try to perform I/O directly from the disk file system (like ext3 or ext4) the file resides on. As a result, read performance improves and jobs run faster. Note
This option is not tested widely. - Copy
glusterfs-0.20.2-0.1.jarandcore-site.xmlfiles to Hadoop’slib/andconf/directory respectively using the following commands:# cp /usr/share/java/glusterfs-0.20.2-0.1.jar
$HADOOP_HOME/lib/# cp /usr/share/java/conf/core-site.xml
$HADOOP_HOME/conf/
- To start MapReduce daemon manually, enter the following command:
#
$HADOOP_HOME/bin/start-mapred.sh - To stop MapReduce daemon manually, enter the following command:
#
$HADOOP_HOME/bin/stop-mapred.sh
Note
Table of Contents
- gluster CommandGluster Console Manager (command line interpreter)
- glusterd DaemonGlusterFS elastic volume management daemon
| Command | Description | |
|---|---|---|
| Volume | ||
| gluster volume info [all | VOLNAME] | Displays information about all volumes, or the specified volume. | |
| gluster volume create NEW-VOLNAME [stripe COUNT] [replica COUNT] [transport tcp | rdma | tcp,rdma] NEW-BRICK ... |
Creates a new volume of the specified type using the specified bricks and transport type (the default transport type is tcp).
| |
| gluster volume delete VOLNAME | Deletes the specified volume. | |
| gluster volume start VOLNAME | Starts the specified volume. | |
| gluster volume stop VOLNAME [force] | Stops the specified volume. | |
| gluster volume list | Lists all volumes in the trusted storage pool. | |
| gluster volume help | Displays help for the volume command. | |
| Brick | ||
| gluster volume add-brick VOLNAME [<stripe|replica> <COUNT>] NEW-BRICK ... | Adds the specified bricks to the specified volume. | |
| gluster volume remove-brick VOLNAME [(replica COUNT)|(stripe COUNT)] BRICK ... | Removes the specified bricks from the specified volume. | |
| gluster volume set VOLNAME <KEY> <VALUE> | Sets the specified option and value for the specified volume. | |
| gluster volume sync HOSTNAME [all| VOLNAME] | Syncs the volume information from a peer. | |
| gluster volume reset VOLNAME [option] [force] | Resets specified or all reconfigured options to its default value. | |
| gluster volume replace-brick VOLNAME (BRICK NEW-BRICK) {start | pause | abort | status} | Replaces the specified brick. | |
| gluster volume replace-brick VOLNAME BRICK NEW-BRICK pause | Starts migration of data from one brick to another. | |
| gluster volume replace-brick VOLNAME BRICK NEW-BRICK pause | Pauses migration of data. | |
| gluster volume replace-brick VOLNAME BRICK NEW-BRICK pause | Aborts migration of data. | |
| gluster volume replace-brick VOLNAME BRICK NEW-BRICK pause | Displays the status of data migration. | |
| gluster volume replace-brick VOLNAME BRICK NEW-BRICK commit | Commits the migration of data from one brick to another . | |
| Profile | ||
| gluster volume profile VOLNAME start | Starts the profiling to view the file operation information for each brick. | |
| gluster volume profile VOLNAME info [nfs] | Displays the I/O information for each brick or NFS servers. | |
| gluster volume profile VOLNAME stop | Stops profiling the specified volume. | |
| Quota | ||
| gluster volume quota VOLNAME enable [path] [value] | Enables quota to set disk limits. | |
| gluster volume quota VOLNAME disable [path] [value] | Disables quota set on the volume. | |
| gluster volume quota VOLNAME limit-usage [path] [value] | Sets the desk limit. | |
| gluster volume quota VOLNAME list [path] [value] | Display disk limit information set on the directories. | |
| gluster volume quota VOLNAME remove [path] [value] | Deletes the quota limit set on the directory. | |
| Status | ||
| gluster volume status [all | VOLNAME [nfs|shd|BRICK>]] [detail|clients|mem|inode|fd|callpool] | Displays status of all or specified volumes or bricks. | |
| gluster volume status all | Displays information about all volumes. | |
| gluster volume status VOLNAME detail | Displays additional information about the bricks. | |
| gluster volume status VOLNAME clients | Displays the list of clients accessing the volumes. | |
| gluster volume status VOLNAME mem | Displays the memory usage and memory pool details of the bricks. | |
| gluster volume status VOLNAME inode | Displays the inode tables of the volume. | |
| gluster volume status VOLNAME fd | Displays the open file descriptor tables of the volume. | |
| gluster volume status VOLNAME callpool | Displays the pending calls of the volume. | |
| Self-Heal | ||
| gluster volume heal VOLNAME [options] | Self-heal commands on specified volume. | |
| gluster volume heal VOLNAME | Triggers self-heal only on the files which requires healing. | |
| gluster volume heal VOLNAME full | Triggers self-heal on all the files of a volume. | |
| gluster volume heal VOLNAME info | Displays the list of files that needs healing. | |
| gluster volume heal VOLNAME info healed | Displays the list of files that are self-healed. | |
| gluster volume heal VOLNAME info heal-failed | Displays the list of files of a particular volume on which the self-heal failed. | |
| Statedump | ||
| gluster volume statedump VOLNAME [nfs] [all|mem|iobuf|callpool|priv|fd|inode|history] | Performs statedump of a volume or NFS server . | |
| gluster volume set VOLNAME server.statedump-path path | Change the directory of the statedump file. | |
| Locks | ||
| gluster volume clear-locks VOLNAME path kind {blocked | granted | all}{inode [range] | entry [basename] | posix [range]} | Clears the locks held on path. | |
| Top | ||
| gluster volume top VOLNAME open [nfs | brick BRICK-NAME] [list-cnt cnt] | Displays open file descriptor count and maximum file descriptor count of the specified brick/NFS server of the volume. | |
| gluster volume top VOLNAME read [nfs | brick BRICK-NAME] [list-cnt cnt] | Displays the list of highest file Read calls of the specified brick/NFS server of the volume. | |
| gluster volume top VOLNAME write [nfs | brick BRICK-NAME] [list-cnt cnt] | Displays the list of highest file Write calls of the specified brick/NFS server of the volume. | |
| gluster volume top VOLNAME opendir [nfs | brick BRICK-NAME] [list-cnt cnt] | Displays the list of open calls on each directory of the specified brick/NFS server of the volume. | |
| gluster volume top VOLNAME readdir [nfs | brick BRICK-NAME] [list-cnt cnt] | Displays the list of highest directory read calls on each brick of the specified brick/NFS server of the volume. | |
| gluster volume top VOLNAME read-perf [bs blk-size count count] [brick BRICK-NAME] [list-cnt cnt] | Displays the list list of read performance on each brick of the specified brick/NFS server of the volume. | |
| gluster volume top VOLNAME write-perf [bs blk-size count count] [nfs | brick BRICK-NAME] [list-cnt cnt] | Displays the list of write performance on each brick of the specified brick/NFS server of the volume. | |
| Rebalance | ||
| gluster volume rebalance VOLNAME [fix-layout] {start|stop|status} [force] | Rebalance Operations | |
| gluster volume rebalance VOLNAME start | Starts rebalancing the specified volume. | |
| gluster volume rebalance VOLNAME stop | Stops rebalancing the specified volume. | |
| gluster volume rebalance VOLNAME status | Displays the rebalance status of the specified volume. | |
| Log | ||
| volume log rotate VOLNAME [BRICK] | Rotates the log file for corresponding volume/brick. | |
| Peer | ||
| peer probe HOSTNAME | Probes the specified peer. | |
| peer detach HOSTNAME | Detaches the specified peer. | |
| peer status | Displays the status of peers. | |
| peer help | Displays help for the peer command. | |
| Geo-replication | ||
| volume geo-replication MASTER SLAVE start |
Start geo-replication between the hosts specified by MASTER and SLAVE. You can specify a local master volume as :VOLNAME.
You can specify a local slave volume as :VOLUME and a local slave directory as /DIRECTORY/SUB-DIRECTORY. You can specify a remote slave volume as DOMAIN::VOLNAME and a remote slave directory as DOMAIN:/DIRECTORY/SUB-DIRECTORY.
| |
| volume geo-replication MASTER SLAVE stop |
Stop geo-replication between the hosts specified by MASTER and SLAVE. You can specify a local master volume as :VOLNAME and a local master directory as /DIRECTORY/SUB-DIRECTORY.
You can specify a local slave volume as :VOLNAME and a local slave directory as /DIRECTORY/SUB-DIRECTORY. You can specify a remote slave volume as DOMAIN::VOLNAME and a remote slave directory as DOMAIN:/DIRECTORY/SUB-DIRECTORY.
| |
| volume geo-replication MASTER SLAVE log-rotate | Rotates the log file of a particular master-slave session. | |
| volume geo-replication MASTER SLAVE config [options] | Configure geo-replication options between the hosts specified by MASTER and SLAVE. | |
| gluster-log-file LOGFILE | The path to the geo-replication glusterfs log file. | |
| gluster-log-level LOGFILELEVEL | The log level for glusterfs processes. | |
| log-file LOGFILE | The path to the geo-replication log file. | |
| log-level LOGFILELEVEL | The log level for geo-replication. | |
| ssh-command COMMAND | The ssh command to use to connect to the remote machine (the default is ssh). | |
| rsync-command COMMAND | The rsync command to use for synchronizing the files (the default is rsync). | |
| volume_id= UID | The command to delete the existing master UID for the intermediate/slave node. | |
| timeout SECONDS | The timeout period. | |
| sync-jobs N | The number of simultaneous files/directories that can be synchronized. | |
| ignore-deletes | If this option is set to 1, a file deleted on master will not trigger a delete operation on the slave. Hence, the slave will remain as a superset of the master and can be used to recover the master in case of crash and/or accidental delete. | |
| checkpoint [LABEL | now] |
Sets the checkpoint with the given option LABEL. If the option is set as now, then the current time will be used as label.
| |
| Other | ||
| help | Display the command options. | |
| quit | Exit the gluster command line interface. | |
| Option | Description |
|---|---|
| Basic | |
| -l=LOGFILE, --log-file=LOGFILE | Files to use for logging (the default is /usr/local/var/log/glusterfs/glusterfs.log). |
| -L=LOGLEVEL, --log-level=LOGLEVEL | Logging severity. Valid options are TRACE, DEBUG, INFO, WARNING, ERROR and CRITICAL (the default is INFO). |
| --debug | Runs the program in debug mode. This option sets --no-daemon, --log-level to DEBUG, and --log-file to console. |
| -N, --no-daemon | Runs the program in the foreground. |
| Miscellaneous | |
| -?, --help | Displays this help. |
| --usage | Displays a short usage message. |
| -V, --version | Prints the program version. |
- Rotating Logs
- Rotate the log file using the following command:
# gluster volume log rotateVOLNAMEFor example, to rotate the log file on test-volume:# gluster volume log rotate test-volume log rotate successful
Note
When a log file is rotated, the contents of the current log file are moved to log-file- name.epoch-time-stamp.
statedump command to list the locks held on files. The statedump output also provides information on each lock with its range, basename, PID of the application holding the lock, and so on. You can analyze the output to know about the locks whose owner/application is no longer running or interested in that lock. After ensuring that no application is using the file, you can clear the lock using the following clear lock command:
# gluster volume clear-locks VOLNAME path kind {blocked | granted | all}{inode [range] | entry [basename] | posix [range]}
statedump, see Section 13.5, “Performing Statedump on a Volume ”
- Perform statedump on the volume to view the files that are locked using the following command:
# gluster volume statedumpVOLNAMEFor example, to display statedump of test-volume:# gluster volume statedump test-volume Volume statedump successful
The statedump files are created on the brick servers in the/tmpdirectory or in the directory set usingserver.statedump-pathvolume option. The naming convention of the dump file is<brick-path>.<brick-pid>.dump. - Clear the entry lock using the following command:
#gluster volume clear-locksVOLNAME pathkind granted entry basenameThe following are the sample contents of the statedump file indicating entry lock (entrylk). Ensure that those are stale locks and no resources own them.[xlator.features.locks.vol-locks.inode] path=/ mandatory=0 entrylk-count=1 lock-dump.domain.domain=vol-replicate-0 xlator.feature.locks.lock-dump.domain.entrylk.entrylk[0](ACTIVE)=type=ENTRYLK_WRLCK on basename=file1, pid = 714782904, owner=ffffff2a3c7f0000, transport=0x20e0670, , granted at Mon Feb 27 16:01:01 2012 conn.2.bound_xl./gfs/brick1.hashsize=14057 conn.2.bound_xl./gfs/brick1.name=/gfs/brick1/inode conn.2.bound_xl./gfs/brick1.lru_limit=16384 conn.2.bound_xl./gfs/brick1.active_size=2 conn.2.bound_xl./gfs/brick1.lru_size=0 conn.2.bound_xl./gfs/brick1.purge_size=0
For example, to clear the entry lock onfile1of test-volume:# gluster volume clear-locks test-volume / kind granted entry file1 Volume clear-locks successful test-volume-locks: entry blocked locks=0 granted locks=1
- Clear the inode lock using the following command:
#gluster volume clear-locksVOLNAME pathkind granted inode rangeThe following are the sample contents of the statedump file indicating there is an inode lock (inodelk). Ensure that those are stale locks and no resources own them.[conn.2.bound_xl./gfs/brick1.active.1] gfid=538a3d4a-01b0-4d03-9dc9-843cd8704d07 nlookup=1 ref=2 ia_type=1 [xlator.features.locks.vol-locks.inode] path=/file1 mandatory=0 inodelk-count=1 lock-dump.domain.domain=vol-replicate-0 inodelk.inodelk[0](ACTIVE)=type=WRITE, whence=0, start=0, len=0, pid = 714787072, owner=00ffff2a3c7f0000, transport=0x20e0670, , granted at Mon Feb 27 16:01:01 2012
For example, to clear the inode lock onfile1of test-volume:# gluster volume clear-locks test-volume /file1 kind granted inode 0,0-0 Volume clear-locks successful test-volume-locks: inode blocked locks=0 granted locks=1
- Clear the granted POSIX lock using the following command:
#gluster volume clear-locksVOLNAME pathkind granted posix rangeThe following are the sample contents of the statedump file indicating there is a granted POSIX lock. Ensure that those are stale locks and no resources own them.xlator.features.locks.vol1-locks.inode] path=/file1 mandatory=0 posixlk-count=15 posixlk.posixlk[0](ACTIVE)=type=WRITE, whence=0, start=8, len=1, pid = 23848, owner=d824f04c60c3c73c, transport=0x120b370, , blocked at Mon Feb 27 16:01:01 2012 , granted at Mon Feb 27 16:01:01 2012 posixlk.posixlk[1](ACTIVE)=type=WRITE, whence=0, start=7, len=1, pid = 1, owner=30404152462d436c-69656e7431, transport=0x11eb4f0, , granted at Mon Feb 27 16:01:01 2012 posixlk.posixlk[2](BLOCKED)=type=WRITE, whence=0, start=8, len=1, pid = 1, owner=30404152462d436c-69656e7431, transport=0x11eb4f0, , blocked at Mon Feb 27 16:01:01 2012 posixlk.posixlk[3](ACTIVE)=type=WRITE, whence=0, start=6, len=1, pid = 12776, owner=a36bb0aea0258969, transport=0x120a4e0, , granted at Mon Feb 27 16:01:01 2012 ...
For example, to clear the granted POSIX lock onfile1of test-volume:# gluster volume clear-locks test-volume /file1 kind granted posix 0,8-1 Volume clear-locks successful test-volume-locks: posix blocked locks=0 granted locks=1 test-volume-locks: posix blocked locks=0 granted locks=1 test-volume-locks: posix blocked locks=0 granted locks=1
- Clear the blocked POSIX lock using the following command:
#gluster volume clear-locksVOLNAME pathkind blocked posix rangeThe following are the sample contents of the statedump file indicating there is a blocked POSIX lock. Ensure that those are stale locks and no resources own them.[xlator.features.locks.vol1-locks.inode] path=/file1 mandatory=0 posixlk-count=30 posixlk.posixlk[0](ACTIVE)=type=WRITE, whence=0, start=0, len=1, pid = 23848, owner=d824f04c60c3c73c, transport=0x120b370, , blocked at Mon Feb 27 16:01:01 2012 , granted at Mon Feb 27 16:01:01 posixlk.posixlk[1](BLOCKED)=type=WRITE, whence=0, start=0, len=1, pid = 1, owner=30404146522d436c-69656e7432, transport=0x1206980, , blocked at Mon Feb 27 16:01:01 2012 posixlk.posixlk[2](BLOCKED)=type=WRITE, whence=0, start=0, len=1, pid = 1, owner=30404146522d436c-69656e7432, transport=0x1206980, , blocked at Mon Feb 27 16:01:01 2012 posixlk.posixlk[3](BLOCKED)=type=WRITE, whence=0, start=0, len=1, pid = 1, owner=30404146522d436c-69656e7432, transport=0x1206980, , blocked at Mon Feb 27 16:01:01 2012 posixlk.posixlk[4](BLOCKED)=type=WRITE, whence=0, start=0, len=1, pid = 1, owner=30404146522d436c-69656e7432, transport=0x1206980, , blocked at Mon Feb 27 16:01:01 2012 ...
For example, to clear the blocked POSIX lock onfile1of test-volume:# gluster volume clear-locks test-volume /file1 kind blocked posix 0,0-1 Volume clear-locks successful test-volume-locks: posix blocked locks=28 granted locks=0 test-volume-locks: posix blocked locks=1 granted locks=0 No locks cleared.
- Clear all POSIX locks using the following command:
#gluster volume clear-locksVOLNAME pathkind all posix rangeThe following are the sample contents of the statedump file indicating there is all POSIX locks. Ensure that those are stale locks and no resources own them.[xlator.features.locks.vol1-locks.inode] path=/file1 mandatory=0 posixlk-count=11 posixlk.posixlk[0](ACTIVE)=type=WRITE, whence=0, start=8, len=1, pid = 12776, owner=a36bb0aea0258969, transport=0x120a4e0, , blocked at Mon Feb 27 16:01:01 2012 , granted at Mon Feb 27 16:01:01 2012 posixlk.posixlk[1](ACTIVE)=type=WRITE, whence=0, start=0, len=1, pid = 12776, owner=a36bb0aea0258969, transport=0x120a4e0, , granted at Mon Feb 27 16:01:01 2012 posixlk.posixlk[2](ACTIVE)=type=WRITE, whence=0, start=7, len=1, pid = 23848, owner=d824f04c60c3c73c, transport=0x120b370, , granted at Mon Feb 27 16:01:01 2012 posixlk.posixlk[3](ACTIVE)=type=WRITE, whence=0, start=6, len=1, pid = 1, owner=30404152462d436c-69656e7431, transport=0x11eb4f0, , granted at Mon Feb 27 16:01:01 2012 posixlk.posixlk[4](BLOCKED)=type=WRITE, whence=0, start=8, len=1, pid = 23848, owner=d824f04c60c3c73c, transport=0x120b370, , blocked at Mon Feb 27 16:01:01 2012 ...
For example, to clear the all POSIX locks onfile1of test-volume:# gluster volume clear-locks test-volume /file1 kind all posix 0,0-1 Volume clear-locks successful test-volume-locks: posix blocked locks=1 granted locks=0 No locks cleared. test-volume-locks: posix blocked locks=4 granted locks=1
| Revision History | |||
|---|---|---|---|
| Revision 1-65.400 | 2013-10-31 | ||
| |||
| Revision 1-65 | Thu May 30 2013 | ||
| |||
| Revision 1-64 | Wed Apr 17 2013 | ||
| |||
| Revision 1-61 | Tue Apr 2 2013 | ||
| |||
| Revision 1-59 | Thu Mar 28 2013 | ||
| |||
| Revision 1-58 | Tue Mar 26 2013 | ||
| |||
| Revision 1-56 | Thu Mar 21 2013 | ||
| |||
| Revision 1-55 | Tue Mar 19 2013 | ||
| |||
| Revision 1-52 | Wed Mar 13 2013 | ||
| |||
| Revision 1-46 | Fri Mar 01 2013 | ||
| |||
| Revision 1-45 | Sat Feb 23 2013 | ||
| |||
| Revision 1-44 | Wed Feb 13 2013 | ||
| |||
| Revision 1-42 | Fri Jan 11 2013 | ||
| |||
| Revision 1-41 | Thu Jan 03 2013 | ||
| |||
| Revision 1-40 | Wed Dec 12 2012 | ||
| |||
| Revision 1-39 | Wed Dec 05 2012 | ||
| |||
| Revision 1-38 | Mon Dec 03 2012 | ||
| |||
| Revision 1-36 | Thu Nov 22 2012 | ||
| |||
| Revision 1-35 | Mon Nov 12 2012 | ||
| |||
| Revision 1-34 | Tue Nov 06 2012 | ||
| |||
| Revision 1-33 | Wed Oct 17 2012 | ||
| |||
| Revision 1-31 | Mon Oct 08 2012 | ||
| |||
| Revision 1-30 | Wed Oct 03 2012 | ||
| |||
| Revision 1-29 | Mon Sep 24 2012 | ||
| |||
| Revision 1-28 | Fri Sep 14 2012 | ||
| |||
| Revision 1-27 | Wed Sep 12 2012 | ||
| |||
| Revision 1-26 | Tue Sep 04 2012 | ||
| |||
| Revision 1-25 | Fri Aug 24 2012 | ||
| |||
| Revision 1-4 | Mon Aug 06 2012 | ||
| |||
| Revision 1-3 | Mon Jul 23 2012 | ||
| |||
| Revision 1-2 | Tue Jul 17 2012 | ||
| |||
| Revision 1-1 | Tue Jun 26 2012 | ||
| |||
| Revision 1-0 | Tue Jun 05 2012 | ||
| |||













