Skip to main content

Setup Apache Zookeeper Cluster in Amazon Cloud ( AWS ) or Google Cloud

Environment : Amazon AWS , Red Hat linux VM with 1 CPU 1 GB RAM
ZOOKEEPER Version : 3.4.11

Step 1 : Download your Apache Zookeeper from one of the mirrors available in official ZOOKEEPER SITE 

Step 2 : Copy the downloaded ( zookeeper-3.4.11.tar.gz ) file to the AWS / Google cloud servers using SCP/Winscp

         ( Example: scp -i "XXXXXX.pem" zookeeper-3.4.11.tar.gz  ec2-user@ec2-xx-xx-xx-xx.us-east-2.compute.amazonaws.com:/home/ec2-user/. )

Step 3 : Or download the zookeeper directly on the servers using one of the available mirrors using WGET
       
         ( Example : sudo wget "http://mirror.cogentco.com/pub/apache/zookeeper/ " -O  zoo.tar.gz )


Step 4 : Untar the zookeeper & create 'myid' file in the data directory which contains just zookeeper id ( example : 1 )

Step 5 : Need to create zoo.cfg file from zoo_sample.cfg and modify the following things

Step 6 : Add / modify following properties. Please mention your zookeeper port by default ( 2181 ) using clientPort attribute

Then add your cluster information if you plan to have 3 cluster servers add like below. All the servers info mention like below they communicate using internal IP repeat the same configuration for different servers but for if your adding this config change for server.1 make the internal ip as 0.0.0.0

           clientPort=2181
           server.1=0.0.0.0:2888:3888
           server.2=:2888:3888
           server.3=:2888:3888

These settings are for internal zookeeper communication who ever starts first will be the Leader in the cluster and rest are followers they will just sync up the data.

Whenever Leader fails one of the follower will become the leader

Step 7 : To start the zookeeper servers use following command in each server
./zookeeper-3.4.11/bin/zkServer.sh start 

Step 8 : To check the status ./zookeeper-3.4.11/bin/zkServer.sh status . It will give information about whether the server is Leader or Follower

Important : Enable the TCP:2181 outbound ports on the cloud servers

I had setup the zookeeper cluster in AWS and Google Cloud. If you find any difficulties in setting please comment i will help you with issues

Comments

Popular posts from this blog

Create or Customize Master Page in sharepoint

Before using the base master page,please fimiliare yourself with various sections of the base master page code · Required Components · Optional Components · Hidden Components Required Components: If no availability of required components sharepoint page cannot render properly All the components are placed in a their corresponding content place holder asp:ContentPlaceHolder id=”PlaceHolderMain” runat=”server” /> This content placeholder corresponds to the content area in page layouts.It is required for the MOSS site to render properly. All the required which are not usefull should be placed .If you delete those place holders sharepoint page cannot render properly Following are the some of the required components asp:ContentPlaceHolder id=”PlaceHolderMain” runat=”server” /> asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server"> asp:ContentPlaceHolder id="PlaceHolderTopNavBar...

Using Friendly URLs(SEO) in Joomla

In folder apacheconf open file httpd.conf #LoadModule rewrite_module modules/mod_rewrite.so and make it as uncommented LoadModule rewrite_module modules/mod_rewrite.so In site root folder there is rename htaccess.txt to .htaccess and now open .htaccess and go to following line # RewriteBase / and uncomment this line as following and mention root for ex. testsite in following line RewriteBase /testsite Go in administrator panel and click on Global coniguration Here on right side we get SEO Settings all three SEO Settings set as yes and click on save

Randomly Displaying a Single SharePoint Item on Refresh

This is how: 1. Create a new Data View web part in SharePoint Designer that displays all records in the format you want. We will end up only showing one record, so keep that in mind when you are laying this out. 2. Open the Filter dialog 3. Do not add any clauses, instead check the Add XSLT Filtering box and click Edit 4. Create your XSLT filter. You can just paste in the following code: [position() = (substring(ddwrt:FormatDateTime(ddwrt:TodayIso(),1033,":mm:ss"),6,2) mod count(/dsQueryResponse/Rows/Row))+1] 5. Click Ok and save the page in SharePoint Designer 6. Check your work in your browser. Refresh the page to see the item rotate.