Creating a scalable apache dataservice

The goal of this document is to create a scalable apache dataservice on an existing, non clustered apache installation

we assume that the config files are in /etc/apache, and the apache binaries and utilities in /usr/apache/bin


cd /etc/apache
cp httpd.conf-example httpd.conf
modify httpd.conf to fit needs.


We assume that at this time, you have apache working properly on both nodes, and the web server data mounted/available on both nodes.

First, register the Resource Type : 

# clresourcetype register SUNW.apache 

Create the resource group for apache : ( we will have 2 RG : one containing the shared address, that will run on one node only, one containing the apache resource, which will run on all the nodes )

# clresourcegroup create apache-rg 

Create the shared address resource ( public hostname will be apache-ip-1) :

# clressharedaddress create -g apache-rg -h apache-ip-1 apache-sh-rs 

Create the apache-scal-rg, that will run on both nodes.

# clresourcegroup create -p Maximum_primaries=2 -p Desired_primaries=2 -p RG_dependencies=apache-rg  apache-scal-rg 

Create the scalable apache resource :

# clresource create -g apache-scal-rg -t SUNW.apache -p Bin_dir=/usr/apache/bin  -p Network_resources_used=apache-sh-rs \\
-p port_list=80/tcp -p Scalable=True -p Load_balancing_policy=LB_WEIGHTED apache-scal-rs



# clresourcegroup manage  apache-rg 
# clresourcegroup manage apache-scal-rg
 
# clresourcegroup online apache-rg 

 

Then you can change the load balancing property, for example to change the weight of a node :


# clrs set -p Load_balancing_weights=1@1,3@2 apache-scal-rs

 

 

You can now points your browser to the public ip address ( apache-ip-1's ip)

you'll see messages like :

 
Apr  7 19:18:55 v4u-4800e-dombc-sin06 cl_runtime: NOTICE: Load balancer setting distribution on apache-scal-rs:
Apr  7 19:18:55 v4u-4800e-dombc-sin06 cl_runtime: NOTICE: Node v4u-4800e-doma-sin06: weight 1
Apr  7 19:18:55 v4u-4800e-dombc-sin06 cl_runtime: NOTICE: Node v4u-4800e-dombc-sin06: weight 3

 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Jean-Christophe Lamoure

Search

Archives
« May 2015
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today