• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Scalable WordPress on HP Cloud With GlusterFS & Nginx

By Abhishek Ghosh May 10, 2015 6:09 am Updated on May 10, 2015

Scalable WordPress on HP Cloud With GlusterFS & Nginx

Advertisement

Here are the Steps For Building Scalable WordPress on HP Cloud With GlusterFS and Nginx. With OpenStack Nova We Can Just Do it From Desktop. Previously, we wrote about GlusterFS. You possibly love to read Distributed Replicated Block Device. These are the theoretical part. This scalable WordPress instance will have MariaDB (a MySQL fork) database server, GlusterFS distributed filesystem, Nginx or Nginx Plus web servers. We can use Nginx as load balancer too But we can use the load balancer of HP Cloud as good alternative. In the fronted, Akamai DNS (via HP Cloud) will highly cache most commonly visited webpages plus decrease the chance of DDoS. There are different type of scaling – vertical and horizontal are the commonest types.

 

Scalable WordPress on HP Cloud With GlusterFS & Nginx

 

If you are new to HP Cloud and / or OpenStack, you can read how to install WordPress on HP Cloud. With OpenStack Python Client Commands, frankly we can build the instances from command line from Desktop, without opening the Web GUI on browser. If you are not easy with the Python clients, then use the Web GUI. We are starting after setting the Router, Ingress and Egress policy rightly. Instances are running Ubuntu 14.04 LTS.

 

Steps For Creating Scalable WordPress on HP Cloud With GlusterFS & Nginx

 

We can make the MariaDB to replicate on two server instances as well. This is called MySQL Cluster Replication and you will get reference on official MySQL website. InnoDB Storage Engine is commonly used by both Rackspace and us. We use MySQL tuner of Major Hayden to optimize the configuration and setup. What we are doing is known as “MySQL Master-Master Replication”. This is kind of an example blueprint :

Advertisement

---

Scalable WordPress on HP Cloud With GlusterFS & Nginx

Vim
1
2
3
4
apt update -y && apt upgrade
dpkg-reconfigure locales
# en_GB, UTF-8
apt-get install mariadb-server mariadb-client

Edit /etc/my.cnf file :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
bind-address = 0.0.0.0
server-id = <any number>
log-bin = /var/log/mysql/var/bin.log
log-slave-updates
log-bin-index = /var/log/mysql/log-bin.index
log-error = /var/log/mysql/error.log
relay-log = /var/log/mysql/relay.log
relay-log-info-file = /var/log/mysql/relay-log.info
relay-log-index = /var/log/mysql/relay-log.index
auto_increment_increment = 10
auto_increment_offset = 1
master-host = <subnet mask>
master-user = <username>
master-password = <password>
 
replicate-do-db = <database name to be replicated>

You will do the same on another server. You need to run this format of comand on each server :

Vim
1
2
3
4
# mysql -u root -h localhost -p
grant replication slave on *.* to slave@'<subnet mask>' identified by '<password>';
flush privileges;
exit;

We can add both of these database IP on WordPress using HyperDB Plugin from WordPress later. There is software named “Tungsten Replicator” in case you want to do more than the above. Restart the service on both servers, create a database for WordPress :

Vim
1
2
3
CREATE DATABASE wordpress;
mysql -uroot -p<mysql_password> -e "CREATE USER 'wordpress_user'@'%' IDENTIFIED BY '<mysql_password>'";
mysql -uroot -p<mysql_password> -e "GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'%'";

Check the replication and troubleshoot it if needed.

For creation of web server, we can use multiple web servers – 4 or more. We need to configure them in this way. First /etc/hosts should be rightly configured, like we need this entry for proper setup from DNS –

Vim
1
2
15.16.17.18 server.example.com gluster1
# 15.16.17.19 server1.example.com gluster2

Vim
1
2
3
4
5
6
7
8
9
10
11
12
apt update -y && apt upgrade
apt-get install -y python-software-properties
add-apt-repository -y ppa:gluster/glusterfs-3.5
apt update -y && apt-get install -y glusterfs-server
# check the command rightly
gluster peer probe gluster1
gluster peer status
# check the mounting
mkdir -p /mnt/gluster
# create another server named gluster2
gluster  volume create datapoint replica 2 transport tcp  gluster1:/mnt/gluster  gluster2:/mnt/gluster force
gluster volume start datapoint

Then we will proceed to install Nginx-PHP5 FPM :

Vim
1
2
3
4
5
6
7
8
apt-get update
apt-get -y install nginx glusterfs-client php5-fpm php5-mysql
# CGI path fix
# sed -i s/\;cgi\.fix_pathinfo\=1/cgi\.fix_pathinfo\=0/g /etc/php5/fpm/php.ini
mkdir -p /mnt/gluster
# example
mount -t glusterfs gluter_node_subnet_mask_ip:/file_store mnt/gluster;
echo "gluter_node_subnet_mask_ip:/file_store mnt/gluster glusterfs defaults,_netdev 0 0" >> /etc/fstab

We will install WordPress on mnt/gluster/www, right? You can change the path name.

Vim
1
mkdir mnt/gluster/www

Settings of nginx default will go like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /gluster/www;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                
        }
 
 
}

We are using unix socket for PHP5-fpm. TCP will be slower but easy to configure. We need a clean server running Nginx in front because we can add these on /etc/nginx/sites-available/default :

Vim
1
2
3
4
5
upstream backend  {
    ip_hash;
    server node_1_subnet_ip
    server node_2_subnet_ip
}

This one’s IP will go to DNS. If you are new, it will take a bit time to getting a fully working setup within half an hour. One server, two server configuration can be guided easily. For multiple servers, it becomes a bit difficult to guide step by step. Making the concept clear is most important point. We can create HA cluster with Heartbeat Pacemaker.

Tagged With nginx in front of gluster

This Article Has Been Shared 544 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Scalable WordPress on HP Cloud With GlusterFS & Nginx

  • Cloud Computing 3D Rendering And Scope In Film Industry

    Cloud Computing 3D Rendering Has Definite Scope in Film Industry which might alarm the Stars of tomorrow and relieve the Producers investing in the Films.

  • How Cloud Computing Challenge The Networks

    How Cloud Computing Challenge Networks with virtually unlimited storage and computing capacity, reduced cost and maximum flexibility and massive data traffic.

  • PubSubHubbub and Rackspace Cloud Queue

    PubSubHubbub is a networking protocol. Rackspace is Open Source but infamous for difficult to understand API documentation by normal human.

  • How to Upload Backup to Dropbox from Cloud Server

    Here is How to Upload Backup to Dropbox from Cloud Server in Case You Want To Keep Your Backup of Files and Database on a Free Cloud Storage.

  • Install Nginx PHP5-FPM on HP Cloud

    Here is How To Install Nginx PHP5-FPM on HP Cloud. HP Cloud means HP Helion Public Cloud. It is basically very easy to work with HP Cloud. People fear HP Helion Public Cloud very much. The basic reason possibly is not understanding the basics of Security Group Rules. So, you need to read our previous […]

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023
  • What is COB LED? How LED Chip On Board Works January 20, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Scalable WordPress on HP Cloud With GlusterFS & Nginx," in The Customize Windows, May 10, 2015, January 27, 2023, https://thecustomizewindows.com/2015/05/scalable-wordpress-on-hp-cloud-with-glusterfs-nginx/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT