Showing posts with label oracle. Show all posts
Showing posts with label oracle. Show all posts

Thursday, February 11, 2016

How to load balance MySQL or Oracle databases using HAproxy



To load balance RDBMS like MYSQL and Oracle, you cannot use http as haproxy protocol.
Therefore you need to change the protocol from http to tcp.

We can do this by changing default mode to tcp.

Or we can mention protocol in frontends and backends like below,

frontend http-in
        bind *:<listening Port> #database listening port
        option tcplog
        mode tcp
        default_backend db_backend
 
 
backend db_backend
        mode tcp
        balance source
        server db1 <db server1 IP>:<your port> check #change with your IP and port
        server db2 <db server2 IP>:<your port> check #change with your IP and port
 
listen stats *:8080
        stats enable
        stats scope http-in
        stats scope db_backend
        stats uri /haproxy?stats
        stats hide-version
        stats auth haproxy:stats

That’s all. Now restart haproxy service,

#systemctl restart haproxy.service

Monday, March 23, 2015

How to install oracle java 7 in RHEL7 CentOS7



If you have RHEL 7 fresh installed machine, there must be installed open java as the default java installation. If you want to change java environment to oracle java 7, follow below commands,
First check existing java version,

[akila@localhost u01]#  java -version

It will give you the existing java version like below,

java version "1.7.0_51"

OpenJDK Runtime Environment (rhel-2.4.5.5.el7-x86_64 u51-b31)

OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)



To install oracle jdk, first you have to download it from oracle site,
Locate the downloaded file in a specific location, let’s name it as <location>.
Extract downloaded tar file using tar command,

[akila@localhost u01]# tar xzf jdk-7u60-linux-x64.ta

Now install java using alternatives command,

[akila@localhost u01]# alternatives --install /usr/bin/java java  <location>/jdk1.7.0_60/bin/java 2

 [akila@localhost u01]# alternatives --config java

Now you can check java version changed to oracle java 7,

[akila@localhost u01]#  java -version

java version "1.7.0_60"

Java(TM) SE Runtime Environment (build 1.7.0_60-b19)

Java HotSpot(TM) 64-Bit Server VM (build 24.60-b09, mixed mode)

Now you have to set JAVA_HOME and add it to PATH,

[akila@localhost u01]#  export JAVA_HOME="<location>/jdk1.7.0_60"

[akila@localhost u01]# JRE_HOME="<location>/jdk1.7.0_60/jre"

[akila@localhost u01]# export PATH=$PATH: JAVA_HOME/bin: JAVA_HOME/jre/bin

Above commands are only for temporarily. To make changes permanently, you have to update .bash_profile
By default .bash_profile file looks like below,

# .bash_profile



# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi



# User specific environment and startup programs



PATH=$PATH:$HOME/bin


export PATH

Edit the file like below,

# .bash_profile



# Get the aliases and functions

if [ -f ~/.bashrc ]; then

        . ~/.bashrc

fi



# User specific environment and startup programs



JAVA_HOME="/<location>/jdk1.7.0_60"

JRE_HOME="/<location>/jdk1.7.0_60/jre"



export JAVA_HOME

export JRE_HOME



PATH=$PATH:$HOME/bin:/ <location>/jdk1.7.0_60/bin:/ <location>/jdk1.7.0_60/jre/bin



export PATH

Now you have successfully installed java 7 in your RHEL/CentOS 7 machine

Sunday, March 22, 2015

Oracle VirtualBox from beginning – part 1



If you are using servers you must have to know about virtual machines (VM). There are many products to create virtual machines in local machine. One of best solution is Oracle VirtualBox. You can do many amazing things with virtual machines if you have good knowledge about virtualBox. So I decided to share my knowledge about virtualbox with you.
Below are the topics I am going to discuss in future posts.


  • ·         What is VM and why?
  • ·         Docker vs VMs?
  • ·         How to install virtualbox in linux(centOS/fedora/RHEL)?
  • ·         How to create CentOS vm in virtualBox?
  • ·         How to create RHEL VM in virtualBox?
  • ·         How to create Fedora VM in virtualBox?
  • ·         How to create android VM in local machine using virtualBox?
  • ·         How to change VM installation path/ location?
  • ·         How to create VM network inside virtualBox?
  • ·         Change VM settings after creation of virtual machine?


Hope you will gain something new from this tutorial series.