Wednesday, 29 June 2016

Install OpsCenter & Configuring to existing Datastax Cassandra Cluster

 Follow the steps to install OpsCenter 
 
Step 1: Add Datastax repository file
            sudo echo "deb https://login_email_Address:login_Password.datastax.com/enterprise stable main" | sudo tee -a /etc/apt/sources.list.d/ datastax.sources.list
 
Step 2: Add the Datastax repository key
            sudo curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -
 
Step 3: Install the package
            sudo apt-get update
            sudo apt-get install opscenter


Step 4: Start Opscenter
            sudo service opscenterd start


Step 5: Browse Opscenter using below url
            http://hostaddress:8888/
 
 
Follow the step to  Configuring OpsCenter to existing Datastax Cassandra Cluster.

Step 1: Update address.yaml located in your Cassandra cluster nodes.

             sudo echo "stomp_interface: <reachable_opscenterd_ip>" | sudo tee -a /var/lib/datastax-agent/conf/address.yaml

             sudo echo "use_ssl: 1" | sudo tee -a /var/lib/datastax-agent/conf/address.yaml


Step 2: Start DataStax 

             sudo service datastax-agent start

Upgrading to Datastax Cassandra 5.0



Follow the instructions to upgrade  DataStax Enterprise  from 4.8 to 5.0 version. First take the backup of cassandra.yaml and dse.yam.Dont forget to signup in Datastax acadamey , which we will need during the installation process 


Step 1: Run nodetool drain to flush the commit log of the old installation.
            sudo nodetool -h hostname drain

Step 2: Stop node services
            sudo service dse stop
            sudo service datastax-agent stop

Step 3: Make sure you have latest java is installed (1.8.0_40 minimum) or install it
            sudo java -version

Step 4: Add Datastax repository file
            sudo echo "deb https://login_email_Address:login_Password.datastax.com/enterprise stable main" | sudo tee -a /etc/apt/sources.list.d/ datastax.sources.list

Step 5: Add the Datastax repository key
            sudo curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -

Step 6: Install the package
            sudo apt-get update
            sudo apt-get install dse-full

Step 7: Configure the new version using backup configuration file we already taken.

Step 8: Start Node service
            sudo service dse start
            sudo service datastax-agent start

Step 9: Upgrade the SSTables
             sudo nodetool upgradesstables

Step 10: Check Node status
              sudo nodetool status

Datastax Cassandra Cluster implementation in Dedian


Lets check how to setup Cassandra clustering in 3 Debian nodes. I am using Cluserssh tool to connect to all nodes at the same time.First create an login account in Datastax acadamey , which we will need during the installation process 

Step 1: Connect to all 3 nodes using clusterssh
            sudo cssh -l username node1ip node2ip node3ip

Step 2: Make sure java is installed or install it
            sudo java -version

Step 3: Add Datastax repository file
            sudo echo "deb https://login_email_Address:login_Password.datastax.com/enterprise stable main" | sudo tee -a /etc/apt/sources.list.d/ datastax.sources.list

Step 4: Add the Datastax repository key
            sudo curl -L https://debian.datastax.com/debian/repo_key | sudo apt-key add -

Step 5: Install the package
            sudo apt-get update
            sudo apt-get install dse-full

Step 6: Stop DSE service
            sudo service dse stop

Step 7: Delete all files from cassandra data directory for a fresh cluster
            default data directory is : /var/lib/cassandra/

Step 8: Change the following in each cassandra.yaml file
            default file path of cassandra.yaml is  /etc/dse/cassandra/cassandra.yaml


            cluster_name : [some_cluster_name]
            listen_address : [ip of each machine] (use :r !hostname -I to update every machine at a time if you are using cluster ssh)
            rpc_address : [ip of each machine] (use :r !hostname -I to update every machine at a time if you are using cluster ssh)
            seeds : [comma separated ips for identifying clusters. any two or three. Do not include all ips] 

Step 9: Run DSE service
            sudo service dse start

Step 10: Make sure that everything is running fine by checking the log
              sudo tail -f -n 1000 /var/log/cassandra/system.log

              Check cluster status
             sudo nodetool status

Tuesday, 31 May 2016

Amazon EC2(Elastic Cloud Compute)

Amazon EC2(Elastic Cloud Compute)
==========================

Amazon provide resizable elastic cloud compute capacity in cloud.Where users can create an instance,which they can resize with their business model requirment.Amazon provide preconfigured amazon machine image template which you can find from following link provided.

https://aws.amazon.com/marketplace/ref=mkt_ste_amis_redirect?b_k=291

Amazon Machine Image (AMI) is a pre-configured operating system image that is used to create an EC2 instance within the Amazon cloud environment.

          You can deploy a new instance as per your requirment or you can re-launch an instance from an AMI which you had already taken.You can launch an instance on multiple location,fixed ip address from dynamic ip address section and attach an persistant block storage from Elastic block storage(EBS) section.EC2 provide you complete control our your compute resource.You can take advantage of Amazon EC2 free service provided for testing pupose,Chek below link for free Amazon EC2 Tier.

http://aws.amazon.com/free/

             Firewall rule can be configured in Security group Section.Rules for incoming or outgoing connection and port can be configured in Security Group section.Security group is like firewall rule that you configure to restrict access to deployed Amazon Web Services infrastructure.Security groups can exist only within a Amazon EC2 region.Security groups configured in AWS US-WEST region is not available on AWS APAC region. Incase you want to migrate AWS Resource from one region to another region ,you can also export security group configuration

     

Wednesday, 9 March 2016

Configuring Nagios Client : NRPE Plugin

We have discussed how to "Install Nagios Core on Amazon Linux Instance ". Please check the link for reference : http://linuxhotcoffee.blogspot.in/2016/03/installing-nagios-core-on-amazon-linux.html

My current Infrastructure details is given below : OS & Private IP

Monitoring Server : Amazon Linux Instance (10.10.1.100)
Client Server : Ubuntu (10.10.1.10)


Create User nagios and install below mentioned package

sudo useradd -m nagios
sudo apt-get install libssl-dev openssl xinetd build-essential


Now lets configure Monitoring server . Install NRPE on monitoring server.You can download the latest version of NRPE from Official Download page.Current latest version is NRPE 2.15 .Download the latest release using wget

cd ~
wget http://downloads.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz


Extract the tar file

tar -xvzf  nrpe-2.15.tar.gz
tar xzf nagios-plugins-2.1.1.tar.gz


Change the directory to

cd nagios-plugins-2.1.1/

Compile and install Plugin

./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make
make install


Change the directory to

cd nrpe-2.15/

Compile and install NRPE

./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
make install-plugin
make install-daemon
make install-daemon-config
make install-xinetd

Now modify the "only_from"  line in  /etc/xinetd.d/nrpe

vi /etc/xinetd.d/nrpe
only_from = 127.0.0.1 10.10.1.1000

Restart the xinetd service

service xinetd restart

Configuration on Nagios Monitor server is completed ,now we can move with configuration of Client Server

Install Nagios plugin and NRPE on Client Server

apt-get install nagios-plugins nagios-nrpe-server


Configure the Monitor Server ip on client nrpe.cfg file

vi /etc/nagios/nrpe.cfg

find allowed_hosts section in the file and add like the following

allowed_hosts=127.0.0.1,10.10.1.100


Restart then NRPE Service

service nagios-nrpe-server restart 











Tuesday, 8 March 2016

Installing Nagios Core on Amazon Linux Instance



I already have an running Amazon Linux Instance on my AWS infrastucture ,so i am not going to give any details on “How to spin up an Amazon Linux instance” :) . Port 22 and 80 is opend in my
Amazon Linux Instance gateway. Currently i had connected to my instance using ssh (Port :22). Please go through the below link to spinup an instance
https://aws.amazon.com/amazon-linux-ami/

Before we start installing Nagios Core we need following package to be installed .Please follow below Step :


sudo yum install httpd php
sudo yum install gcc glibc glibc-common
sudo yum install gd gd-devel

After all dependancie packages had installed we need to setup Nagios User in Instance

sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd apache

Now we can download the Nagios Core package and Plugins.Let store the download files in Download folder in home directory for temporarly still installation is over.

cd ~
cd Downloads/
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz

Once donload is over we extract the files

tar -xvzf http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
tar -xvzf http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz

You can find the latest file in Nagios Official Website : http://www.nagios.org/download//

Now we can compile and Install nagios ,firtst move to extracted nagios folder and compile the file

cd nagios-4.0.8
./configure –with-command-group=nagcmd
sudo make all
sudo make install-init
sudo make install-config
sudo make install-commandmode

Now we had completed the Nagios Core installation ,to compile and install Nagios plugin please follow below steps

cd nagios-plugins-2.0.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
sudo make
sudo make install

Now we have completed nagios plugin installation,to start nagios service during sytem restart automatically follow below steps

chkconfig –add nagios
chkconfig –level nagios on
chkconfig –add httpd
chkconfig –level httpd on

Now we can move to the final step configuring Nagios Web Interface.

cd nagios-4.0.8
sudo make install-webconf

Creat a admin account to loggin in Nagios Web Interface

sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users admin

Restart apache and Nagios service
That all Cheers :)

sudo service httpd restart
sudo service nagios start


You can access now Nagios Web Interface from link http://localhost/nagios” 




Monday, 17 August 2015

Blogs list for learning Cloud

http://aws.amazon.com/articles/
https://aws.amazon.com/blogs/aws/
http://harish11g.blogspot.in/
http://sanketdangi.com/
http://highscalability.com/
http://www.ciphercloud.com/blog/
http://highscalability.com/
http://blogs.aws.amazon.com/security/blog