Using two ODROID HC2’s to create a small NAS with GLUSTERFS for PLEX server

My Mac Mini acting as a PLEX server was from late 2009 and had began stuttering when playing some recent high quality rips or transcoding.

It was time to upgrade.

Luckily I had an old i7-4790K processor laying around. I bought a case from amazon, and sourced a cheap 1150 motherboard locally. I also already had a 250gb SSD I wasn’t using. All I needed was some ram and I was in business.

I also wanted some form of storage and had heard about the ODroid HC2. I picked up the following gear from their site which came surprisingsly fast via DHL (a few days).

Then, from Amazon I picked up everything else.

Once I had everything wired up, and running I booted to the default OS using the DHCP addresses they got. Then I changed the IP to something static DHCP on my dhcp server, then added DNS through PFsense so my shared drives would be resolvable by name. Shit’s gettin’ real now dawg.

Then, I performed the following steps to get everything going.

  1. Install Arch Linux on Plex Server and configure (this would be a separate howto entirely). Install Plex Server or PlexPass Server.
  2. Plug your Odroids in, and get them on the network.
  3. SSH to both Odroids and then issue these commends on each one.
    # passwd
    # sudo apt-get install glusterfs-server
    # sudo service glusterfs-server start
    # sudo service glusterfs-server status
    # sudo apt-get install xfsprogs
    # gdisk /dev/sda
    
    p
    d
    n
    <enter><enter><enter><enter>
    w
    y
    
    # sudo mkfs.xfs /dev/sda1
    # sudo mkdir /data
    # sudo mount /dev/sda1 /data/
    # df -T
    # blkid /dev/sda1
    
    UUID=1234abc
  4. Now you’ll want to run the following differently on each odroid.
    droid1:
    echo "UUID=1234abc /data xfs defaults 1 1" | sudo tee --append /etc/fstab
    
    droid2:
    echo "UUID=5678xyz /data xfs defaults 1 1" | sudo tee --append /etc/fstab
  5. Then run these commands on both odroids
    # mount -a 
    # df -T
    # sudo mkdir -p /data/vol0
  6. Now run this on just one of the Odroids. Logically, I chose to do it on odroid1. Where mylocal.lan is my domain I use on pfsense.
    # sudo gluster peer probe droid2.mylocal.lan 
    # sudo gluster peer probe droid1.mylocal.lan
    # sudo gluster volume create vol0 replica 2 transport tcp droid1.mylocal.lan:/data/vol0 droid2.mylocal.lan:/data/vol0
    # sudo gluster volume info vol0
    # sudo gluster volume start vol0
  7. Then on your PLEX server, run these commands to mount up your gluster network, and auto mount it.
    # sudo mkdir -p /mnt/gluster 
    # sudo mount -t glusterfs -o acl droid1.mylocal.lan:/vol0 /mnt/gluster
    # df -hP /mnt/gluster
    # cat /proc/mounts
    # echo "droid1.mylocal.lan:/vol0 /mnt/gluster glusterfs defaults,_netdev,noauto,x-systemd.automount 0 0" | sudo tee --append /etc/fstab
  8. Now add some files to your gluster drive on the plex server. Then take a look at both your odroids. You should see the file exists in /data/vol0 as well on each of them. Congratulations you now have a replicating filesystem spread out over your two Odroids and used by Plex for storage.
  9. Now you should reboot all three devices to make sure everything comes up on a reboot, and that everything still functions. If it doesn’t check your logs and repeat anything above.

Here she is in all it’s glory on my Lack-Rack (heh).

 

No comment yet, add your voice below!


Add a Comment

Your email address will not be published. Required fields are marked *

Comment *
Name *
Email *
Website