Scaling OwnCloud with Red Hat Storage


Owncloud-logo

Its impossible to be involved in technology these days without knowing what happened in the US with the PRISM program of illegally aquiring private information of people on an international scale.

As a result, this has somewhat changed the game and has made businesses start to re-evaluate their stance on putting personal and company data online with 3rd party cloud providers. This has resulted in projects like OwnCloud and Pydio to pop up and get quite a lot of backing as it gives you cloud-like functionality that remains 100% within your control.

If you aren’t familiar with OwnCloud or Pydio, they are open source alternatives to 3rd party proprietary solutions like Dropbox and Box.net.

Last week I was sent a link to an article about using OwnCloud as an alternative to the likes of Dropbox and box.net. The article also touched on a very common question I ask in everything I do.

“How do I make this highly scalable?” 

You can find the original article here if you would like to have a read though.

Overview

You might be wondering why I have a title about Red Hat Storage and all I am talking about so far is OwnCloud. I’ll explain a little as we move on so sit back, fasten your seatbelt and see for yourself how this might benefit you and your organisation.

Red Hat Storage has hit the market and also in a sense changed how people perceive storage. Up until recently, “Enterprise Storage” has always been seen as hugely expensive, complex and in many cased far over the top for many organisations for their use case. With Red Hat Storage, like virtualization, businesses can now take their requirements for growth and transform new or existing x86 based hardware into very scalable products. With Red Hat Storage, this now means for many organisations, they need to ask the question “Do I actually need a storage array for this?”

In this article I will be using OwnCloud and Red Hat Storage Server to demonstrate how to deploy a web application stack that is capable of scaling out to meet growing business requirements. This solution will give us high availability across all aspects of the platform whilst not having to go out and spend big on large scale storage arrays.

Note: This method is not limited to OwnCloud and can be used for any web site or web application you require.


Below you will find a visual representation of what we are about to set up.

RHSS Web stack

This solution includes the below kit list of servers

  • 3 x Red Hat Storage Servers with a 100G replicated volume (Gluster)
  • 2 x Front end Load Balancers using the Red Hat Load Balancer add-on (LVS)
  • 3 x Red Hat Enterprise Linux MariaDB servers using Galera
  • 3 x Red Hat Enterprise Linux Apache web servers to host OwnCloud

I will be using the below names and IP addresses for this platform.

Red Hat Storage:

rhs01.example.com     = 10.0.2.1
rhs02.example.com     = 10.0.2.2
rhs03.example.com     = 10.0.2.3

Load Balancers: 

lb01.example.com       = 10.0.1.1
lb02.example.com       = 10.0.1.2
Virtual IP's           = 10.0.1.10,10.0.1.20

MariaDB Galera Cluster: 

galera01.example.com  = 10.0.1.21
galera02.example.com  = 10.0.1.22
galera03.example.com  = 10.0.1.23

Apache Web farm:

web01.example.com     = (Front end) 10.0.1.11 , (Back end) 10.0.2.11
web02.example.com     = (Front end) 10.0.1.12 , (Back end) 10.0.2.12
web03.example.com     = (Front end) 10.0.1.13 , (Back end) 10.0.2.13

DNS Records: 

VIP’s:

owncloud.example.com  = 10.0.1.10
galera.example.com    = 10.0.1.20

Hosts:

All servers should have both forward and reverse lookup records in existing DNS infrastructure.


As this solution is a mix of several technologies, I’ll be addressing them in the below order.

  1. Replicated storage using Red Hat Storage Server
  2. Load Balancing with Red Hat Load Balancing Add-On (LVS)
  3. MariaDB multi-master clustering with Galera
  4. OwnCloud setup with Apache

12 comments on “Scaling OwnCloud with Red Hat Storage

  1. Jan Dam November 26, 2013 14:39

    Thanks for this excellent article!

  2. Patrick November 27, 2013 17:19

    Dale: thanks for this great article. The BZ you mentioned got “CLOSED NEXTRELEASE ” ages ago which suggests that the fix could be part of the latest selinux-policy by now. Yet no “Fixed in version” is mentioned while Miroslav usually adds the selinux-policy release in which it is fixed. Puzzling.

  3. Patrick November 27, 2013 17:27

    It seems the selinux-policy in RHEL6.4 has a fix:
    $ getsebool -a | grep httpd_use_fusefs
    httpd_use_fusefs –> off

    So it should be just a matter of:
    $ sudo setsebool -P httpd_use_fusefs on
    to give Apache the ability to use GlusterFS storage.

    • Dale Macartney November 27, 2013 21:41

      Thanks Patrick, I was hoping for some good news like that.

      I’ve just updated the article to reflect the changes.

  4. tquang April 24, 2014 19:12

    After configurated KeepAlived and started it, I no see listen port (3306) on both servers:

    [root@lb1 ~]# netstat -natp
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1033/sshd
    tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1109/master
    tcp 0 0 192.168.56.103:22 192.168.56.1:54793 ESTABLISHED 1201/sshd
    tcp 0 0 :::22 :::* LISTEN 1033/sshd
    tcp 0 0 ::1:25 :::* LISTEN 1109/master

  5. hoangvu August 8, 2014 18:15

    Thank for article!
    But in my system build, owncloud website is very slow.
    I find that gluster processes in rhs and web servers use high CPU when
    load website (about 75-90%).

    • hoangvu August 8, 2014 18:42

      Oh, after use NFS instead Gluster to mount Gluster volum in web servers, everything is ok!

  6. luli June 2, 2015 13:04

    Create tutorial,
    l am trying to implement this topology, but l am facing a problem, and also have one question
    should l need to install owncloud in all 3 server ( apache web farm ), so can then replicate eachothers ?

  7. theluli August 2, 2015 15:01

    Hi Dale
    You got nice tutorial,
    l tried your things but l am facing one problem , since l am using only to apache web server with owncloud , should owncloud be installed in 2 servers ? .
    Even that l have install , am unable to work with 2 server is same time as fail-over , or load balancing
    Can you please advise me on this matter

  8. Stéphane January 20, 2016 09:00

    Great, great article Dale !
    My system works fine …

  9. theluli February 13, 2016 14:17

    Very nice article , but need so much servers
    Since l am just training for this kind of things, l have one question
    My setup is with 2 load-balancer with haproxy , and 2 web-server , setup if working very fine , but how l can get of use https instead of http

    Please help me in this matter
    Thanks again for nice tutorial

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>