Quantcast
Viewing all articles
Browse latest Browse all 18

HA Mysql on Solaris with Symantec cluster server

  1. Architecture

    Image may be NSFW.
    Clik here to view.

 

2.Create the volume for mysql

bash-3.00# vxassist -g datadg make mysqlvol 1500m layout=nolog

 

bash-3.00# mkdir /mysql

bash-3.00# newfs /dev/vx/dsk/datadg/mysqlvol

/dev/vx/rdsk/datadg/mysqlvol: Unable to find Media type. Proceeding with system determined parameters.

newfs: construct a new file system /dev/vx/rdsk/datadg/mysqlvol: (y/n)? y

/dev/vx/rdsk/datadg/mysqlvol: 3072000 sectors in 1500 cylinders of 32 tracks, 64 sectors

1500.0MB in 47 cyl groups (32 c/g, 32.00MB/g, 7936 i/g)

super-block backups (for fsck -F ufs -o b=#) at:

32, 65632, 131232, 196832, 262432, 328032, 393632, 459232, 524832, 590432,

2425184, 2490784, 2556384, 2621984, 2687584, 2753184, 2818784, 2884384,

2949984, 3015584

 

 

3.Install mysql

On both nodes:

groupadd mysql

useradd -g mysql mysql

 

on only one node:

cp support-files/my-medium.cnf /mysql/mysql/my.cnf

mount /dev/vx/dsk/datadg/mysqlvol /mysql

cp -r mysql-5.1.73-solaris10-x86_64 /mysql/

bash-3.00# ln -s mysql-5.1.73-solaris10-x86_64 mysql

bash-3.00# scripts/mysql_install_db –user=mysql –basedir=/mysql/mysql

Installing MySQL system tables…

OK

Filling help tables…

OK

 

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system

 

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

 

/mysql/mysql/bin/mysqladmin -u root password ‘new-password’

/mysql/mysql/bin/mysqladmin -u root -h solarisB password ‘new-password’

 

Alternatively you can run:

/mysql/mysql/bin/mysql_secure_installation

 

which will also give you the option of removing the test

databases and anonymous user created by default. This is

strongly recommended for production servers.

 

See the manual for more instructions.

 

You can start the MySQL daemon with:

cd /mysql/mysql ; /mysql/mysql/bin/mysqld_safe &

 

You can test the MySQL daemon with mysql-test-run.pl

cd /mysql/mysql/mysql-test ; perl mysql-test-run.pl

 

Please report any problems with the /mysql/mysql/scripts/mysqlbug script!

 

bash-3.00# pwd

/mysql/mysql/scripts

bash-3.00# cd ..

bash-3.00# ls

bin data include lib mysql-test scripts sql-bench

COPYING docs INSTALL-BINARY man README share support-files

bash-3.00# chown -R root .

bash-3.00# chown -R mysql data

bash-3.00# chgrp -R mysql .

bash-3.00# ls -l

total 338

drwxr-xr-x 2 root mysql 1536 Nov 17 02:47 bin

-rw-r–r– 1 root mysql 17987 Nov 17 02:48 COPYING

drwxr-x— 4 mysql mysql 512 Nov 17 02:48 data

drwxr-xr-x 2 root mysql 512 Nov 17 02:46 docs

drwxr-xr-x 2 root mysql 1024 Nov 17 02:46 include

-rw-r–r– 1 root mysql 124133 Nov 17 02:48 INSTALL-BINARY

drwxr-xr-x 3 root mysql 1024 Nov 17 02:46 lib

drwxr-xr-x 4 root mysql 512 Nov 17 02:47 man

drwxr-xr-x 10 root mysql 512 Nov 17 02:48 mysql-test

-rw-r–r– 1 root mysql 2496 Nov 17 02:48 README

drwxr-xr-x 3 root mysql 512 Nov 17 02:51 scripts

drwxr-xr-x 27 root mysql 1024 Nov 17 02:47 share

drwxr-xr-x 5 root mysql 1024 Nov 17 02:48 sql-bench

drwxr-xr-x 2 root mysql 512 Nov 17 02:48 support-files

 

start mysql

/mysql/mysql/bin/mysqld_safe &

 

 

4.create shutdown user

bash-3.00# bin/mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.1.73-log MySQL Community Server (GPL)

 

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

 

mysql> create user ‘MySQLAdmin’@’localhost’ identified by ‘shutdownuser’;

Query OK, 0 rows affected (0.01 sec)

 

mysql> create user ‘MySQLAdmin’@’127.0.0.1’ identified by ‘shutdownuser’;

Query OK, 0 rows affected (0.00 sec)

 

mysql> grant shutdown on *.* to ‘MySQLAdmin’@’localhost’;

Query OK, 0 rows affected (0.00 sec)

 

mysql> grant shutdown on *.* to ‘MySQLAdmin’@’127.0.0.1’ ;

Query OK, 0 rows affected (0.00 sec)

 

Test it could shutdown:

bash-3.00# bin/mysqladmin –user=MySQLAdmin –password=shutdownuser shutdown

051117 03:23:07 mysqld_safe mysqld from pid file /mysql/mysql-5.1.73-solaris10-x86_64/data/solarisB.pid ended

[1]+ Done /mysql/mysql/bin/mysqld_safe

bash-3.00# ps -ef|grep -i mysql

root 20866 17002 0 03:23:14 pts/2 0:00 grep -i mysql

 

5.check if ACC lib is installed

bash-3.00# pkginfo|grep VRTSacclib

application VRTSacclib Veritas Cluster Server ACC Library 5.2 by Symantec

 

6.install mysql agent on each node

bash-3.00# tar xvf HA_ag_mysql_agent_5.1.3.0_VCS5.0_Solaris_x86-64.tar

 

bash-3.00# pkgadd -d . VRTSmysql

Installation of <VRTSmysql> was successful.

 

7.Import type

  1. Run cmdserver on each node

    bash-3.00# /opt/VRTSvcs/bin/CmdServer &

    [1] 21468

2. import from cluster manager

Image may be NSFW.
Clik here to view.

  1. file/save configurations

 

8.add service group

Image may be NSFW.
Clik here to view.

 

9.Add all resources

Image may be NSFW.
Clik here to view.

 

 

Image may be NSFW.
Clik here to view.

 

Image may be NSFW.
Clik here to view.

 

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

 

Image may be NSFW.
Clik here to view.

 

10.Link resources together

Image may be NSFW.
Clik here to view.

 

 

bash-3.00# hares -online mysqlIP -sys solarisB

 

bash-3.00# tail -f engine_A.log

Compilation failed in require at /opt/VRTSagents/ha/bin/MySQL/monitor line 76.

BEGIN failed–compilation aborted at /opt/VRTSagents/ha/bin/MySQL/monitor line 76.

2005/11/17 05:26:14 VCS INFO V-16-1-10304 Resource mysql (Owner: unknown, Group: mysql) is offline on solarisB (First probe)

2005/11/17 05:26:18 VCS INFO V-16-1-10306 Resource mysqlIP (Owner: unknown, Group: mysql) is offline on solarisB (Previous State = OFFLINE)

2005/11/17 05:26:30 VCS INFO V-16-1-10306 Resource mysqlIP (Owner: unknown, Group: mysql) is offline on solarisA (Previous State = OFFLINE)

2005/11/17 05:26:33 VCS INFO V-16-1-10306 Resource mysqlIP (Owner: unknown, Group: mysql) is offline on solarisB (Previous State = OFFLINE)

2005/11/17 05:32:57 VCS INFO V-16-1-50135 User root fired command: hares -online mysqlIP solarisB from localhost

2005/11/17 05:32:57 VCS NOTICE V-16-1-10233 Clearing Restart attribute for group mysql on all nodes

2005/11/17 05:32:57 VCS NOTICE V-16-1-10301 Initiating Online of Resource mysqlIP (Owner: unknown, Group: mysql) on System solarisB

2005/11/17 05:33:00 VCS INFO V-16-1-10298 Resource mysqlIP (Owner: unknown, Group: mysql) is online on solarisB (VCS initiated)

 

^C

bash-3.00# ifconfig -a

lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 192.168.47.132 netmask ffffff00 broadcast 192.168.47.255

ether 0:c:29:49:5b:a3

e1000g0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 192.168.47.239 netmask ffffff00 broadcast 192.168.47.255

e1000g0:2: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 192.168.47.238 netmask ffffff00 broadcast 192.168.47.255

 

add these to /mysql/mysql/data/my.cnf

[mysqld]

basedir=/mysql/mysql-5.1.73-solaris10-x86_64

datadir=/mysql/mysql-5.1.73-solaris10-x86_64/data

 

11.check & all is ok

Image may be NSFW.
Clik here to view.

The post HA Mysql on Solaris with Symantec cluster server appeared first on Robert Chen.


Viewing all articles
Browse latest Browse all 18

Trending Articles