Mysql-Proxy Guide on Centos

Posted: October 23, 2013 in Mysql

# su –

#Install EPEL
## Step 1
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

## Step 2
ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo

## Step 3
nano /etc/yum.repos.d/remi.repo

## Step 4
[remi]
name=Les RPM de remi pour Enterprise Linux $releasever – $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

## Step 5
yum update -y

## Step 6
yum install mysql-proxy

## Step 7
nano /etc/default/mysql-proxy

#– cut here —
ENABLED=”true”
OPTIONS=”–defaults-file=/etc/mysql-proxy.cnf”
#– cut here —

## Step 8
nano /etc/mysql-proxy.cnf

#– cut here —

[mysql-proxy]
daemon = true
proxy-address = xxx.yyy.ccc.bbb:3306
proxy-skip-profiling = true
keepalive = true
event-threads = 50
pid-file = /var/run/mysql-proxy.pid
log-file = /var/log/mysql-proxy.log
log-level = debug
proxy-backend-addresses = 192.168.88.5:3306
proxy-lua-script=/usr/lib64/mysql-proxy/lua/proxy/auto-config.lua

#– cut here —

## Step 9
chmod 06660 /etc/mysql-proxy.cnf

## Step 10
nano /etc/rc.local

#– cut here —

mysql-proxy –defaults-file=/etc/mysql-proxy.cnf

#– cut here —

## Step 11
System — Administration — Firewall — Other Ports — Add — 3306 tcp — Apply

## Step 12
/etc/init.d/sshd restart

## Step 13
ps aux | grep mysql-proxy

## Step 14
nano /etc/hosts

XXX.XXX.XXX.XXX codebranch.xxxx.com.my codebranch ***Contoh : 192.168.88.90 1303.xxxx.my 1303

##Step 14
hostname -f

## Step 15
hostname codebranch.xxxt.com.my *** Contoh hostname 1303.xxxx.com.my

##Step 14
hostname -f
** mesti sama dengan codebranch.xxxxx.com.my

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s