Amazon EC 2 Cloud Deployment Guide



Similar documents
Moving Drupal to the Cloud: A step-by-step guide and reference document for hosting a Drupal web site on Amazon Web Services

1. Configuring Apache2 Load Balancer with failover mechanism

Infor Web UI High Availability Deployment

SpagoBI Tomcat Clustering Using mod_jk and httpd on Centos - In-Memory Session Replication.

Zend Server Amazon AMI Quick Start Guide

Amazon Elastic Beanstalk

Using The Hortonworks Virtual Sandbox

Single Node Hadoop Cluster Setup

STREAMEZZO RICH MEDIA SERVER

Dataworks System Services Guide

Cloud.com CloudStack Community Edition 2.1 Beta Installation Guide

USER CONFERENCE 2011 SAN FRANCISCO APRIL Running MarkLogic in the Cloud DEVELOPER LOUNGE LAB

Online Backup Guide for the Amazon Cloud: How to Setup your Online Backup Service using Vembu StoreGrid Backup Virtual Appliance on the Amazon Cloud

Install guide for Websphere 7.0

Amazon Web Services EC2 & S3

Eucalyptus User Console Guide

Alfresco Enterprise on AWS: Reference Architecture

INSTALLING KAAZING WEBSOCKET GATEWAY - HTML5 EDITION ON AN AMAZON EC2 CLOUD SERVER

AdWhirl Open Source Server Setup Instructions

LAMP Quickstart for Red Hat Enterprise Linux 4

Getting Started with Amazon EC2 Management in Eclipse

Hadoop Installation MapReduce Examples Jake Karnes

Getting Started with Oracle Data Mining on the Cloud

Rally Installation Guide

MATLAB Distributed Computing Server Cloud Center User s Guide

DEPLOYMENT GUIDE Version 1.1. Deploying F5 with Oracle Application Server 10g

CloudPortal Business Manager 2.2 POC Cookbook

Contents Set up Cassandra Cluster using Datastax Community Edition on Amazon EC2 Installing OpsCenter on Amazon AMI References Contact

System Administration Training Guide. S100 Installation and Site Management

Running multiple Tomcat versions on the same host

EQUELLA. Clustering Configuration Guide. Version 6.0

Silk Central Installation Help

Implementing Microsoft Windows Server Failover Clustering (WSFC) and SQL Server 2012 AlwaysOn Availability Groups in the AWS Cloud

Source Code Management for Continuous Integration and Deployment. Version 1.0 DO NOT DISTRIBUTE

Apache and Tomcat Clustering Configuration Table of Contents

Comsol Multiphysics. Running COMSOL on the Amazon Cloud. VERSION 4.3a

Syncplicity On-Premise Storage Connector

Local Caching Servers (LCS): User Manual

Deploy XenApp 7.5 and 7.6 and XenDesktop 7.5 and 7.6 with Amazon VPC

An Oracle White Paper July Oracle VM 3: Building a Demo Environment using Oracle VM VirtualBox

ActiveVOS Clustering with JBoss

ArcGIS 10.3 Server on Amazon Web Services

CycleServer Grid Engine Support Install Guide. version 1.25

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Publishing to a Remote Server

Networking Configurations for NetApp Cloud ONTAP TM for AWS

DVS-100 Installation Guide

Immersion Day. Creating an Elastic Load Balancer. Rev

SOA Software API Gateway Appliance 7.1.x Administration Guide

How To Install An Aneka Cloud On A Windows 7 Computer (For Free)

Integrating Apache Web Server with Tomcat Application Server

Creating a DUO MFA Service in AWS

CA Workload Automation DE

DVS-100 Installation Guide

Installation Guide for WebSphere Application Server (WAS) and its Fix Packs on AIX V5.3L

Kony MobileFabric. Sync Windows Installation Manual - WebSphere. On-Premises. Release 6.5. Document Relevance and Accuracy

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

Web Application Firewall

Deploying the BIG-IP System v10 with Oracle Application Server 10g R2

How to Install SMTPSwith Mailer on Centos Server/VPS

White Paper. Fabasoft on Linux - Preparation Guide for Community ENTerprise Operating System. Fabasoft Folio 2015 Update Rollup 2

How To Image A Single Vm For Forensic Analysis On Vmwarehouse.Com

Deploying a Virtual Machine (Instance) using a Template via CloudStack UI in v4.5.x (procedure valid until Oct 2015)

McAfee SMC Installation Guide 5.7. Security Management Center

VMTurbo Operations Manager 4.5 Installing and Updating Operations Manager

RapidSeed for Replicating Systems Version 7.4

Intellicus Cluster and Load Balancing- Linux. Version: 7.3

Building a Private Cloud Cloud Infrastructure Using Opensource

The steps will take about 4 hours to fully execute, with only about 60 minutes of user intervention. Each of the steps is discussed below.

Intro to Load-Balancing Tomcat with httpd and mod_jk

Chapter 9 PUBLIC CLOUD LABORATORY. Sucha Smanchat, PhD. Faculty of Information Technology. King Mongkut s University of Technology North Bangkok

Cloud Homework instructions for AWS default instance (Red Hat based)

This How To guide will take you through configuring Network Load Balancing and deploying MOSS 2007 in SharePoint Farm.

Using VirtualBox ACHOTL1 Virtual Machines

Configuring multiple Tomcat instances with a single Apache Load Balancer

Backup and Restore of SAP Systems on Amazon Web Services Infrastructure

Guide to the LBaaS plugin ver for Fuel

FILECLOUD HIGH AVAILABILITY

How To Set Up An Intellicus Cluster Server On Ubuntu (Amd64) With A Powerup.Org (Amd86) And Powerup (Amd76) (Amd85) (Powerup) (Net

Intellicus Web-based Reporting Suite

Using Symantec NetBackup with Symantec Security Information Manager 4.5

OpenDaylight & PacketFence install guide. for PacketFence version 4.5.0

CASHNet Secure File Transfer Instructions

Load Balancing Microsoft Sharepoint 2010 Load Balancing Microsoft Sharepoint Deployment Guide

MySQL and Virtualization Guide

KeyControl Installation on Amazon Web Services

DS License Server V6R2013x

Getting Started with AWS. Computing Basics for Linux

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Setting Up B2B Data Exchange for High Availability in an Active/Active Configuration

Comsol Multiphysics. Running COMSOL on the Amazon Cloud. VERSION 4.3b

User Manual. Onsight Management Suite Version 5.1. Another Innovation by Librestream

VX 9000E WiNG Express Manager INSTALLATION GUIDE

Load Balancing Microsoft AD FS. Deployment Guide

Installing Virtual Coordinator (VC) in Linux Systems that use RPM (Red Hat, Fedora, CentOS) Document # 15807A1-103 Date: Aug 06, 2012

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

Easy Setup Guide 1&1 CLOUD SERVER. Creating Backups. for Linux

Managing Your Microsoft Windows Server Fleet with AWS Directory Service. May 2015

ZeroTurnaround License Server User Manual 1.4.0

Deploying Virtual Cyberoam Appliance in the Amazon Cloud Version 10

Transcription:

Documentation Amazon EC 2 Cloud Deployment Guide Jahia delivers the first Web Content Integration Software by combining Enterprise Web Content Management with Document and Portal Management features. Jahia September 2009 9 route des Jeunes, CH-1227 Les acacias Geneva, Switzerland www.jahia.com The Company website www.jahia.org The Community website

Summary 1 Overview...4 1.1 Introduction...4 1.2 What s in this documentation?...4 2 Introduction...5 3 Architecture...6 3.1 Single-node...6 3.2 Cluster...7 4 Pre-requisites...9 5 Setup...10 5.1 Using Jahia on Amazon EC2...10 5.1.1 Browser warning...10 5.1.2 Steps...10 5.2 Creating your own custom AMI...22 6 Cluster setup...24 6.1 Pre-requisites for cluster setup...24 6.2 First node setup...24 6.2.1 Steps...24 6.3 Dynamically adding a node...26 6.3.1 Steps...26 6.4 Load-balancer setup...28 7 Restarting a cluster...30 7.1 Basic startup for all nodes...30 7.1.1 Steps...30 7.2 For the database node...30 7.2.1 Steps...30 7.3 For the indexing node...30 7.3.1 Steps...30 7.4 For authoring nodes...31 7.4.1 Steps...31 7.5 For all Jahia nodes...31 7.5.1 Steps...31 Page 2 of 34

7.6 For the load-balancer node...31 7.6.1 Steps...31 8 FAQ...32 8.1 Can we use the Amazon load balancer instead of the Apache mod_jk load-balancing technique?...32 8.2 Can t we use Elastic IPs for the cluster nodes to find each other?...32 8.3 Can I use UDP multi-casting to setup the cluster?...32 9 Resources...33 Page 3 of 34

1 Overview 1.1 Introduction Jahia delivers the first Web Content Integration software by combining Enterprise Web Content Management with Document Management and Portal features. By leveraging state of the art Open Source frameworks and libraries, Jahia offers a complete solution for developing, integrating, delivering, and managing content across intranets, extranets, and internets with a much lower total cost of ownership than proprietary systems. 1.2 What s in this documentation? This document is intended to give an overview of the configuration and deployment of Jahia Enterprise Edition v6 on the Amazon EC 2 Cloud Platform. It is intended for system administrators and advanced users. Should you have questions, please do not hesitate to contact us as mentioned on our website (http://www.jahia.com) or Community website (http://www.jahia.org). Page 4 of 34

2 Introduction The Amazon EC 2 platform is a cloud computing deployment platform that allows customers to deploy applications to servers that can be dynamically scaled. What this means is that the number of servers, computing power, RAM & disk space can be adjusted to handle varying loads of traffic. The pricing reflects also this dynamic nature, and is based on a «you pay for what you use» paradigm. Amazon EC 2 servers are called «instances», which are booted from an Amazon Machine Image file, which is similar in behavior to a boot ROM. Upon startup, virtual memory disks are also created, and this is the basis of the work environment. Any operating system may be loaded, including Linux, OpenSolaris and Windows. The main drawback of such an install is that as everything is executed in memory, including disk storage, you loose all data when the instance is terminate. In order to allow for persistant storage, Amazon provides Elastic Bloc Storage volumes, that can be seen as virtual hard disks that you can attach to an instance. Amazon charges for EBS storage by amount of space used per month, but the costs are minimal. Unfortunately, possibly due to the youth of the Amazon platform, it is not possible, or at least not easy to attach an EBS volume to an instance at boot time, so this means that some manual operations are required on each instance creation. There are some tools to help automate this process such as CloudTools (http://code.google.com/p/cloudtools/) or even companies helping with the whole process of managing your Amazon cloud such as RightScale (http://www.rightscale.com/index.php). In this document, we will present a way of deploying Jahia into the Amazon EC 2 cloud platform, without any requirements for external tools, but of course it might be interesting to look into automation of the processes, especially if they will be performed frequently. Page 5 of 34

3 Architecture In this section we will look at the deployment architecture for a Jahia installation on the Amazon EC 2 cloud. 3.1 Single-node The single-node install is quite simple, although quite relevant to understand the specificities of deploying on the EC 2 cloud. As there is no persistent storage possible in an instance, we much attach an EBS volume to store the persistent data, such as the database and the file system data that Jahia uses. Actually, in this deployment, we will install the whole Jahia directly on the EBS volume, since it makes for a simpler deployment and re-use of the configuration when starting additional nodes. As illustrated above, the single-node setup consists of an AMI Instance containing a MySQL server running, but instead of storing it s data directly in the instance, which would imply we would loose all of the data upon termination of the instance, the data itself is stored in an EBS volume. The Jahia software is itself entirely stored on the EBS volume, mostly because it is simple to do so, but also because, as we will see in the cluster setup procedure, it makes it much easier to create new nodes. Page 6 of 34

3.2 Cluster The cluster architecture can vary from relatively simple to quite large and complex. We will at first present an architecture that will help minimize costs by combining services on a smaller amount of nodes, but of course it is possible to use nodes (or Amazon Instances, we use both terms interchangeably) for single tasks, making the architecture cleaner and possibly more reliable. If we expand on the single-node architecture and bring in a second node, this is what it will look like: The first node is exactly the same as in the single-node architecture diagram, except that we have now exported the EBS volume file system using NFS, and have the second node mounting that file system as a NFS disk. We also have the second node talking to the first node s database using JDBC, a configuration that is quite straight-forward in Java installations. On the second node, Jahia is configured to use the file system resources of the NFS disk at it s mount point, effectively sharing the resources with the first node. This is done for sharing the Apache Lucene indexes. There is also a TCP or UDP connection configured between the nodes to handle cache invalidation messages, that are required when setting up Jahia in a cluster deployment. In classic Jahia cluster architecture, you can think of the first node as the processing and indexing node, and the second node as an authoring node. In a cluster environment, the entering point for the Jahia servers will always be a front-end Apache server that uses the mod_jk module to balance the loads to the various Jahia servers. Page 7 of 34

It is therefore to imagine using separate instances for separate workflows, such as the MySQL server, the Apache load balancer and the Jahia nodes, as illustrated in the example below: It is not the goal of this section, nor even this document, to go into all the possibilities of deployment that may be done with such a powerful cloud platform as is Amazon EC 2, but it is very easy to imagine different deployment scenarios: MySQL master-slave replication for high-tolerant database setups, adapting the number of instances and their types for various peak loads, etc Page 8 of 34

4 Pre-requisites Although we will guide you through the steps to configure and deploy Jahia on the Amazon EC 2 cloud platform, we strongly recommend that you become familiar with the platform before following this guide, notably by reading the documentation available, especially the following guide: http://docs.amazonwebservices.com/awsec2/latest/gettingstartedguide/ We also assume that you are administering the platform from a UNIX platform such as Linux or MacOS X. For Windows users, you can gain similar functionality from either custom tools (such as the Putty SSH client, available at http://www.chiark.greenend.org.uk/~sgtatham/putty/). This document is aimed at users familiar with system administration on UNIX platforms. Apart from the above guide, we don t assume any prior knowledge of the Amazon EC 2 platform. Page 9 of 34

5 Setup 5.1 Using Jahia on Amazon EC2 5.1.1 Browser warning The Safari browser doesn't work well with Amazon Web Console, you should use Firefox or Internet Explorer. 5.1.2 Steps 1. Create Amazon Web Services Account at http://aws.amazon.com, and make sure you retrieve all the necessary credential files, especially your certificates and private keys. We will assume you have everything installed in a ~./ec2 directory. 2. Log into the Amazon EC 2 console (http://aws.amazon.com/console/ ) 3. Choose your region in the drop-down Region. In this documentation we will be using the EU region. The default US region is a little simpler to use. 4. Create an instance, we recommend you use RightScale Centos Images, use 32-bit or 64-bit as you prefer. 64-bit AMIs will give you more options to upscale. In this example below you could use the 32-bit ami- 19be966d or the 64-bit ami-03be9677 AMIs. Page 10 of 34

5. If you don t have a key pair yet, click on Create next to the Key Pair Name line Enter a name for the key pair, and make sure you download the key pair file and put it in your ~/.ec2 directory and perform the command chmod 400 on it to make sure only the owner can read the file (for Windows users, just ignore this step). Page 11 of 34

6. Back to the instance wizard, if you don t have one yet, create a security group that opens the port TCP 22 (ssh) to the whole world. We will then later extend this group to open ports TCP 80 and TCP 8080 to the world. 7. Wait for the instance to start, once it is started, by selecting it you can get information such as these: Note the public DNS and private DNS entries; they are both important in this installation, because they will allow us to setup communication to the server for administration, and also communication between the servers for cluster setup. Also write down the Zone, which looks something like this: Page 12 of 34

This is very important when we will be creating EBS volumes. 8. In the Security Groups section, select your new security group, and add the ports 80 and 8080 open to the entire world (0.0.0.0/0). Your group should now look like this: 9. Connect to your instance using SSH (select the instance and click on Connect to get help on how to connect). You should be able to connect with something like: ssh -i KEYPAIR_FILENAME.pem root@ec2-79-125-38-107.eu-west-1.compute.amazonaws.com Once logged on, your screen should look something like this: Page 13 of 34

10. Install MySQL using the command: yum install mysql-server 11. Edit the /etc/my.cnf file to look like this: 12. Start the MySQL server once it has been installed with the following command: service mysqld start in case you have trouble with the above command, you can manually initialize the database using the command: mysql_install_db and then try to start the service again. Page 14 of 34

13. You can test that the database was properly installed by using the following command: mysql This will connect to the default database and allow you to input SQL commands on the database. To quit type: \q 14. We will now create an EBS volume, that we will attach to the current instance, in the Amazon Web Console, click into Volumes in the Elastic Block Store navigation section, then click Create Volume. Note: it is important that you check you are always in the same zone, otherwise you will not be able to attach your volume to your instance! In the example below, we made sure the zone matched the one we got in step 7 For the size of the volume, it is up to you; make it large if you know your system will grow quickly. You could enlarge it later by using snapshots. 15. Wait a little until the volume is created (use the Refresh button to check the status). 16. Select the volume once it is marked available and click on the Attach volume button. You should see the following screen. If you cannot select your previously created instance, it s probably because your zone is not correct for your volume, so delete and create another one. You can leave all the defaults here and click Attach. Page 15 of 34

17. We now have an EBS volume attach to our instance, and available in /dev/sdf. Note that it is unformatted and not mounted, we must therefore do this ourself. Use the following command to format the volume: mkfs.ext3 /dev/sdf Your screen will look something like this: 18. Create the mount point for the new drive: mkdir /vol 19. Edit the /etc/fstab file to add the following line (for example using the command vi /etc/fstab): /dev/sdf /vol ext3 defaults 0 0 The contents of the /etc/fstab file at this point should like this: Page 16 of 34

20. Execute the command: mount a and then check that the disk is properly mounted using the command: mount You screen should look like this: 21. Now we must shutdown the MySQL server to perform the storage modifications so that it can store it s data on the EBS volume we have just mounted. We do so with the command: service mysqld stop 22. Now let s move all the data from the instance storage (non-persistant) to the EBS volume: mkdir /vol/lib mv /var/lib/mysql /vol/lib/ 23. We will now create the mount point at the old location: mkdir /var/lib/mysql Page 17 of 34

24. Finally we update the /etc/fstab file to add the new mount point: echo "/vol/lib/mysql /var/lib/mysql none bind" tee -a /etc/fstab Your /etc/fstab file should now like this: 25. You can now mount the new binding by using the command: mount /var/lib/mysql 26. Start the MySQL server again: service mysqld start and check that everything is ok: mysql to quit the MySQL console use again \q Page 18 of 34

27. We will now need to know the internal IP address of our instance (it changes each time an instance is created) by using the command: ifconfig The output will look something like this: We want the IP address for eth0, so in this case it is 10.226.135.96. Note that this is the internal IP address, the server has another IP address for access from the outside world. 28. We will now update the /etc/hosts file with the IP address we have found, to something like this : 127.0.0.1 localhost localhost.localdomain 10.226.135.96 jahiaserver1 dbserver The reason we do this is that we will then configure Jahia to use the jahiaserver1 and dbserver host names instead of IP addresses so that we can quickly create instances and simply update the /etc/hosts file instead of having to configure the whole Jahia installation all over. 29. We are now ready to setup Jahia on the instance, storing it completely in the EBS volume. We choose to store it completely in an EBS volume because it will make adding new cluster nodes much simpler. So we will first use wget to retrieve a Jahia package, with the following command performed from your desktop: scp -i KEYPAIR_FILENAME.pem PATH_TO_JAHIADOWNLOAD/Jahia_EE_v6_r27015.tar.gz root@ec2-79- 125-38-107.eu-west-1.compute.amazonaws.com:/vol Page 19 of 34

30. Uncompress the Jahia package into the /vol/jahia_ee_v6_r27015 directory: cd /vol tar xvfz../jahia_ee_v6_r27015.tar.gz 31. Before starting Jahia, let s editing the /vol/jahia_ee_v6_r27015/bin/catalina.sh script file to modify the following line from: CATALINA_OPTS="$CATALINA_OPTS -Xms1024m -Xmx1024m -Djava.awt.headless=true - XX:MaxPermSize=128m -server -Dhibernate.jdbc.use_streams_for_binary=true -verbose:gc" to CATALINA_OPTS="$CATALINA_OPTS -Xms1024m -Xmx1024m -Djava.net.preferIPv4Stack=true - Djava.awt.headless=true -XX:MaxPermSize=128m -server -Dhibernate.jdbc.use_streams_for_binary=true - verbose:gc" (the preferipv4stack is there to avoid some communication problems with the JGroups clustering library when used on machines that are configured for both IPv4 and IPv6 networking) 32. We now need to create the MySQL database and the corresponding user with the proper rights. To create the database, we use the command: mysqladmin create jahia To create the user we use the following commands: mysql jahia mysql> GRANT ALL ON *.* TO 'jahia'@'%' IDENTIFIED BY 'jahia'; \q 33. We can now start Jahia with the following commands: cd /vol/jahia_ee_v6_r27015/bin./startup.sh You can watch the logs with the following command : tail -f /vol/jahia_ee_v6_r27015/logs/catalina.out (Use CTRL+C to exit log watch) 34. You should be able to connect to Jahia from your desktop. Open a browser to the following URL: http://ec2-79-125-38-107.eu-west-1.compute.amazonaws.com:8080/config Page 20 of 34

35. When you get to the database setup, click on Advanced settings, select the MySQL database, and modify the URL to point to the dbserver hostname we have previously setup. The URL should now look like this: 36. Complete the installation wizard, creating a site, and publish the complete site. 37. Congratulations you have now successfully completed the installation of Jahia on an Amazon EC 2 instance! Please note that it is highly recommended that you continue to the next section Creating your own custom AMI to learn to save all the work you have accomplished in order to be able to more quickly create new instances. Page 21 of 34

5.2 Creating your own custom AMI Once you have setup your basic system, it is very useful to save the instance as a custom AMI, so that you can quickly create new instances with the same configuration, and therefore avoid reproducing all the tedious setup steps we have performed in the previous sections. Of course we will have to update some configuration and working around the problem that an EBS volume cannot be attached at instance startup, but it will make things a lot easier. 1. Install EC2 tools on your desktop computer as documented in the following guide http://docs.amazonwebservices.com/awsec2/latest/gettingstartedguide/ (In the section Getting started with the command line tools ) 2. Setup all the environment variables as described in the guide 3. From your desktop: copy the certificate and private key files to the server, in the /mnt directory: scp -i KEYPAIR_FILENAME.pem pk-long_identifier.pem cert- LONG_IDENTIFIER.pem root@public_dns_address:/mnt 4. On the instance: for 32-bit instances: ec2-bundle-vol -d /mnt -k /mnt/pk-long_identifier.pem -c /mnt/cert- LONG_IDENTIFIER.pem -u ACCOUNT_ID -r i386 -p CUSTOM_AMI_NAME or for 64-bit : ec2-bundle-vol -d /mnt -k /mnt/pk-long_identifier.pem -c /mnt/cert-long_identifier.pem -u ACCOUNT_ID -r x86_64 -p CUSTOM_AMI_NAME where ACCOUNT_ID is your AWS Account number WITHOUT the dashes, so XXXX-XXXX-XXXX becomes XXXXXXXXXXXX and CUSTOM_AMI_NAME is a name you choose for the AMI when it will be uploaded to Amazon S3 cloud storage. You can find your account number for example on the Account Activity report page, in the upper right corner, as illustrated below: Page 22 of 34

5. Still on the instance: ec2-upload-bundle -b MY_BUNDLE_IDENTIFIER -m /mnt/custom_ami_name.manifest.xml -a ACCESS_KEY_ID -s SECRET_ACCESS_KEY --location EU 6. On your desktop: ec2-register MY_BUNDLE_IDENTIFIER/CUSTOM_AMI_NAME.manifest.xml You have now successfully created a custom AMI that will contain the entire configuration you have done on the instance, that you will be able to quickly update and re-use when creating new instances. You could also look into creating multiple AMIs depending on their responsibility: Jahia node, database node, load-balancer node. The AMIs are stored in the Amazon S3 storage cloud which is relatively inexpensive, so you don t need to shy away from creating multiple AMIs. The main drawback is that there is no good way to name or describe an AMI at the time of this writing, so we must rely on filenames to explain the contents of an AMI which is quite limited. Also note that we have not configured any services to start upon instance creation, this is because the MySQL database, and later the NFS sharing daemon need to be able to access an EBS volume, that cannot be attached at startup. With sophisticated scripts it might be possible to work around this limitation but for the clarity purposes we will keep things manual in this document. Page 23 of 34

6 Cluster setup In order to add cluster nodes we will have to perform the following grand steps: Modify our single-node installation to work in cluster mode Export the disk where the Lucene search index is stored via NFS Create the next node and configure it 6.1 Pre-requisites for cluster setup We are assuming that users are already familiar with setting up Jahia in a cluster environment. If you are not, we recommend you read the Configuration and Fine Tuning Guide available on the customer extranet. We also assume you have completed the installation in the previous chapters of this guide. 6.2 First node setup We will now setup the first node, which will also behave as MySQL server, processing and indexing server. 6.2.1 Steps 1. If you have any instances running (such as the one started in the previous chapter), we will assume you will have stopped them, so that the volume is free to be used by the new instances. 2. Start an instance using your new custom AMI created in the last section. 3. Attach the EBS volume you had created using the Amazon EC 2 Console 4. Mount the volume using the command: mount a 5. Verify that the disks are properly mounted with the command: mount 6. Start the MySQL service using the command: service mysqld start 7. On the first node, we will setup an NFS export for the search indexes. To do this we will modify the /etc/exports file to look like this: You might need to adjust the IP address range allowed, because it seems that Amazon can use different classes (on some occasions we ve received addresses in the 10.227.0.0/255.255.0.0 range. Page 24 of 34

8. Start the NFS service with the following commands: service portmap start service nfs start 9. Modify the /etc/hosts file to update the IP addresses of all the nodes you have setup in step 1. It is ok if you don t have all the IP addresses yet, just put any address except for other nodes address temporarily. But all the hostnames that are configured in the jahia.properties file should be also in the /etc/hosts file, otherwise the server will not start properly. So you re /etc/hosts file could look like this: 10. Follow all the steps in the Cluster setup section of the Configuration and Fine Tuning Guide, but instead of IP addresses, use hostnames such as jahiaserver1, jahiaserver2, etc This is made possible because of the definitions we will insert in the /etc/hosts file on each instance. 11. You should now be able to start your first Jahia cluster node using the following command: cd /vol/jahia_ee_v6_r27015/bin./startup.sh You can monitor the logs with the command : tail f../logs/catalina.out 12. That s it for the first node. Page 25 of 34

6.3 Dynamically adding a node We will now document the setup of the second node, which is also similar for more nodes that can be added while the first node is running. 6.3.1 Steps 1. Create a new EBS volume 2. Attach the new volume to the existing first node. You will have to attach it to /dev/sdg because /dev/sdf is already used by the first EBS volume. 3. Format the new EBS volume on the authoring node with the following command: mkfs.ext3 /dev/sdg Make sure you are careful not to format the first volume but the newly created one. You screen should look like this: 4. Mount the new volume into /vol2 using the commands: mkdir /vol2 ; mount /dev/sdg /vol2 5. Copy the jahia install to the new volume, by doing: cd /vol cp -rf Jahia_EE_v6_r27015 /vol2 Page 26 of 34

6. Unmount the volume: umount /vol2 7. Detach the volume from the existing instance in the Amazon EC 2 Web console 8. Create a new instance and use SSH log in to it. 9. Attach the second EBS volume to the new instance, create the /vol directory and modify the /etc/fstab file to setup the mount point and mount it using the command on the new instance: mount a 10. Update the /etc/hosts file on all instances to add a jahiaserver that will point to the new instance s internal IP address, and don t forget to update the IP addresses for jahiaserver1 on the new node. 11. Update the configuration on the new instance in the following files: /vol/jahia_ee_v6_r27015/webapps/root/web-inf/etc/repository/jackrabbit/repository.xml (change the cluster id), the /vol/jahia_ee_v6_r27015/webapps/root/web-inf/etc/config/jahia.properties file (change the localip, cluster.node.serverid, processingserver=false, modify the EHCache settings to point to the cluster configuration files and all the cluster.tcp or cluster.udp variables) and the /vol/jahia_ee_v6_r27015/webapps/root/web-inf/etc/spring/applicationcontext-indexingpolicy.xml file (change localindexing to 0, change searchindexerserverid to the server cluster ID you have chosen and change searchindexrootdir to /nfs/search_indexes). 12. Start the NFS service using the commands: service portmap start service nfs start 13. Mount the search indexes on the new instance using the commands: mkdir -p /nfs/search_indexes mount jahiaserver1:/vol/jahia_ee_v6_r27015/webapps/root/web-inf/var/search_indexes /nfs/search_indexes (if you get timeout errors, try launching it multiple times) 14. Start the second Jahia node using the commands: cd /vol/jahia_ee_v6_r27015/bin./startup.sh You can monitor logs with the command : tail f../logs/catalina.out Page 27 of 34

6.4 Load-balancer setup The following steps must be performed on the instance that will be used to load-balance to the others: 1. Download and install the Apache 2 HTTP server using the command: yum install httpd 2. Install the mod_jk Tomcat connector module with the following commands: cd /etc/httpd/modules wget http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/linux/jk-1.2.28/x86_64/mod_jk- 1.2.28-httpd-2.2.X.so ln -s mod_jk-1.2.28-httpd-2.2.x.so mod_jk.so 3. Create a file worker.properties in /etc/http/conf with the following content: # Define 3 workers, 2 real workers using ajp13, the last one being a loadbalancing worker worker.list=worker1, worker2, worker3, jkstatus # Set properties for worker1 (ajp13) worker.worker1.type=ajp13 worker.worker1.host=jahiaserver1 worker.worker1.port=8009 worker.worker1.lbfactor=1 # Set properties for worker2 (ajp13) worker.worker2.type=ajp13 worker.worker2.host=jahiaserver2 worker.worker2.port=8009 worker.worker2.lbfactor=1 worker.worker2.connection_pool_timeout=600 worker.worker2.socket_keepalive=1 worker.worker2.socket_timeout=60 # Set properties for worker3 (lb) which use worker1 and worker2 worker.worker3.balance_workers=worker1,worker2 # Define a 'jkstatus' worker using status worker.jkstatus.type=status 4. Create a new file called /etc/http/conf.d/jk.conf with the content: Load mod_jk module # Update this path to match your modules location LoadModule jk_module modules/mod_jk.so # Where to find workers.properties # Update this path to match your conf directory location (put workers.properties next to httpd.conf) JkWorkersFile /etc/httpd/conf/workers.properties # Where to put jk shared memory # Update this path to match your local state directory or logs directory JkShmFile /var/log/httpd/mod_jk.shm # Where to put jk logs # Update this path to match your logs directory location (put mod_jk.log next to access_log) JkLogFile /var/log/httpd/mod_jk.log # Set the jk log level [debug/error/info] Page 28 of 34

JkLogLevel info # Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " # Activate the jkmanager mount if you want to be able to view mod_jk status. A better way of doing this would be to control access to it. # JkMount /jkmanager/* jkstatus JkMount /* worker3 5. On each Jahia server, you must modify the file /vol/jahia_ee_v6_r27015/conf/server.xml and add the jvmroute attribute like in the following example: <Engine name="catalina" defaulthost="localhost" jvmroute="jahiaserver1"> 6. Start the Apache 2 service using the command: service httpd start You should now be able to connect to port 80 (default HTTP port) on the external IP of the instance running the Apache server and you should see your Jahia home page. Page 29 of 34

7 Restarting a cluster In this procedure we will assume that you have already setup at least two EBS volume, one containing the database and shared Apache Lucene indexes as well as a first Jahia installation that acts as processing and indexing server, and a second EBS volume that contains only an authoring node. We will also assume that you will be using the custom AMI you have created in this procedure. This procedure is generic and can be extended to many more nodes than the default two, provided you have an EBS volume available for each node. 7.1 Basic startup for all nodes 7.1.1 Steps 1. Create a new instance 2. Attach a volume to the instance 3. Log into the instance with SSH 4. Mount the volume 5. Update /etc/hosts to point to all new IP addresses 7.2 For the database node 7.2.1 Steps 1. Start the database with the command: service mysql start 2. Verify that you can connect to the database properly: mysql --user=jahia --pass=jahia jahia \q 7.3 For the indexing node 7.3.1 Steps 1. Update the /etc/exportfs file to make sure that the allow IP classes are correct for the new IP addresses 2. Start the NFS sharing service: service portmap start service nfs start Page 30 of 34

7.4 For authoring nodes 7.4.1 Steps 1. Mount the shared indexes with the commands: mkdir -p /nfs/shared_indexes mount jahiaserver1:/vol/jahia_ee_v6_r27015/webapps/root/web-inf/var/search_indexes /nfs/search_indexes 7.5 For all Jahia nodes 7.5.1 Steps 1. Start Jahia with the commands: cd /vol/jahia_ee_v6_r27015/bin./startup.sh 2. (Optional) You can monitor the logs with the command: tail -f /vol/jahia_ee_v6_r27015/logs/catalina.out 7.6 For the load-balancer node 7.6.1 Steps 1. If you have created an AMI for the load-balancer setup, you can create an instance using that configuration, otherwise you will have to re-run the steps in the load-balancer setup section 2. That s it, your cluster is back up and running! Page 31 of 34