Install MHA on RHEL6 / CentOS6 for mySQL

Configure Proxy for Internet

#export http_proxy=http://proxy.xxxx.intra:00
#export https_proxy=https://proxy.xxxx.intra:00

Note: My environment is using a proxy server for Internet access, if you have direct access to internet ignore this step.

Configure RedHat subscription for yum

#subscription-manager register –username admin-example –password secret –auto-attach

Download epel-release package on machine

#wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

Note: the package will be downloaded on the path you are standing – verify from “pwd” command

Install epel-package

#yum install -y epel-release-latest-6.noarch.rpm

Install perl packages

#yum -y install perl-DBD-MySQL perl-Config-Tiny perl-Log-Dispatch perl-Parallel-ForkManager perl-Config-IniFiles ncftp perl-Params-Validate perl-CPAN perl-Test-Mock-LWP.noarch perl-LWP-Authen-Negotiate.noarch perl-devel

Install more perl packages

#yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

Download MHA Packages (Node & Manager)

https://code.google.com/p/mysql-master-ha/wiki/Downloads?tm=2

– MHA Manager 0.56 rpm RHEL6 – mha4mysql-manager-0.56-0.el6.noarch.rpm
– MHA Node 0.56 rpm RHEL6 – mha4mysql-node-0.56-0.el6.noarch.rpm

Once downloaded copy to server via WinSCP or SSH (somehow it is not working properly in wget for me)

Install MHA Packages

#yum -y install mha4mysql-node-0.56-0.el6.noarch.rpm

#yum -y install mha4mysql-manager-0.56-0.el6.noarch.rpm

Note: Move to directory where packages are downloaded

Install iftop, htop and NetHogs on RHEL / CentOS 6.x x86_64 [Internet Required]

Recently I was given a task to create two CentOS 6.5 Jump Servers in the environment I am working currently.

There was a specific requirement for the following packages.

  • iftop – Network Bandwidth Monitoring
  • htop – Linux Process Monitoring
  • NetHogs – Monitor per process Network Bandwidth

We have an internal secure proxy server via which Internet was easily available for my servers. This is how I did:

Step 1 – Enable EPEL (Extra Packages for Enterprise Linux) and install rpm

cd /tmp

wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -ivh epel-release-6-8.noarch.rpm

Step 2 – Verify EPEL Repo

yum repolist

(it should display EPEL repo in the output)

Step 3 – Install packages

yum -y install iftop

yum -y install htop

yum – y install NetHogs

Note: Just in case you face the following error:

yum error “Cannot retrieve metalink for repository: epel. Please verify its path and try again”

You will have to edit the following repo’s by commenting entries ‘mirrorlist=..’ and un-comment entries ‘baseurl=…’

  • /etc/yum.repos.d/epel.repo
  • /etc/yum.repos.d/epel-testing.repo

HowTo configure Telnet on Linux (Redhat)

Telnet

Telnet

Re-blogged from Zahidhaseeb’s Blog:

In my environment I have used Linux Redhat 6.2

  • Install three packages telnet-server, telnet and xinetd.
  • Make sure that the xinetd service should be running.
  • Configure the file name /etc/xinetd/telnet

1.) Install three packages telnet-server, telnet and xinetd.

You need to install three services

for example # yum install telnet-server telnet
the above command will also install the xinetd service. See the following example for reference:

Dependencies Resolved

=====================================================
Package               Arch         Version                  Repository    Size
=====================================================
Installing:
telnet                i686         1:0.17-47.el6            base          56 k
telnet-server         i686         1:0.17-47.el6            base          36 k
Installing for dependencies:
xinetd                i686         2:2.3.14-33.el6          base         121 k

Transaction Summary
=====================================================
Install       3 Package(s)

Total download size: 213 k
Installed size: 409 k

2.) Make sure that the xinetd service should be running.

# service xinetd status
xinetd (pid  13561) is running…

Please also note: Make sure that your firewall also stopped or the telnet traffic is allowed

3.) Configure the file name /etc/xinetd.d/telnet

We need to change the following highlighted line from yes to no

# vi /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
#    unencrypted username/password pairs for authentication.
service telnet
{
flags        = REUSE
socket_type    = stream
wait        = no
user        = root
server        = /usr/sbin/in.telnetd
log_on_failure    += USERID
disable        = yes
}

Note:

In few scenarios, telnet works over the ip, but does not resolve specific ports. In that case xinetd services needs a restart

“service xinetd restart”

Convert RHN repositories (yum) with RHEL Media DVD repository

yum

repositories (yum)

Re-blogged from Zahidhaseeb’s Blog:

Step # 1

# pwd
/etc/yum.repos.d

Step # 2

# vi rhel-source.repo

Step # 3
You may see a result like below

[rhel-source]
name=Red Hat Enterprise Linux $releasever – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta – $basearch – Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Step # 4

Add the below lines on the top of file above

[Media]
name=RHELmedia
baseurl=file:///media/RHEL_6.2\ x86_64\ Disc\ 1/Server/
enabled=1
gpgcheck=0

Please Note: Keep enabled=1 for [Media] and mark enabled=0 for[rhel-source-beta] and [rhel-source] .

Conclusion

Now you will be able to use yum command and the request will redirect to the DVD media of Redhat which you inserted in the CD/DVDrom (instead of going to internet/RHN)

Helpful Link

http://blog.sriunplugged.com/linux/adding-redhat-dvd-as-repository/