Distributed Storage Guide

    Deploying MooseFS on RamNode VPS

    MooseFS is a fault-tolerant, highly available, POSIX-compliant distributed file system designed for petabyte-scale storage. This guide provides comprehensive instructions for deploying MooseFS on RamNode VPS infrastructure, enabling scalable, reliable storage solutions for enterprise and development environments.

    Ubuntu 20.04+
    MooseFS 3.x
    ⏱️ 30-45 minutes

    Architecture Overview

    MooseFS provides enterprise-grade distributed storage with these core components:

    Master Server (mfsmaster)

    Central metadata server managing file system structure and chunk locations

    Chunkserver (mfschunkserver)

    Storage nodes that store actual file data in fixed-size chunks

    Client (mfsmount)

    FUSE-based client providing POSIX filesystem interface

    CGI Monitor

    Web-based monitoring interface for cluster management

    System Requirements & Prerequisites

    Before starting, ensure you have the appropriate server specifications:

    ComponentMinimum SpecsRecommended
    Master Server2 vCPU, 2GB RAM, 20GB SSD4 vCPU, 8GB RAM, 100GB NVMe
    Chunkserver2 vCPU, 4GB RAM, 100GB Storage4 vCPU, 8GB RAM, 1TB+ Storage
    Client1 vCPU, 1GB RAM, 10GB Storage2 vCPU, 4GB RAM, 20GB Storage

    Operating System

    • • Ubuntu 20.04/22.04 LTS (Recommended)
    • • CentOS/Rocky Linux 8+
    • • Root access to all instances

    Development Tools

    Install on all nodes:

    • • Build-essential / Development Tools
    • • FUSE3 support
    • • pkg-config and zlib
    Ubuntu/Debian - Install Prerequisites
    sudo apt update && sudo apt upgrade -y
    sudo apt install -y build-essential pkg-config zlib1g-dev
    sudo apt install -y libfuse-dev fuse3
    CentOS/Rocky Linux - Install Prerequisites
    sudo yum update -y
    sudo yum groupinstall -y 'Development Tools'
    sudo yum install -y fuse-devel fuse3-devel zlib-devel
    Create MooseFS User (All Nodes)
    sudo useradd -r -s /bin/false mfs
    sudo mkdir -p /var/lib/mfs
    sudo chown mfs:mfs /var/lib/mfs
    2

    Network Configuration

    Important: Ensure all MooseFS nodes can communicate on required ports before proceeding with installation.

    Required Ports

    • 9419 - Master server communication (TCP)
    • 9420 - Chunkserver communication (TCP)
    • 9425 - CGI monitoring interface (TCP)
    Ubuntu UFW Configuration
    sudo ufw allow 9419/tcp
    sudo ufw allow 9420/tcp
    sudo ufw allow 9425/tcp
    sudo ufw reload
    3

    Installation Methods

    Using official MooseFS repositories provides the most stable installation with automatic dependency resolution.

    Ubuntu/Debian Repository Setup

    Add MooseFS Repository (Ubuntu/Debian)
    # Add MooseFS repository key
    wget -O - https://ppa.moosefs.com/moosefs.key | sudo apt-key add -
    
    # Add repository
    echo 'deb http://ppa.moosefs.com/moosefs-3/apt/ubuntu/focal focal main' | sudo tee /etc/apt/sources.list.d/moosefs.list
    sudo apt update

    CentOS/Rocky Linux Repository Setup

    Add MooseFS Repository (CentOS/Rocky)
    # Create repository file
    sudo tee /etc/yum.repos.d/MooseFS.repo << 'EOF'
    [MooseFS]
    name=MooseFS
    baseurl=http://ppa.moosefs.com/moosefs-3/yum/el$releasever/$basearch/
    gpgcheck=1
    enabled=1
    gpgkey=http://ppa.moosefs.com/moosefs.key
    EOF
    4

    Master Server Installation

    The master server is the central metadata coordinator for your MooseFS cluster. Install and configure it first before setting up chunkservers.

    Install Master Server (Ubuntu/Debian)
    sudo apt install -y moosefs-master moosefs-cgi moosefs-cgiserv moosefs-cli
    Install Master Server (CentOS/Rocky)
    sudo yum install -y moosefs-master moosefs-cgi moosefs-cgiserv moosefs-cli

    Initial Configuration

    Copy Default Configuration Files
    # Copy default configuration files
    sudo cp /etc/mfs/mfsmaster.cfg.sample /etc/mfs/mfsmaster.cfg
    sudo cp /etc/mfs/mfsexports.cfg.sample /etc/mfs/mfsexports.cfg
    
    # Create initial metadata file
    sudo cp /var/lib/mfs/metadata.mfs.empty /var/lib/mfs/metadata.mfs
    
    # Set proper ownership
    sudo chown -R mfs:mfs /var/lib/mfs
    sudo chown -R mfs:mfs /etc/mfs

    Master Server Configuration

    /etc/mfs/mfsmaster.cfg - Key Parameters
    # Basic Settings
    WORKING_USER = mfs
    WORKING_GROUP = mfs
    SYSLOG_IDENT = mfsmaster
    LOCK_MEMORY = 0
    
    # Network Settings
    MATOCL_LISTEN_HOST = *
    MATOCL_LISTEN_PORT = 9421
    MATOSC_LISTEN_HOST = *
    MATOSC_LISTEN_PORT = 9420
    
    # Performance Settings
    CHUNKS_LOOP_MAX_CPS = 100000
    CHUNKS_LOOP_MIN_TIME = 300
    ACCEPTABLE_DIFFERENCE = 0.1

    Export Configuration

    /etc/mfs/mfsexports.cfg - Client Access
    # Allow all operations from any IP
    * / rw,alldirs,maproot=0
    
    # Restrict access to specific network
    192.168.1.0/24 / rw,alldirs,maproot=0
    Start Master Server
    sudo systemctl enable mfsmaster
    sudo systemctl start mfsmaster
    sudo systemctl status mfsmaster
    5

    Chunkserver Installation

    Chunkservers provide the actual storage capacity for your MooseFS cluster. Deploy multiple chunkservers for redundancy and increased storage capacity.

    Install Chunkserver (Ubuntu/Debian)
    sudo apt install -y moosefs-chunkserver moosefs-cli
    Install Chunkserver (CentOS/Rocky)
    sudo yum install -y moosefs-chunkserver moosefs-cli

    Storage Preparation

    Create Storage Directories
    sudo mkdir -p /mnt/mfschunks
    sudo chown mfs:mfs /mnt/mfschunks

    Production Tip: Mount dedicated storage volumes to /mnt/mfschunks for optimal performance and data isolation.

    Chunkserver Configuration

    Copy and Configure
    sudo cp /etc/mfs/mfschunkserver.cfg.sample /etc/mfs/mfschunkserver.cfg
    sudo cp /etc/mfs/mfshdd.cfg.sample /etc/mfs/mfshdd.cfg
    /etc/mfs/mfschunkserver.cfg - Key Parameters
    # Basic Settings
    WORKING_USER = mfs
    WORKING_GROUP = mfs
    SYSLOG_IDENT = mfschunkserver
    
    # Master server connection
    MASTER_HOST = MASTER_SERVER_IP
    MASTER_PORT = 9420
    
    # Network Settings
    CSSERV_LISTEN_HOST = *
    CSSERV_LISTEN_PORT = 9422
    /etc/mfs/mfshdd.cfg - Storage Paths
    # Add storage path
    /mnt/mfschunks
    Start Chunkserver
    sudo systemctl enable mfschunkserver
    sudo systemctl start mfschunkserver
    sudo systemctl status mfschunkserver
    6

    Client Installation & Mounting

    Install Client (Ubuntu/Debian)
    sudo apt install -y moosefs-client
    Install Client (CentOS/Rocky)
    sudo yum install -y moosefs-client

    Mount Configuration

    Mount MooseFS Filesystem
    # Create mount point
    sudo mkdir /mnt/mfs
    
    # Mount the filesystem
    sudo mfsmount /mnt/mfs -H MASTER_SERVER_IP
    
    # Configure automatic mounting (add to /etc/fstab)
    # mfsmount /mnt/mfs fuse defaults,mfsmaster=MASTER_SERVER_IP 0 0
    7

    Monitoring & Management

    CGI Web Interface

    Enable the web-based monitoring interface on the master server:

    Enable CGI Monitor
    sudo systemctl enable moosefs-cgiserv
    sudo systemctl start moosefs-cgiserv

    🌐 Access the web interface at: http://MASTER_SERVER_IP:9425

    Command Line Tools

    Essential MooseFS CLI commands for management:

    MooseFS Management Commands
    # Check cluster status
    mfsgetgoal /mnt/mfs
    
    # Set replication goal
    mfssetgoal 2 /mnt/mfs/important_data
    
    # Check chunk information
    mfsfileinfo /mnt/mfs/file.txt
    
    # Directory statistics
    mfsdirinfo /mnt/mfs
    8

    Performance Optimization

    Network Optimization

    • • Use private networking between MooseFS nodes
    • • Enable jumbo frames (MTU 9000) for improved throughput
    • • Configure network bonding for redundancy

    Storage Optimization

    • • Use SSD storage for master server metadata
    • • Distribute chunkservers across multiple zones
    • • Use dedicated storage volumes
    9

    Security Configuration

    Network Security

    • • Restrict access to MooseFS ports using firewall rules
    • • Use VPN or private networks for cluster communication
    • • Configure SSL/TLS encryption for web interface

    Access Control Example

    /etc/mfs/mfsexports.cfg - Secure Configuration
    # Secure export configuration
    192.168.1.0/24 / rw,maproot=nobody:nogroup
    192.168.1.100 /secure ro,maproot=root
    10

    Troubleshooting

    Common Issues

    • Connection Refused: Check firewall rules and master server status
    • Mount Failed: Verify FUSE modules are loaded and user permissions
    • Chunkserver Disconnected: Check network connectivity and storage availability

    Log Analysis

    View MooseFS Logs
    # Master server logs
    sudo journalctl -u mfsmaster -f
    
    # Chunkserver logs
    sudo journalctl -u mfschunkserver -f
    
    # System logs
    tail -f /var/log/syslog | grep mfs

    Ready to Deploy MooseFS?

    Get started with RamNode's reliable VPS infrastructure for your distributed storage cluster.