Showing posts with label rhel7. Show all posts
Showing posts with label rhel7. 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, November 2, 2015

How to install upgrade Firefox to the latest version 41 in Linux



As I searched, there is no exact mechanism to upgrade Firefox to the latest from existing version.

There are two options to do,


  1. ·         Remove existing old version and then install new version
  2.            Keep existing old version (if needed) and keep and run new version separately. This option is very needful when you have software plugins that are only supports to older version of Firefox. Therefore we need to keep both versions since we have no options.

First of all we need to download Firefox latest version that compatible for Linux,

firefox-41.0.2.tar.bz2

This can be done by directly downloading from Firefox site,


Or using Linux commands,

Cd <your_Location>
wget http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/41.0/linux-x86_64/en-US/firefox-41.0.2.tar.bz2

Then extract downloaded tar file using below tar command,

# tar xvjf firefox-41.0.2.tar.bz2

Now Firefox is ready to use. Go to the created Firefox folder and run Firefox script using terminal,

# cd firefox
# bash ./firefox

No you can use both versions of Firefox. If you want to make new version as default and remove existing one,
Remove existing version,

# yum remove firefox

Now create a link to /usr/bin from newly extracted Firefox,

# ln –s /<your_Location>/firefox/firefox /usr/bin/firefox

Now you have successfully installed Firefox on your Linux machine. 

*** You can download and extract your Firefox to any <your_Location>. But recommended place should be /usr/local since we install software into local.

Thursday, October 8, 2015

How to create firewall rules using firewall-config in RHEL7 / CentOS7



In Linux OS, you can maintain a rich powerful firewall using firewall daemon. 

There are two ways to create firewall rules,

  1.  Using terminal commands – you can easily add firewall rules using command line. But you have to have some knowledge about those commands.
  2.    Using firewall configuration GUI(user interface)

Here is how to create firewall rules using graphical interface.

Before adding firewall rules, you have to have clear idea about below mentioned three topics,


  1.  Source IP – this is the IP we are going send (generate) data packets. Normally we call these as client machines
  2. Destination IP – this is the IP which receive data packets.  Normally we call these as server machines.
  3. Port – this is the port we are going to enable or disable or limit through the firewall.

Now let’s take a simple scenario. I want to allow 172.17.xxx.2 client machine to access my server machine’s 8080 port. In this case 172.17.xxx.2 is source IP port is 8080. Since we are creating within our server, no need to mention our server IP (destination IP)

First of all check whether firewall is running or not using below command,

[root@lxxxxxx  ~]# systemctl status firewalld.service

I
To start stop firewall daemon use below commands,

[root@xxxxxx  ~]# systemctl start firewalld.service
[root@xxxxxx  ~]# systemctl stop firewalld.service

Now you can start firewall configuration GUI tool using below command,

[root@xxxxxx  ~]#  firewall-config

Now it will show below table and follow the pictures,
Select permanent from configuration menu,


In zones, select rich rules tab,


Then click add button,


Then enter details like below,
Select family as ipv4 and in element, select port and add your port need to open to the outside,


Then add source IP and finish writing rule,
Now you finished writing rule in firewall daemon. Reload firewall daemon if required.