Top Banner
VeritasHigh Availability Agent for MySQL Installation and Configuration Guide AIX, HP-UX, Linux, Solaris 5.1 June 2012
68

Vcs Mysql Install

Nov 03, 2014

Download

Documents

animeshdoc

Vcs Mysql Install
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Vcs Mysql Install

Veritas™ High AvailabilityAgent for MySQL Installationand Configuration Guide

AIX, HP-UX, Linux, Solaris

5.1

June 2012

Page 2: Vcs Mysql Install

Veritas High Availability Agent for MySQL Installationand Configuration Guide

The software described in this book is furnished under a license agreement andmay be usedonly in accordance with the terms of the agreement.

Agent Version: 5.1.2.0

Document version: 5.1.2.0.1

Legal NoticeCopyright © 2012 Symantec Corporation. All rights reserved.

Symantec, the Symantec logo, Veritas, Veritas Storage Foundation, CommandCentral,NetBackup, Enterprise Vault, and LiveUpdate are trademarks or registered trademarks ofSymantec corporation or its affiliates in the U.S. and other countries. Other names may betrademarks of their respective owners.

The product described in this document is distributed under licenses restricting its use,copying, distribution, and decompilation/reverse engineering. No part of this documentmay be reproduced in any form by any means without prior written authorization ofSymantec Corporation and its licensors, if any.

THEDOCUMENTATIONISPROVIDED"ASIS"ANDALLEXPRESSORIMPLIEDCONDITIONS,REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT,ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TOBELEGALLYINVALID.SYMANTECCORPORATIONSHALLNOTBELIABLEFORINCIDENTALOR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING,PERFORMANCE, OR USE OF THIS DOCUMENTATION. THE INFORMATION CONTAINEDIN THIS DOCUMENTATION IS SUBJECT TO CHANGE WITHOUT NOTICE.

The Licensed Software andDocumentation are deemed to be commercial computer softwareas defined in FAR12.212 and subject to restricted rights as defined in FARSection 52.227-19"Commercial Computer Software - Restricted Rights" and DFARS 227.7202, "Rights inCommercial Computer Software or Commercial Computer Software Documentation", asapplicable, and any successor regulations. Any use, modification, reproduction release,performance, display or disclosure of the Licensed Software andDocumentation by theU.S.Government shall be solely in accordance with the terms of this Agreement.

Page 3: Vcs Mysql Install

Symantec Corporation350 Ellis StreetMountain View, CA 94043

http://www.symantec.com

Page 4: Vcs Mysql Install

Technical SupportSymantec Technical Support maintains support centers globally. TechnicalSupport’s primary role is to respond to specific queries about product featuresand functionality. TheTechnical Support group also creates content for our onlineKnowledge Base. The Technical Support group works collaboratively with theother functional areas within Symantec to answer your questions in a timelyfashion. For example, theTechnical Support groupworkswithProductEngineeringand Symantec Security Response to provide alerting services and virus definitionupdates.

Symantec’s support offerings include the following:

■ A range of support options that give you the flexibility to select the rightamount of service for any size organization

■ Telephone and/or Web-based support that provides rapid response andup-to-the-minute information

■ Upgrade assurance that delivers software upgrades

■ Global support purchased on a regional business hours or 24 hours a day, 7days a week basis

■ Premium service offerings that include Account Management Services

For information about Symantec’s support offerings, you can visit our Web siteat the following URL:

www.symantec.com/business/support/index.jsp

All support services will be delivered in accordance with your support agreementand the then-current enterprise technical support policy.

Contacting Technical SupportCustomers with a current support agreement may access Technical Supportinformation at the following URL:

www.symantec.com/business/support/contact_techsupp_static.jsp

Before contacting Technical Support, make sure you have satisfied the systemrequirements that are listed in your product documentation. Also, you should beat the computer onwhich theproblemoccurred, in case it is necessary to replicatethe problem.

When you contact Technical Support, please have the following informationavailable:

■ Product release level

Page 5: Vcs Mysql Install

■ Hardware information

■ Available memory, disk space, and NIC information

■ Operating system

■ Version and patch level

■ Network topology

■ Router, gateway, and IP address information

■ Problem description:

■ Error messages and log files

■ Troubleshooting that was performed before contacting Symantec

■ Recent software configuration changes and network changes

Licensing and registrationIf yourSymantecproduct requires registrationor a licensekey, access our technicalsupport Web page at the following URL:

www.symantec.com/business/support/

Customer serviceCustomer service information is available at the following URL:

www.symantec.com/business/support/

Customer Service is available to assist with non-technical questions, such as thefollowing types of issues:

■ Questions regarding product licensing or serialization

■ Product registration updates, such as address or name changes

■ General product information (features, language availability, local dealers)

■ Latest information about product updates and upgrades

■ Information about upgrade assurance and support contracts

■ Information about the Symantec Buying Programs

■ Advice about Symantec's technical support options

■ Nontechnical presales questions

■ Issues that are related to CD-ROMs or manuals

Page 6: Vcs Mysql Install

Support agreement resourcesIf youwant to contact Symantec regarding an existing support agreement, pleasecontact the support agreement administration team for your region as follows:

[email protected] and Japan

[email protected], Middle-East, and Africa

[email protected] America and Latin America

DocumentationProduct guides are available on the media in PDF format. Make sure that you areusing the current version of the documentation. The document version appearson page 2 of each guide. The latest product documentation is available on theSymantec Web site.

https://sort.symantec.com/documents

Your feedback on product documentation is important to us. Send suggestionsfor improvements and reports on errors or omissions. Include the title anddocument version (located on the second page), and chapter and section titles ofthe text on which you are reporting. Send feedback to:

[email protected]

About Symantec ConnectSymantec Connect is the peer-to-peer technical community site for Symantec’senterprise customers. Participants can connect and share informationwith otherproduct users, including creating forum posts, articles, videos, downloads, blogsand suggesting ideas, as well as interact with Symantec product teams andTechnical Support. Content is rated by the community, and members receivereward points for their contributions.

http://www.symantec.com/connect/storage-management

Page 7: Vcs Mysql Install

Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Chapter 1 Introducing the Veritas High Availability Agent forMySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

About the Veritas agent for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11What’s new in this agent ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Features of the Veritas Agent for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Supported software .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

Support matrix for IMF and in-depth monitoring .... . . . . . . . . . . . . . . . . . . . . . 13How the agent makes MySQL highly available ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13MySQL agent functions .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

Online .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Offline ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Monitor ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Clean .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Setting up MySQL in a VCS cluster ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

Chapter 2 Installing and configuring MySQL for highavailability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

About MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Installing the MySQL instance .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Specifying shared disk for storing the database ... . . . . . . . . . . . . . . . . . . . . . . . . 18Setting MySQL parameters after installation .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Configuring the MySQL base directory and databasedirectory .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Configuring virtual IP addresses ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Configuring Ports ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Configuring the MySQL database user ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Adding a dedicated database administratorwith shutdownprivilegesonly ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Virtualizing MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Running multiple instances of MySQL on a single node .... . . . . . . . . . . . . 21

Contents

Page 8: Vcs Mysql Install

Chapter 3 Installing, upgrading, and removing the agent forMySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Before you install the Veritas agent for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23About the ACC library .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Installing the ACC library .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Installing the agent in a VCS environment .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Removing the agent in a VCS environment .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Removing the ACC library .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Chapter 4 Configuring the agent for MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

About configuring the Veritas agent for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Importing the agent types files in a VCS environment .... . . . . . . . . . . . . . . . . . . . . . 29MySQL agent attributes ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Executing a customized monitoring program .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

Chapter 5 Enabling the agent for MySQL for IMF . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

About Intelligent Monitoring Framework .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Benefits of IMF .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

How the agent supports intelligent resource monitoring .... . . . . . . . . . . . . . . . . . 38Agent functions for the IMF functionality ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

imf_init ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39imf_getnotification .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39imf_register ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Attributes that enable IMF .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39IMF .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39IMFRegList ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Before you enable the agent for IMF .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41Enabling the agent for IMF .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

If VCS is in a running state ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42If VCS is not in a running state ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Disabling intelligent resource monitoring .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Troubleshooting the configuration for IMF .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Sample IMF configurations .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Known issues ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

Chapter 6 Configuring the service groups for MySQL . . . . . . . . . . . . . . . . . . . . 49

About configuring service groups for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Before configuring the service groups for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . 49MySQL entities in a clustered environment .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Configuring MySQL resources for Solaris zones support ... . . . . . . . . . . . . . . . . . . . 50

Contents8

Page 9: Vcs Mysql Install

Chapter 7 Troubleshooting the agent for MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Using the correct software and operating system versions .... . . . . . . . . . . . . . . . 53Meeting prerequisites ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53Verifying virtualization .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Starting the MySQL server outside a cluster ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Reviewing error log files ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Using MySQL log files ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Appendix A Sample Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

About sample configurations for the agent for MySQL .... . . . . . . . . . . . . . . . . . . . . 57Sample agent type definition type for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Sample configuration files ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Sample service group configurations for MySQL .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

9Contents

Page 10: Vcs Mysql Install

Contents10

Page 11: Vcs Mysql Install

Introducing the VeritasHigh Availability Agent forMySQL

This chapter includes the following topics:

■ About the Veritas agent for MySQL

■ What’s new in this agent

■ Features of the Veritas Agent for MySQL

■ Supported software

■ How the agent makes MySQL highly available

■ MySQL agent functions

■ Setting up MySQL in a VCS cluster

About the Veritas agent for MySQLThe Veritas High Availability agents monitor specific resources within anenterprise application. They determine the status of resources and start or stopthem according to external events.

The Veritas High Availability Agent for MySQL provides high availability for allthe MySQL servers in a cluster.

See the following Technical Support TechNote for the latest updates or softwareissues for this agent:

http://www.symantec.com/business/support/index?page=content&id=TECH46455

1Chapter

Page 12: Vcs Mysql Install

What’s new in this agentThe enhancements in this release of the agent are:

■ Added Intelligent Monitoring Framework (IMF) capability and support forintelligent resource monitoring.

■ TheSecondLevelMonitor attribute of theVeritas agent forMySQL is deprecatedif both the following software versions are installed:

■ Veritas Cluster Server (VCS) 5.1 SP1 or later

■ Veritas agent for MySQL version 5.1.2.0

In such a case, instead of the SecondLevelMonitor attribute, you must use theresource type level attribute—LevelTwoMonitorFreq—to specify the frequencyof in-depth monitoring. For more information: See “MySQL agent attributes”on page 31.

Features of the Veritas Agent for MySQL■ Enables the validation of attributes based on entry points.

Validates the attributes in each entry point, before the actual data processingstarts. Hence, the code is robust.

■ First Failure Data Capture (FFDC)In case of a fault, the agent generates a huge volume of debug logs that enabletroubleshooting of the fault.

■ Fast First Level Monitor (FFLM)Maintains PID files based on search patterns to expedite the monitoringprocess.

■ Supports external user-supplied monitor utilitiesIn addition to the built-in monitoring logic, user-specified monitor utilitiescan be plugged-in. This enables the administrator to customize themonitoringof the application.

■ Delay entry pointThe agent intelligently delays the firstmonitor after online for slow initializingapplications.

Supported softwareFor information on the software versions that the agent for MySQL supports, seethe Symantec Operations Readiness Tools (SORT) site:https://sort.symantec.com/agents.

Introducing the Veritas High Availability Agent for MySQLWhat’s new in this agent

12

Page 13: Vcs Mysql Install

Support matrix for IMF and in-depth monitoringDepending on your version of Veritas Cluster Server (VCS) and the MySQL agent,the following features and functionality are supported.

Table 1-1

LevelTwoMonitorFreqattribute

SecondLevelMonitorattribute

IMF capabilityVCS and agentversion

YesNoYesVCS 5.1 SP1 or laterwith MySQL agent5.1.2.0 or later

NoYesNoVCS 5.1 SP1 withMySQL agent 5.1.1.0or earlier

NoYesNoVCS 5.1 or earlierwith MySQL agent5.1.2.0 or later

NoYesNoVCS 5.1 or earlierwith MySQL agent5.1.1.0 or earlier

How the agent makes MySQL highly availableThe agent provides the following levels of application monitoring:

■ Primary or Basic monitoringThis mode has Process check and Health check monitoring options. With thedefault Process check option, the agent verifies that the MySQL instanceprocesses are present in theprocess table. Process check cannot detectwhetherprocesses are in hung or stopped states.

■ Secondary or Detail monitoringIn this mode, the agent runs a utility to verify the status of MySQL instance.The agent detects application failure if the monitoring routine reports animproper function of the MySQL instance processes. When this applicationfailure occurs, the MySQL instance service group fails over to another nodein the cluster.Thus, the agent ensures high availability for MySQL instance.

13Introducing the Veritas High Availability Agent for MySQLHow the agent makes MySQL highly available

Page 14: Vcs Mysql Install

MySQL agent functionsThe operations or functions that the Veritas High Availability Agent for MySQLcan perform are described as follows:

OnlineThe online function performs the following tasks:

■ Verifies that the required attributes are set correctly.

■ Verifies that the MySQL Server instance is not already online. If the instanceis online, the online operation exits immediately

■ If any MySQL processes remain, the operation kills these processes using theuser name associated with the specific resource.

■ Attempts to start the MySQL server instance with the command:

$ BaseDir/bin/mysqld_safe --defaults-file=MyCnf \

--datadir=DataDir --user=MySQLUser

The command always gets executed in the context of MySQLUser, specifyingthe MySQL configuration file, if specified by the MyCnf agent attribute.

■ Checks if the server has started up completely.

■ Gives the control back to HAD.

OfflineThe offline function performs the following tasks:

■ Verifies that the required attributes are set correctly.

■ Verifies that the MySQL Server instance is not offline.

■ If the instance is already offline, the operation verifies if any processesbelonging to this MySQL resource, exist.

■ Attempts to stop the MySQL server instance with the command:$ BaseDir/bin/mysqladmin --user=MySQLAdmin \

--password=MySQLAdminPasswd shutdown

The command always gets executed in the context of MySQLUser.Then the offline operation kills any existing processes that belong to thisMySQL server instance. Gives the control back to HAD.

Introducing the Veritas High Availability Agent for MySQLMySQL agent functions

14

Page 15: Vcs Mysql Install

MonitorThe monitor function monitors the states of the MySQL Servers on all nodeswithin the cluster. The operation performs the following tasks:

■ Themonitor function conducts a first level check to determine that theMySQLServer processes, are running on the system in the cluster. If the first levelcheck does not find these processes running on the node, the check exitsimmediately, and reports the instance as OFFLINE.The agent also supports Intelligent Monitoring Framework (IMF) in the firstlevel check. IMF enables intelligent resourcemonitoring. The agent forMySQLis IMF-aware and uses the asynchronousmonitoring framework (AMF) kerneldriver for resource state change notifications. See “How the agent supportsintelligent resource monitoring” on page 38.You can use theMonitorFreq key of the IMF attribute to specify the frequencyatwhich the agent invokes themonitor function. See “MonitorFreq”onpage40.

Note: The agent sets the cluster MySQL type level attribute, ToleranceLimitto 1. This ensures that the application gets an opportunity to restart a failedmysqld instance, before the agent flags the instance OFFLINE, to initiate afailover.

■ If the SecondLevelMonitor attribute is set to greater than 0, the monitoroperation conducts a second level check.

■ The agent uses a connect(3c) method on the IP address specified by theHostName agent attribute to check for the MySQL server to listen to the portdefined by the Port attribute.

■ The agent then uses the monitor command to verify that the MySQL server isreally up.$ BaseDir/bin/mysqladmin --user=MySQLAdmin \

--password=MySQLAdminPasswd status

The command is executed in the context of the MySQLUser.

■ Depending upon the MonitorProgram attribute, the monitor operation canperform a customized check using a user-supplied monitoring utility. Pleaserefer to the agent attributes for more details regarding this attribute.the section called “MySQL agent attributes”

15Introducing the Veritas High Availability Agent for MySQLMySQL agent functions

Page 16: Vcs Mysql Install

Note:The attribute used to configure the second level check and its frequencydepends on the software versions of VCS andMySQL agent you have installed:For VCS 5.1 SP1 or later with MySQL agent version 5.1.2.0, use theLevelTwoMonitorFreq attribute. For VCS 5.1 or earlier with MySQL agent5.1.1.0 or earlier, use the SecondLevelMonitor attribute.

CleanIn case of a failure or after an unsuccessful attempt to online or offline a MySQLServer instance, the clean operation performs the following tasks:

■ Attempts to gracefully shut down the MySQL server instance with thecommand:$ BaseDir/bin/mysqladmin --user=MySQLAdmin \

--password=MySQLAdminPasswd shutdown

The command always gets executed in the context of MySQLUser.

■ The clean operation kills any remaining process pertaining to this MySQLinstance.

■ Gives the control back to HAD.

Note:For information about the additional functions of the agent forMySQLwhenIMF is enabled: See “Agent functions for the IMF functionality” on page 39.

Setting up MySQL in a VCS clusterFollow the steps below to set up MySQL in a cluster:

■ Set up a VCS cluster.

■ Install and configure MySQL for High Availability.

■ Install the Veritas High Availability agent for MySQL.See “Installing the agent in a VCS environment” on page 25.

■ Configure the service groups for MySQL.See “About configuring service groups for MySQL” on page 49.

Introducing the Veritas High Availability Agent for MySQLSetting up MySQL in a VCS cluster

16

Page 17: Vcs Mysql Install

Installing and configuringMySQL for high availability

This chapter includes the following topics:

■ About MySQL

■ Installing the MySQL instance

■ Setting MySQL parameters after installation

■ Adding a dedicated database administrator with shutdown privileges only

■ Virtualizing MySQL

About MySQLMySQL is a relational databasemanagement system (RDBMS).TheMySQLsoftwaredelivers a very fast,multi-threaded,multi-user, and robust SQL (StructuredQueryLanguage) database server. MySQL Server is intended for mission-critical,heavy-load production systems as well as for embedding into mass-deployedsoftware.

Installing the MySQL instanceReview the following section while installing a MySQL database instance:

■ Specifying shared disk for storing the database

2Chapter

Page 18: Vcs Mysql Install

Specifying shared disk for storing the databaseSpecifying the database on shared storage ensures that the database is availableon the failover node before the application is brought online. The databasedirectory is specified using the DataDir agent attribute. This attribute must beidentical to that specified in the configuration file (my.cnf) the database instanceuses for starting up.

For information on the DataDir attribute, review the Agent attributes section.

See “MySQL agent attributes” on page 31.

Setting MySQL parameters after installationIt is possible to host multiple instances of MySQL database on the same physicalnode by using different database configuration files. Each instance of the MySQLdatabase can be customized, and is then registeredwith the agent using theMyCnfagent attribute.

For information on the MyCnf attribute, review the Agent attributes section.

See “MySQL agent attributes” on page 31.

Review the following sections while customizing the database configuration file:

■ See “Configuring theMySQLbase directory anddatabase directory”onpage18.

■ See “Configuring virtual IP addresses” on page 18.

■ See “Configuring Ports” on page 19.

■ See “Configuring the MySQL database user” on page 19.

Configuring the MySQL base directory and database directoryEnsure that eachdatabase instancemanages auniquedatabase directory, specifiedby the “datadir” configuration parameter. The base (or installation) directory,specified by the “basedir” configuration parametermay be shared acrossmultipleinstances of the database server. These values need to be registeredwith the agentusing the BaseDir and DataDir agent attributes.

Review the information on the BaseDir and DataDir agent attributes.

See “MySQL agent attributes” on page 31.

Configuring virtual IP addressesTo ensure that the database is available to clients from all failover nodes, it mustbe hosted non-promiscuously. Use a virtual hostname which gets resolved to a

Installing and configuring MySQL for high availabilitySetting MySQL parameters after installation

18

Page 19: Vcs Mysql Install

unique IP address on all failover nodes of the cluster for specifying theHostNameagent attribute. Also ensure that this is specified in the database configurationfile (my.cnf) via the “bind-address” configuration parameter.

An IP address should be used as its value as a workaround for a bug in someversions of MySQL as reported by:

http://bugs.mysql.com/bug.php?id=28516

Review the information on the HostName agent attribute.

See “MySQL agent attributes” on page 31.

Configuring PortsTo ensure that multiple instances can be hosted on the same failover node, theHostName/Port pair combination has to be unique. MySQL server by defaultlistens onport 3306.This canbe changedusing the “port” configurationparameter.

Configuring the MySQL database userIt is recommended to use a non-root user while starting a MySQL database. Thisis the UNIX user owning the database directory and its files. The value for thisattribute should be identical to the “user” database configuration parameter, ifspecified in the database configuration file (my.cnf), and should be registeredwiththe agent using the MySQLUser agent attribute.

The following is an excerpt from a typical MySQL configuration file (my.cnf) thatis used to start a database instance.

# The following options will be passed to all MySQL clients

[client]

# password = your_password

port = 3306

socket = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server

[mysqld]

user = mysql

basedir = /usr/local/mysql

datadir = /db/bbmas/data

pid-file = /db/bbmas/data/pidfile.bbmas

port = 3306

socket = /tmp/mysql.sock

tmpdir = /var/tmp

.. truncated ..

19Installing and configuring MySQL for high availabilitySetting MySQL parameters after installation

Page 20: Vcs Mysql Install

# Specify the bind address

bind-address = 10.209.72.140

Adding a dedicated database administrator withshutdown privileges only

It is strongly recommended that you create a dedicated database administratorwith privileges only to shutdown a particular instance of the database, locally. Donot use the default “root” database administrator that has unrestricted databaseprivileges, as the agent does not need them.

To add a dedicated database administratorMySQLAdmin at the mysql prompt dothe following:

mysql> create user 'MySQLAdmin'@'localhost' identified by 'XXXXXX' ;

Query OK, 0 rows affected (0.00 sec)

mysql> create user 'MySQLAdmin'@'127.0.0.1' identified by 'XXXXXX' ;

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'@'l27.0.0.1' ;

Query OK, 0 rows affected (0.00 sec)

mysql> quit

This assumes that the session owner has grant access to add a database user andassign privileges for database shutdown to that user.

Ensure that you can shutdown the database instance using this database user:

$ BaseDir/bin/mysqladmin –-user=MySQLAdmin --password=XXXXXX shutdown

WhereMySQLAdmin is the database administrator being created and registeredwith the agent, and XXXXXX is the password being set for this administrator,which is encrypted and specified using the MySQLAdminPasswd agent attribute.

For information on MySQLAdmin and MySQLAdminPasswd attributes, reviewthe Agent attributes section.

See “MySQL agent attributes” on page 31.

Virtualizing MySQLTo ensure that your MySQL machine can function properly on any node of thecluster, you need to virtualize all the parameters that could be dependent on aparticular node.

Installing and configuring MySQL for high availabilityAdding a dedicated database administrator with shutdown privileges only

20

Page 21: Vcs Mysql Install

Review the following basic notes for virtualization:

When installing and configuring theMySQLmachine, ensure that youenter the virtual host name associated with the IP address used toconfigure the IP resource. This ensures that if the application needsto bemigrated, you are not tied down by the physical IP address givento the MySQL machine.

Host names

Ensure that your application gets installed on a shared disk so that itis not constrained by anything that is local to the node. If this is notpossible every time, make sure that the local data is available on eachconfigured node.

Path names

Running multiple instances of MySQL on a single nodeThe agent supports hosting multiple instances of the MySQL database server ona single physical node. To do this:

Add the environment variables MYSQL_UNIX_PORT and MYSQL_TCP_PORT to theenvironment file being used with the agent via the EnvFile agent attribute. Thefollowing is an excerpt from a typical environment file for the Bourne shell:

MYSQL_UNIX_PORT = socket; export MYSQL_UNIX_PORT

MYSQL_TCP_PORT = port; export MYSQL_TCP_PORT

Where,

The value of the ‘socket’ database parameter under the [mysqld] section of theconfiguration file

socket

The value of the ‘port’ database parameter under the [mysqld] section of theconfiguration file

port

For an excerpt of a typicalMySQL configuration file: See “Configuring theMySQLdatabase user” on page 19.

Hence, for the current example, the sample environment file will be:

MYSQL_UNIX_PORT = /tmp/mysql.sock; export MYSQL_UNIX_PORT

MYSQL_TCP_PORT = 3306; export MYSQL_TCP_PORT

Note: This procedure is also valid when multiple instances are not being hosted.

21Installing and configuring MySQL for high availabilityVirtualizing MySQL

Page 22: Vcs Mysql Install

Installing and configuring MySQL for high availabilityVirtualizing MySQL

22

Page 23: Vcs Mysql Install

Installing, upgrading, andremoving the agent forMySQL

This chapter includes the following topics:

■ Before you install the Veritas agent for MySQL

■ About the ACC library

■ Installing the ACC library

■ Installing the agent in a VCS environment

■ Removing the agent in a VCS environment

■ Removing the ACC library

Before you install the Veritas agent for MySQLYou must install the Veritas agent for MySQL on all the systems that will hostMySQL service groups.

Ensure that you meet the following prerequisites to install the agent for MySQL.

For VCS, do the following:

■ Install and configure Veritas Cluster Server.For more information on installing and configuring Veritas Cluster Server,refer to the Veritas Cluster Server Installation Guide.

■ Install the latest version of ACC Library.

3Chapter

Page 24: Vcs Mysql Install

To install or update the ACC Library package, locate the library and relateddocumentation in the Agent Pack tarball:See “Installing the ACC library” on page 24.

About the ACC libraryThe operations of a VCS agent depend on a set of Perl modules known as the ACClibrary. The library must be installed on each system in the cluster that runs theagent. The ACC library contains common, reusable functions that perform tasks,such as process identification, logging, and system calls.

Instructions to install or remove the ACC library on a single system in the clusterare given in the following sections. The instructions assume that the agent's tarfile has already been extracted.

Installing the ACC libraryInstall the ACC library on each system in the cluster that runs an agent thatdepends on the ACC library.

To install the ACC library

1 Log in as superuser.

2 Download ACC Library.

You can download either the complete Agent Pack tarball or the individualACCLib tarball from the Symantec Operations Readiness Tools (SORT) site(https://sort.symantec.com/agents).

3 If you downloaded the complete Agent Pack tarball, navigate to the directorycontaining the package for the platform running in your environment.

cd1/aix/vcs/application/acc_library/version_library/pkgsAIX

cd1/hpux/generic/vcs/application/acc_library/version_library/pkgsHP-UX

cd1/linux/generic/vcs/application/acc_library/version_library/rpmsLinux

cd1/solaris/dist_arch/vcs/application/acc_library/version_library/pkgs

where dist_arch is sol_sparc or sol_x64.

Solaris

Installing, upgrading, and removing the agent for MySQLAbout the ACC library

24

Page 25: Vcs Mysql Install

4 If youdownloaded the individualACCLib tarball, navigate to thepkgsdirectory(for AIX, HP-UX, and Solaris), or rpms directory (for Linux).

5 Install the package. Enter Yes if asked to confirm overwriting of files in theexisting package.

# installp -ac -d VRTSacclib.bff VRTSacclibAIX

# swinstall -s ‘pwd‘ VRTSacclibHP-UX

# rpm -i \

VRTSacclib-VersionNumber-GA_GENERIC.noarch.rpm

Linux

# pkgadd -d VRTSacclib.pkgSolaris

Installing the agent in a VCS environmentInstall the agent for MySQL on each node in the cluster.

To install the agent in a VCS environment

1 Download the agent from the Symantec Operations Readiness Tools (SORT)site: https://sort.symantec.com/agents.

You can download either the complete Agent Pack tar file or an individualagent tar file.

2 Uncompress the file to a temporary location, say /tmp.

3 If you downloaded the complete Agent Pack tar file, navigate to the directorycontaining the package for the platform running in your environment.

cd1/aix/vcs/database/mysql_agent/

vcs_version/version_agent/pkgs

AIX

cd1/hpux/generic/vcs/database/mysql_agent/

vcs_version/version_agent/pkgs

HP-UX

cd1/linux/generic/vcs/database/mysql_agent/

vcs_version/version_agent/rpms

Linux

cd1/solaris/dist_arch/vcs/database/mysql_agent/

vcs_version/version_agent/pkgs

where, dist_arch is sol_x64 or sol_sparc

Solaris

If you downloaded the individual agent tar file, navigate to the pkgs directory(for AIX, HP-UX, and Solaris), or rpms directory (for Linux).

25Installing, upgrading, and removing the agent for MySQLInstalling the agent in a VCS environment

Page 26: Vcs Mysql Install

4 Log in as superuser.

5 Install the package.

# installp -ac -d VRTSmysql.rte.bff VRTSmysql.rteAIX

# swinstall -s ‘pwd‘ VRTSmysqlHP-UX

# rpm -ihv \VRTSmysql-AgentVersion-GA_GENERIC.noarch.rpm

Linux

# pkgadd -d . VRTSmysqlSolaris

6 After installing the agent package, you must import the agent typeconfiguration file. See “Importing the agent types files in aVCS environment”on page 29.

Removing the agent in a VCS environmentYoumust uninstall the agent forMySQL from a cluster while the cluster is active.

To uninstall the agent in a VCS environment

1 Log in as a superuser.

2 Set the cluster configuration mode to read/write by typing the followingcommand from any node in the cluster:

# haconf -makerw

3 Remove all MySQL resources from the cluster. Use the following commandto verify that all resources have been removed:

# hares -list Type=MySQL

4 Remove the agent type from the cluster configuration by typing the followingcommand from any node in the cluster:

# hatype -delete MySQL

Removing the agent’s type file from the cluster removes the include statementfor the agent from the main.cf file, but the agent's type file is not removedfrom the cluster configuration directory. You can remove the agent’s typefile later from the cluster configuration directory.

Installing, upgrading, and removing the agent for MySQLRemoving the agent in a VCS environment

26

Page 27: Vcs Mysql Install

5 Save these changes. Then set the cluster configuration mode to read-only bytyping the following command from any node in the cluster:

# haconf -dump -makero

6 Use theplatform's native softwaremanagement program to remove the agentfor MySQL from each node in the cluster.

Execute the following command to uninstall the agent:

# installp -u VRTSmysql.rteAIX

# swremove VRTSmysqlHP-UX

# rpm -e VRTSmysqlLinux

# pkgrm VRTSmysqlSolaris

Removing the ACC libraryPerform the following steps to remove the ACC library.

To remove the ACC library

1 Ensure that all agents that use ACC library are removed.

2 Run the following command to remove the ACC library package.

# installp -u VRTSacclibAIX

# swremove VRTSacclibHP-UX

# rpm -e VRTSacclibLinux

# pkgrm VRTSacclibSolaris

27Installing, upgrading, and removing the agent for MySQLRemoving the ACC library

Page 28: Vcs Mysql Install

Installing, upgrading, and removing the agent for MySQLRemoving the ACC library

28

Page 29: Vcs Mysql Install

Configuring the agent forMySQL

This chapter includes the following topics:

■ About configuring the Veritas agent for MySQL

■ Importing the agent types files in a VCS environment

■ MySQL agent attributes

■ Executing a customized monitoring program

About configuring the Veritas agent for MySQLAfter installing the Veritas agent for MySQL, you must import the agent typeconfiguration file. After importing this file, you can create and configure MySQLresources. Before you configure a resource, review the attributes table thatdescribes the resource type and its attributes.

To view the sample agent type definition and service groups configuration.

See “About sample configurations for the agent for MySQL” on page 57.

Importing the agent types files in a VCS environmentTo use the agent forMySQL, youmust import the agent types file into the cluster.

You can import the agent types file using theVeritasCluster Server (VCS) graphicaluser interface or via the command line interface.

4Chapter

Page 30: Vcs Mysql Install

To import the agent types file using the VCS graphical user interface

1 Start the Veritas Cluster Manager and connect to the cluster on which theagent is installed.

2 Click File > Import Types.

3 In the Import Types dialog box, select the following file:

/etc/VRTSagents/ha/conf/MySQL/

MySQLTypes.cf

■ AIX

■ HP-UX

■ Linux

VCS 5.x orlater

/etc/VRTSagents/ha/conf/MySQL/

MySQLTypes50.cf

■ SolarisSPARC andx64

VCS 5.0

/etc/VRTSagents/ha/conf/MySQL/

MySQLTypes51.cf

■ SolarisSPARC andx64

VCS 5.1 orlater

4 Click Import.

5 Save the VCS configuration.

You cannowcreateMySQL resources. For additional information about usingthe VCS GUI, refer to the Veritas Cluster Server Administrator's Guide.

To import the agent types file using the Veritas Cluster Server command lineinterface (CLI):

1 Log on to any one of the systems in the cluster as the superuser.

2 Create a temporary directory.

# mkdir ./temp

# cd ./temp

3 Copy the sample file Types.cf.

/etc/VRTSvcs/conf/sample_MySQL/

MySQLTypes.cf

■ AIX

■ HP-UX

■ Linux

■ Solaris

VCS 4.x

/etc/VRTSagents/ha/conf/MySQL/

MySQLTypes.cf

■ AIX

■ HP-UX

■ Linux

VCS 5.x orlater

Configuring the agent for MySQLImporting the agent types files in a VCS environment

30

Page 31: Vcs Mysql Install

/etc/VRTSagents/ha/conf/MySQL/

MySQLTypes50.cf

■ SolarisSPARC andx64

VCS 5.0

4 Create a dummy main.cf file:

# echo 'include "MySQLTypes.cf"' > main.cf

5 Create the MySQL resource type as follows:

# hacf -verify .

# haconf -makerw

# sh main.cmd

# haconf -dump

The MySQL agent type is now imported to the VCS engine.

You cannowcreateMySQL resources. For additional information about usingthe VCS CLI, refer to the Veritas Cluster Server Administrator's Guide.

MySQL agent attributesRefer to the required and optional attributes while configuring the agent forMySQL.

Table 4-1 lists the required attributes for the MySQL agent.

Table 4-1 Required attributes

DescriptionAttribute

Specifies the logging detail that the agent performs for theresource.

The valid values are as follows:

■ ERROR: Only logs error messages.

■ WARN: Logs above plus warning messages.

■ INFO: Logs above plus informational messages

■ TRACE: Logs aboveplus tracemessages. TRACE is veryverboseand should be used only during initial configuration or fortroubleshooting and diagnostic operations.

Default Value: INFO

Example: INFO

ResLogLevel

31Configuring the agent for MySQLMySQL agent attributes

Page 32: Vcs Mysql Install

Table 4-1 Required attributes (continued)

DescriptionAttribute

The administrative database user of the MySQL server withprivileges to shutdown the database. Symantec recommendscreating a dedicated account in the database, with shutdownprivileges only.

Review the information for adding an administrative user forshutdown purposes.

See “Adding a dedicated database administrator with shutdownprivileges only” on page 20.

Default Value: root

Example: admin

MySQLAdmin

Password for the database administrator specified in theMySQLAdmin attribute. Thepassword is encryptedusing theVCSencrypt utility, vcsencrypt(1m).

Note: You need not encrypt the password if you are using theVCS GUI to enter the password. VCS GUI automatically encryptsthe password.

Default Value: ""

Example : jxmXkvVvkVnvWvsVx

MySQLAdminPasswd

ThededicatedOS login createdwhile installing theMySQL server.The database server will be started as this user. This login has tobe identical on all failover nodes.

Default Value: mysql

Example: mysql

MySQLUser

The absolute path to the directory storing the database beingmanaged by this instance of the server. Symantec recommendsstoring this directory on shared storage so that the same copy isavailable on the failover node.

The database directory should be owned by the user specified bythe MySQLUser agent attribute.

Default Value: ""

Example: /db/bbmas/data

DataDir

Configuring the agent for MySQLMySQL agent attributes

32

Page 33: Vcs Mysql Install

Table 4-1 Required attributes (continued)

DescriptionAttribute

The installation path of the MySQL Database server.

Default Value: ""

Example: /usr/local/MySQL

BaseDir

Table 4-2 lists the optional attributes for the MySQL agent.

Table 4-2 Optional attributes

DescriptionAttribute

Complete path of file name to source to set the environmentprior to executing MySQL programs. Symantec recommendsstoring the file on the shared disk where the database directory(DataDir) is located. This ensures that the same file is availableon each failover node. Specifying this attribute is optional. Theshell environments supported are ksh, sh, and csh.

Default Value: ""

Example: /db/bbmas/envfile

EnvFile

Virtualhostname for thisMySQLDatabase instance.Themonitoragent function uses this attribute to determine if the server isresponding to client requests.

This attribute is required only if second level monitoring isenabled.

Default Value: ""

Example: mysql.veritas.com

HostName

Represents the port number dedicated to theMySQL server. Themonitor agent functionuses this value to determine if the serverresponds to client requests.

This attribute is required only if second level monitoring isenabled.

Default Value: 3306

Example: 3306

Port

33Configuring the agent for MySQLMySQL agent attributes

Page 34: Vcs Mysql Install

Table 4-2 Optional attributes (continued)

DescriptionAttribute

Absolute path name of an external, user-supplied monitorexecutable.

For information about setting this attribute:

See “Executing a customized monitoring program” on page 35.

Default Value: ""

Example 1.: /db/bbmas/myMonitor.pl

Example 2.: /db/bbmas/myMonitor.sh arg1 arg2

MonitorProgram

Used to enable second-level monitoring and specify how oftenit is run. Second-level monitoring is a deeper, more thoroughstate checkof the configuredMySQL instance. Thenumeric valuespecifies how often that the second-level monitoring routinesare run.

Care shouldbe takenwhensetting this attribute to largenumbers.

For example, if the MonitorInterval is set to 60 seconds, and theSecondLevelMonitor is set to 100, then the second level checkwould only get performed every 100 minutes, which may not beas often as intended.

To provide maximum flexibility, the value set is not checked foran upper limit. You can set the second level check to occur oncea month, if that is desired.

Note: The SecondLevelMonitor attribute is applicable to VCSversions earlier than VCS 5.1 SP1 with MySQL agent versionsearlier than 5.1.2.0. From VCS version 5.1 SP1 or later withMySQL agent version 5.1.2.0 or later, the SecondLevelMonitorattribute of the MySQL agent is deprecated. Instead, a resourcetype level attribute LevelTwoMonitorFreq should be used tospecify the frequency of in-depth monitoring.

Default Value: 0

Example: 1

SecondLevelMonitor

Complete path to the MySQL configuration file to be used whilestarting the database. Symantec recommends storing the file onthe shared diskwhere the database directory (DataDir) is located.This ensures that the same file is available on each failover node.

Default Value: ""

Example: /db/bbmas/my.cnf

MyCnf

Configuring the agent for MySQLMySQL agent attributes

34

Page 35: Vcs Mysql Install

Table 4-2 Optional attributes (continued)

DescriptionAttribute

Specifies the frequency atwhich the agent for this resource typemust perform second-level or detailed monitoring. You can alsooverride the value of this attribute at the resource level.

The value indicates the number of monitor cycles after whichthe agentwillmonitor theMySQL instance in detail. For example,the value 5 indicates that the agent will monitor the MySQLinstance in detail after every five online monitor intervals.

Note: This attribute is applicable to VCS version 5.1 SP1 or laterwith MySQL agent version 5.1.2.0 or later. If the VCS version isearlier than VCS 5.1 SP1 and the MySQL agent version is earlierthan 5.1.2.0, use the SecondLevelMonitor attribute.

If you upgraded the VCS version to VCS 5.1 SP1 or later and theMySQL agent version to 5.1.2.0 (or later), and if you had enableddetail monitoring in the previous version, then do the following:

■ Set the value of the LevelTwoMonitorFreq attribute to thesame value as that of the SecondLevelMonitor attribute.

Type and dimension: integer-scalar

Default: 0

LevelTwoMonitorFreq

Executing a customized monitoring programYou can configure the monitor function to execute MonitorProgram.MonitorProgram is a custom monitor utility to perform a user-defined MySQLserver state check.

The utility is executed in the context of the UNIX user that is defined in theMySQLUser attribute.

The environment is set by sourcing the file specified in the EnvFile attribute.

The monitor operation executes MonitorProgram if:

■ The MonitorProgram attribute value is set to a valid executable utility.

■ The first-level process check indicates that theMySQLserver instance is online.

■ TheSecondLevelMonitor attribute is set to 1 and the second-level check returnsthe server state as ONLINE.Or

■ The SecondLevelMonitor attribute is set to greater than 1, but the second-levelcheck is deferred for this monitoring cycle.

35Configuring the agent for MySQLExecuting a customized monitoring program

Page 36: Vcs Mysql Install

The monitor operation interprets the program exit code as follows:

MySQL server is online110 or 0

MySQL server is offline100 or 1

MySQL server state is unknownAny other value

To ensure that the custom monitor utility is always available to the agentapplication, Symantec recommends storing the file in the directory in which theMySQL server gets installed.

Configuring the agent for MySQLExecuting a customized monitoring program

36

Page 37: Vcs Mysql Install

Enabling the agent forMySQL for IMF

This chapter includes the following topics:

■ About Intelligent Monitoring Framework

■ How the agent supports intelligent resource monitoring

■ Agent functions for the IMF functionality

■ Attributes that enable IMF

■ Before you enable the agent for IMF

■ Enabling the agent for IMF

■ Disabling intelligent resource monitoring

■ Troubleshooting the configuration for IMF

■ Sample IMF configurations

■ Known issues

About Intelligent Monitoring FrameworkWith intelligent monitoring framework (IMF), VCS supports intelligent resourcemonitoring in addition to the poll-based monitoring. Poll-based monitoring pollsthe resources periodicallywhereas intelligentmonitoring performs asynchronousmonitoring. You can enable or disable the intelligent resource monitoringfunctionality of the MySQL agent.

5Chapter

Page 38: Vcs Mysql Install

VCS process and mount-based agents use the Asynchronous MonitoringFramework (AMF) kernel driver that provides asynchronous event notificationsto the agents that are enabled for Intelligent Monitoring Framework (IMF).

You can enable theMySQLagent for IMF, provided the following software versionsare installed:

■ Veritas Cluster Server (VCS) 5.1 SP1 or later

■ Veritas High Availability agent for MySQL version 5.1.2.0 or later

See the Veritas Cluster Server Administrator’s Guide 5.1 Service Pack 1 for moreinformation about:

■ IMF notification module functions

■ Administering the AMF kernel driver

Benefits of IMFIMF offers the following benefits:

■ PerformanceEnhancesperformanceby reducing themonitoringof each resource at a defaultof 60 seconds for online resources, and 300 seconds for offline resources. IMFenables the agent tomonitor a large number of resourceswith aminimal effecton performance.

■ Faster detectionAsynchronous notifications would detect a change in the resource state assoon as it happens. Immediate notification enables the agent to take action atthe time of the event.

How the agent supports intelligent resourcemonitoring

When an IMF-enabled agent starts up, the agent initializes the asynchronousmonitoring framework (AMF) kernel driver. After the resource is in a steady state,the agent registers with the AMF kernel driver, the details of the resource thatare required tomonitor the resource. For example, the agent forMySQL registersthe PIDs of the MySQL processes with the IMF notification module. The agent’simf_getnotification functionwaits for any resource state changes.When theAMFkernel driver module notifies the imf_getnotification function about a resourcestate change, the agent framework runs the monitor agent function to ascertainthe state of that resource. The agent notifies the state change to VCS, which thentakes appropriate action.

Enabling the agent for MySQL for IMFHow the agent supports intelligent resource monitoring

38

Page 39: Vcs Mysql Install

See the Veritas Cluster Server Administrator’s Guide 5.1 Service Pack 1 for moreinformation.

Agent functions for the IMF functionalityIf theMySQL agent is enabled for IMF, the agent supports the following functions,in addition to the functions mentioned in MySQL agent functions.

imf_initThis function initializes theMySQL agent to interfacewith theAMFkernel driver,which is the IMF notificationmodule for the agent forMySQL. This function runswhen the agent starts up.

imf_getnotificationThis function gets notifications about resource state changes. This function runsafter the agent initializeswith theAMFkernelmodule. This function continuouslywaits for notification and takes action on the resource upon notification.

imf_registerThis function registers or unregisters resource entities with the AMF kernelmodule. This function runs for each resource after the resource goes into a steadystate—online or offline.

Attributes that enable IMFIf the agent forMySQL is enabled for IMF, the agent uses the following type-levelattributes in addition to the attributes described in MySQL agent attributes.

IMFThis resource type-level attribute determines whether the MySQL agent mustperform intelligent resource monitoring. You can also override the value of thisattribute at the resource level.

This attribute includes the following keys:

ModeDefine this attribute to enable or disable intelligent resource monitoring. Validvalues are as follows:

39Enabling the agent for MySQL for IMFAgent functions for the IMF functionality

Page 40: Vcs Mysql Install

■ 0—Does not perform intelligent resource monitoring

■ 1—Performs intelligent resourcemonitoring for offline resources andperformspoll-based monitoring for online resources

■ 2—Performs intelligent resourcemonitoring for online resources andperformspoll-based monitoring for offline resources

■ 3—Performs intelligent resource monitoring for both online and for offlineresources.

Note: The agent for MySQL supports intelligent resource monitoring for onlineresources only. Hence, Mode should be set to either 0 or 2.

Type and dimension: integer-association

Default: 0

MonitorFreqThis key value specifies the frequency at which the agent invokes the monitoragent function. The value of this key is an integer.

Default: 1

You can set this key to a non-zero value for cases where the agent requires toperform both poll-based and intelligent resource monitoring.

If the value is 0, the agent does not perform poll-based process checkmonitoring.

After the resource registerswith theAMFkernel driver, the agent calls themonitoragent function as follows:

■ After every (MonitorFreq x MonitorInterval) number of seconds for onlineresources

■ After every (MonitorFreq x OfflineMonitorInterval) number of seconds foroffline resources

RegisterRetryLimitIf you enable intelligent resource monitoring, the agent invokes the imf_registeragent function to register the resource with the AMF kernel driver.

The value of theRegisterRetryLimit key determines thenumber of times the agentmust retry registration for a resource. If the agent cannot register the resourcewithin the limit that is specified, then intelligent monitoring is disabled until theresource state changes or the value of the Mode key changes.

Default: 3.

Enabling the agent for MySQL for IMFAttributes that enable IMF

40

Page 41: Vcs Mysql Install

IMFRegListAnordered list of attributeswhose values are registeredwith the IMFnotificationmodule.

Type and dimension: string-vector

Default: No default value

Note: The attribute values can be overriden at the resource level.

Before you enable the agent for IMFBefore you enable the MySQL agent for IMF, ensure that the AMF kernel moduleis loaded and AMF is configured. For details, see the ‘Administering the AMFkernel driver' section of theVeritas Cluster Server Administrator's Guide 5.1 SP1.For details about the commands you can use to configureAMF, use the amfconfig-h command.

Enabling the agent for IMFIn order to enable the MySQL agent for IMF, you must make the followingconfiguration changes to the attributes of the agent:

■ AgentFile: Set the AgentFile attribute to Script51Agent

■ IMF Mode: Set the IMF Mode attribute to 2

■ IMFRegList: Update the IMFRegList attribute

The following sections provide more information on the commands you can useto make these configuration changes, depending on whether VCS is in a runningstate or not.

Note: If youhave upgradedVCS froman earlier version to version 5.1 SP1 or later,and you already have MySQL agent version 5.1.2.0 installed, ensure that you runthe following commands to create appropriate symbolic links:

# cd /opt/VRTSagents/ha/bin/MySQL

# ln -s /opt/VRTSamf/imf/imf_getnotification imf_getnotification

# ln -s /opt/VRTSagents/ha/bin/MySQL/monitor imf_register

41Enabling the agent for MySQL for IMFBefore you enable the agent for IMF

Page 42: Vcs Mysql Install

If VCS is in a running stateTo enable the MySQL resource for IMF when VCS is in a running state:

1 Make the VCS configuration writable.

# haconf -makerw

2 Run the following command to update the AgentFile attribute.

# hatype -modify MySQL AgentFile /opt/VRTSvcs/bin/Script51Agent

3 For VCS version 6.0 or later, run the following commands to add the IMFattributes:

# haattr -add -static ResourceType IMF -integer -assoc Mode 0

MonitorFreq 1 RegisterRetryLimit 3

# haattr -add -static ResourceType IMFRegList -string –vector

Note: Execute these commands only once after you first enable IMF supportfor the agent.

4 Run the following command to update the IMF attribute.

# hatype -modify MySQL IMF Mode num MonitorFreq num

RegisterRetryLimit num

For example, to enable intelligent monitoring of online resources, with theMonitorFreq key set to 5, and the RegisterRetryLimit key is set to 3, run thefollowing command:

# hatype -modify MySQL IMF Mode 2 MonitorFreq 5 RegisterRetryLimit

3

Note: The valid values for the Mode key of the IMF attribute are 0 (disabled)and 2 (online monitoring).

5 Run the following command to update the IMFRegList attribute:

# hatype -modify MySQL IMFRegList BaseDir DataDir MySQLUser

Enabling the agent for MySQL for IMFEnabling the agent for IMF

42

Page 43: Vcs Mysql Install

6 Save the VCS configuration.

# haconf -dump -makero

7 If the MySQL agent is running, restart the agent.

For information on the commands you can use to restart the agent, seeRestarting the agent.

Restarting the agentTo restart the agent:

1 Run the following command to stop the agent forcefully:

# haagent -stop MySQL -force -sys <system>

Note: Stopping the agent forcefully eliminates the need to take the resourceoffline.

2 Run the following command to start the agent:

# haagent -start MySQL -sys <system>.

If VCS is not in a running stateTo change the MySQL type definition file when VCS is not in a running state:

1 Update the AgentFile attribute.

static str AgentFile = "/opt/VRTSvcs/bin/Script51Agent"

2 Update the IMF attribute.

The valid values for the Mode key of the IMF attribute are 0 (disabled) and 2(online monitoring).

static int IMF{} = { Mode=num, MonitorFreq=num,

RegisterRetryLimit=num }

For example, to update the IMF attribute such that the Mode key is set to 2,the MonitorFreq key is set to 5, and the RegisterRetryLimit key is set to 3:

static int IMF{} = { Mode=2, MonitorFreq=5, RegisterRetryLimit=3

}

3 Update the IMFRegList attribute.

static str IMFRegList[] = { BaseDir DataDir MySQLUser }

43Enabling the agent for MySQL for IMFEnabling the agent for IMF

Page 44: Vcs Mysql Install

Disabling intelligent resource monitoringTo disable intelligent resource monitoring

1 Make the VCS configuration writable.

# haconf -makerw

2 To disable intelligent resource monitoring for all the resources of a certaintype, run the following command:

# hatype -modify MySQL IMF -update Mode 0

3 To disable intelligent resource monitoring for a specific resource, run thefollowing command:

# hares -override resource_name IMF

# hares -modify resource_name IMF -update Mode 0

4 Save the VCS configuration.

# haconf -dump -makero

Troubleshooting the configuration for IMFIf you face problems with the IMF configuration or functionality, consider thefollowing:

■ Ensure that the following attributes are configured with appropriate values.

■ AgentFile

■ IMF

■ IMFRegListIf IMFRegList is not configured correctly, the MySQL resources that havebeen registered for IMF get unregistered every time the monitor functionis run.

■ If you have configured the required attributes to enable the MySQL agent forIMF, but the agent is still not IMF-enabled, restart the agent. The imf_initfunction runs only when the agent starts up, so when you restart the agent,imf_init runs and initializes theMySQL agent to interfacewith theAMFkerneldriver.

■ You can run the following command to check the value of theMonitorMethodattribute and to verify that a resource is registered for IMF.# hares -value resource MonitorMethod system

Enabling the agent for MySQL for IMFDisabling intelligent resource monitoring

44

Page 45: Vcs Mysql Install

TheMonitorMethod attribute specifies themonitoringmethod that the agentuses to monitor the resource:

■ Traditional—Poll-based resource monitoring

■ IMF—Intelligent resource monitoring

■ You can use the amfstat to see a list of registered PIDs for a MySQL resource.A sample output of the ps –ef command for theMySQLprocesses is as follows:

$/usr/ucb/ps auxwwl | grep mysql

0 551 1646 1 0 59 20 1688 1304 6001cb5b198 S ?

0:00 sh -c /opt/mysql/mysql/bin/mysqld_safe

--datadir=/var/lib/mysql --user=mysql

0 551 1648 1646 0 59 20 1744 1360 6001caec108 S ?

0:00 /bin/sh /opt/mysql/mysql/bin/mysqld_safe

--datadir=/var/lib/mysql --user=mysql

0 551 1695 1648 0 59 206660834160 6001c997682 S ?

0:00 /opt/mysql/mysql/bin/mysqld

--basedir=/opt/mysql/mysql --datadir=/var/lib/mysql

--user=mysql --log-error=/var/lib/mysql/vcssx074.vxindia.

veritas.com.err --pid-file= /var/lib/mysql/vcssx074.

vxindia.veritas.com.pid 0 0 1747 550 0 49 20 1640

1152 6001ce02a9c S pts/1 0:00 grep mysql

The amfstat command shows the PIDs monitored by the agent.

Registered Reapers (1):

=======================

RID PID EVENT REAPER

1 568 3 0 MySQL

Process ONLINE Monitors (3):

============================

RID R_RID PID GROUP

22 1 1695 mysql

23 1 1646 mysql

24 1 1648 mysql

■ Run the following command to set the ResLogLevel attribute to TRACE.Whenyou set ResLogLevel to TRACE, the agent logs messages in the MySQL_A.logfile.# hares -modify ResourceName ResLogLevel TRACE

45Enabling the agent for MySQL for IMFTroubleshooting the configuration for IMF

Page 46: Vcs Mysql Install

■ Run the following command to view the content of the AMF in-memory tracebuffer.# amfconfig –p dbglog

For more troubleshooting information, see the following:

■ See “Troubleshooting the agent for MySQL” on page 53.

■ For information about asynchronous monitoring, attributes that enableasynchronous monitoring, and instructions on using some AMF CLI: VeritasCluster Server Administrator's Guide 5.1 Service Pack 1

■ Veritas Cluster Server Release Notes 5.1 Service Pack 1

Sample IMF configurationsAn example of a type definition file for a MySQL agent that is IMF-enabled is asfollows.

In this example, the IMF-related attributes are set to the following values:

/opt/VRTSvcs/bin/Script51AgentAgentFile

{ Mode=2, MonitorFreq=5, RegisterRetryLimit=3 }IMF{}

{ BaseDir DataDir MySQLUser }IMFRegList[]

25LevelTwoMonitorFreq

type MySQL (

static int ToleranceLimit = 1

static boolean AEPTimeout = 1

static str AgentFile = "/opt/VRTSvcs/bin/Script50Agent"

static str AgentDirectory = "/opt/VRTSagents/ha/bin/MySQL"

static str ArgList[] = { ResLogLevel, State, IState, MySQLUser,

MySQLAdmin, MySQLAdminPasswd, EnvFile, BaseDir, DataDir, MyCnf,

HostName, Port, SecondLevelMonitor, MonitorProgram }

str ResLogLevel = INFO

str MySQLUser = mysql

str MySQLAdmin = root

str MySQLAdminPasswd

str EnvFile

str BaseDir

str DataDir

str MyCnf

Enabling the agent for MySQL for IMFSample IMF configurations

46

Page 47: Vcs Mysql Install

str HostName

int Port = 3306

int SecondLevelMonitor = 0

str MonitorProgram

static int IMF{} = { Mode=2, MonitorFreq=5, RegisterRetryLimit=3 }

static str IMFRegList[] = { BaseDir DataDir MySQLUser }

)

A sample resource configuration from the /etc/VRTSvcs/conf/config/main.cffile is as follows:

MySQL mysql (

Critical = 0

MySQLAdminPasswd = iwlWruVujUwwMunUl

BaseDir = "/opt/mysql/mysql"

DataDir = "/var/lib/mysql"

HostName = "vcssx074.vxindia.veritas.com"

)

Known issuesThis release of the agent for MySQL has the following known issues:

Problem

An error message might appear when you run the hares -offline command totake a resource offline.

Description

Whena resource is takenoffline, it is unregistered fromtheAMFmodule.However,the imf_register function attempts to unregister the resource again.

This results in an error message from the engine log.

Workaround

It is safe to ignore this error message.

47Enabling the agent for MySQL for IMFKnown issues

Page 48: Vcs Mysql Install

Enabling the agent for MySQL for IMFKnown issues

48

Page 49: Vcs Mysql Install

Configuring the servicegroups for MySQL

This chapter includes the following topics:

■ About configuring service groups for MySQL

■ Before configuring the service groups for MySQL

■ MySQL entities in a clustered environment

■ Configuring MySQL resources for Solaris zones support

About configuring service groups for MySQLConfiguring theMySQL service group involves creating theMySQL service group,its resources, and defining attribute values for the configured resources. Youmusthave administrator privileges to create and configure a service group.

You can configure the service groups using one of the following:

■ The Cluster Manager (Java console)

■ Veritas Operations Manager

■ The command-line

Before configuring the service groups for MySQLBefore you configure the MySQL service group, you must:

■ Verify that VCS is installed and configured on all nodes in the cluster whereyou will configure the service group.Refer to the Veritas Cluster Server Installation Guide for more information.

6Chapter

Page 50: Vcs Mysql Install

■ Verify that the Veritas agent forMySQL is installed on all nodes in the cluster.See “Installing the agent in a VCS environment” on page 25.

MySQL entities in a clustered environmentA service group is a logical setup containing all resources that can support aMySQL instance in a clustered environment.

The required resources are as follows.

Contains a volume and a file system, which is a mount resourcecontaining the MySQL installation files.

Use the DiskGroup resource type to create this resource. Createthe disk group from the shared disk so that you can import thegroup into any system in the cluster.

Disk group

Mounts,monitors, andunmounts the file system that is dedicatedto the MySQL installation files.

Use the Mount resource type to create this resource.

Mount

Monitors the network interface card through which the MySQLinstance communicates with other services.

Use the NIC resource type to create this resource.

Network interface

Configures the virtual IP address dedicated to theMySQL instance.The external services, programs, and clients use this address tocommunicate with this instance.

Use the IP resource type to create this resource.

Virtual IP

Starts, stops, and monitors the MySQL server instance.

Use the MySQL server resource type to create this resource.

MySQL server

Configuring MySQL resources for Solaris zonessupport

To enable the agent forMySQL to support Solaris zones, ensure that you performthe following configuration steps:

■ Install MySQL on dedicated Solaris zones.

■ Preferably, follow the Symantec recommendation of installing zones on ashared disk for convenient configuration, failover, and maintenance.

Configuring the service groups for MySQLMySQL entities in a clustered environment

50

Page 51: Vcs Mysql Install

■ Make sure that the name of the Solaris zone is the same as the virtual hostname that you use to install and configure the MySQL.

■ In a VCS environment, ensure that you have set the value of ContainerNameattribute to the name of the Solaris zone.By default the agent function executes in the Global zone.

51Configuring the service groups for MySQLConfiguring MySQL resources for Solaris zones support

Page 52: Vcs Mysql Install

Configuring the service groups for MySQLConfiguring MySQL resources for Solaris zones support

52

Page 53: Vcs Mysql Install

Troubleshooting the agentfor MySQL

This chapter includes the following topics:

■ Using the correct software and operating system versions

■ Meeting prerequisites

■ Verifying virtualization

■ Starting the MySQL server outside a cluster

■ Reviewing error log files

Using the correct software and operating systemversions

Ensure that no issues arise due to incorrect software and operating systemversions.

For information on the software versions that the agent for MySQL supports, seethe Symantec Operations Readiness Tools (SORT)site:https://sort.symantec.com/agents.

Meeting prerequisitesBefore installing the agent for MySQL, double check that you meet theprerequisites.

For example, you must install the ACC library on VCS before installing the agentfor MySQL.

7Chapter

Page 54: Vcs Mysql Install

Install all the JBoss Application Server components including JBossWS-CXF.

See “Before you install the Veritas agent for MySQL” on page 23.

Verifying virtualizationVerify that your application does not use anything that ties it down to a particularnode of the cluster.

See “Virtualizing MySQL ” on page 20.

Starting the MySQL server outside a clusterIf you face problemswhileworkingwith a resource, youmust disable the resourcewithin the cluster framework. A disabled resource is not under the control of thecluster framework, and so you can test the MySQL database server independentof the cluster framework. Refer to the cluster documentation for informationabout disabling a resource.

Note: Use the same parameters that the resource attributes defined within thecluster framework while restarting the resource outside the framework, like theowner of the application, the environment file etc.

■ Starting the MySQL serverTo start the MySQL server outside cluster, execute:

$ BaseDir/bin/mysqld_safe --defaults-file=MyCnf \

--datadir=DataDir --user=MySQLUser &

■ Stopping the MySQL serverTo stop the MySQL server outside cluster, execute:$ BaseDir/bin/mysqladmin --user=MySQLAdmin \

--password=MySQLAdminPasswd shutdown

■ Monitoring the MySQL serverFirst verify that the MySQL processes are running as MySQLUser.

■ The agent uses a connect(3c) method to check for the MySQL server to listento the port defined by the Port attribute. Try doing$ telnet HostName Port

This should connect successfully.

■ The agent then uses the followingmonitor command to verify that theMySQLserver is up.

Troubleshooting the agent for MySQLVerifying virtualization

54

Page 55: Vcs Mysql Install

$ BaseDir/bin/mysqladmin --user=MySQLAdmin --password=XXXXXX status

Uptime: 2221700 Threads: 1 Questions: 35 Slow queries: 0 Opens:

28 Flush tables: 1 Open tables: 4 Queries per second avg: 0.000

$ echo $?

0

where XXXXXX is the password for the MySQLAdmin database user.The command is executed in the context of the MySQLUser. Try executingthis command manually to verify if the MySQL server is up.

Reviewing error log filesIf you face problems while using MySQL or the agent for MySQL, use the log filesdescribed in this section to investigate the problems.

The common reasons for issues are as follows:

Files that need to be created or written to may be created asMySQLUser.

Verify if necessary privileges have been set.

Insufficient privileges

Verify that ports have beenproperly configured anddeclared.Typically, ports from 1 through 1024 are reserved for thesuperuser.

Ensure that parameters to the agent are correctly defined.

Incorrectport, environmentor parameter settings

Check the application log files for any errormessages relatedto expired licenses.

Ensure that the license keys/files have been placed at theappropriate location, as needed by the application.

Expired licenses

Verify your installation.

Make sure that nothing is broken, and all dependencies forthe executables are met.

Broken symlinks, missingfiles, and libraries

Ensure that the file-system has sufficient space for creationof temporary files that the application might need.

Verify that the kernel has been tuned for sufficient IPCresources, file descriptors and meets the hardwarerequirement. Consult your product documentation for thesedetails.

Insufficient disk space orsystem parameters

Consult your application expert if needed.

55Troubleshooting the agent for MySQLReviewing error log files

Page 56: Vcs Mysql Install

Using MySQL log filesMySQL by default writes error logs at DataDir/HostName.err, where HostNameis the hostname of the node where the database is currently hosted.

Troubleshooting the agent for MySQLReviewing error log files

56

Page 57: Vcs Mysql Install

Sample Configurations

This appendix includes the following topics:

■ About sample configurations for the agent for MySQL

■ Sample agent type definition type for MySQL

■ Sample configuration files

■ Sample service group configurations for MySQL

About sample configurations for the agent forMySQLThe sample configuration graphically depicts the resource types, resources, andresource dependencies within the service group. Review these dependenciescarefully before configuring the agent for MySQL. For more information aboutthese resource types, see the Veritas Cluster Server Bundled Agents ReferenceGuide.

Sample agent type definition type for MySQLVCS 4.x

type MySQL (

static int ToleranceLimit = 1

static str ArgList[] = { ResLogLevel, State,

IState, MySQLUser, MySQLAdmin, MySQLAdminPasswd,

EnvFile, BaseDir, DataDir, MyCnf, HostName,

Port, SecondLevelMonitor, MonitorProgram }

str ResLogLevel = INFO

str MySQLUser = mysql

str MySQLAdmin = root

str MySQLAdminPasswd

AAppendix

Page 58: Vcs Mysql Install

str EnvFile

str BaseDir

str DataDir

str MyCnf

str HostName

int Port = 3306

int SecondLevelMonitor = 0

str MonitorProgram

)

VCS 5.0 (Solaris)

type MySQL (

static int ToleranceLimit = 1

static str ContainerType = Zone

static boolean AEPTimeout = 1

static str AgentFile = "/opt/VRTSvcs/bin/Script50Agent"

static str AgentDirectory = "/opt/VRTSagents/ha/bin/MySQL"

static str ArgList[] = { ResLogLevel, State, IState,

MySQLUser, MySQLAdmin, MySQLAdminPasswd, EnvFile,

BaseDir, DataDir, MyCnf, HostName, Port, SecondLevelMonitor,

MonitorProgram }

str ResLogLevel = INFO

str MySQLUser = mysql

str MySQLAdmin = root

str MySQLAdminPasswd

str EnvFile

str BaseDir

str DataDir

str MyCnf

str HostName

int Port = 3306

int SecondLevelMonitor = 0

str MonitorProgram

str ContainerName

)

VCS 5.x (AIX, Linux, HPUX)

type MySQL (

static int ToleranceLimit = 1

static boolean AEPTimeout = 1

static str AgentFile = "/opt/VRTSvcs/bin/Script50Agent"

static str AgentDirectory = "/opt/VRTSagents/ha/bin/MySQL"

Sample ConfigurationsSample agent type definition type for MySQL

58

Page 59: Vcs Mysql Install

static str ArgList[] = { ResLogLevel, State, IState,

MySQLUser,MySQLAdmin, MySQLAdminPasswd, EnvFile, BaseDir,

DataDir, MyCnf, HostName, Port, SecondLevelMonitor,

MonitorProgram }

str ResLogLevel = INFO

str MySQLUser = mysql

str MySQLAdmin = root

str MySQLAdminPasswd

str EnvFile

str BaseDir

str DataDir

str MyCnf

str HostName

int Port = 3306

int SecondLevelMonitor = 0

str MonitorProgram

)

VCS 5.1 (Solaris)

type MySQL (

static int ToleranceLimit = 1

static int ContainerOpts {} = { RunInContainer = 1,

PassCInfo = 0 }

static boolean AEPTimeout = 1

static str AgentFile = "/opt/VRTSvcs/bin/Script50Agent"

static str AgentDirectory = "/opt/VRTSagents/ha/bin/MySQL"

static str ArgList[] = { ResLogLevel, State, IState,

MySQLUser, MySQLAdmin, MySQLAdminPasswd, EnvFile,

BaseDir, DataDir, MyCnf, HostName, Port, SecondLevelMonitor,

MonitorProgram }

str ResLogLevel = INFO

str MySQLUser = mysql

str MySQLAdmin = root

str MySQLAdminPasswd

str EnvFile

str BaseDir

str DataDir

str MyCnf

str HostName

int Port = 3306

int SecondLevelMonitor = 0

str MonitorProgram

59Sample ConfigurationsSample agent type definition type for MySQL

Page 60: Vcs Mysql Install

Sample configuration filesA sample main.cf file for a configuration without zone support is as follows:

include "types.cf"

include "/etc/VRTSagents/ha/conf/MySQL/MySQLTypes50.cf"

cluster mysqls_cluster (

UserNames = { root = ajkIjgJg }

Administrators = { root }

)

system Node1 (

)

system Node2 (

)

group SG_MySQL (

SystemList = { Node1 = 0, Node2 = 1 }

)

DiskGroup RES_DiskGroup (

DiskGroup = mysqldb

)

IP RES_Ip (

Device = bge0

Address = "10.209.60.194"

NetMask = "0xfffffc00"

)

Mount RES_Mount (

MountPoint = "/opt/mysql/mysql/shared_data "

BlockDevice = "/dev/vx/dsk/mysqldb/mysql_vol"

FSType = vxfs

FsckOpt = "-y"

)

MySQL RES_MySQL (

MySQLAdmin = shutdown

MySQLAdminPasswd = iwoUlwL

BaseDir = "/opt/mysql/mysql"

DataDir = "/opt/mysql/mysql/shared_data"

MyCnf = "/etc/my.cnf"

HostName = mysqlhost

Port = 3307

)

NIC RES_Nic (

Device = bge0

NetworkHosts = { "10.209.60.1" }

Sample ConfigurationsSample configuration files

60

Page 61: Vcs Mysql Install

)

Volume RES_Volume (

Volume = mysql_vol

DiskGroup = mysqldb

)

RES_Ip requires RES_Nic

RES_Mount requires RES_Volume

RES_MySQL requires RES_Ip

RES_MySQL requires RES_Mount

RES_Volume requires RES_DiskGroup

// resource dependency tree

//

// group SG_MySQL

// {

// MySQL RES_MySQL

// {

// Mount RES_Mount

// {

// Volume RES_Volume

// {

// DiskGroup RES_DiskGroup

// }

// }

// IP RES_Ip

// {

// NIC RES_Nic

// }

// }

// }

A sample main.cf file for a configuration with zone support is as follows:

include "types.cf"

include "/etc/VRTSagents/ha/conf/MySQL/MySQLTypes50.cf"

cluster mysqls_cluster (

UserNames = { root = ajkIjgJg,

z_RESz_Zone_Node2 = eLKlLGlKKeMLjIJlMJ,

z_RESz_Zone_Node1 = ajhEisGegGimHhkJim }

Administrators = { root }

)

system Node1 (

)

61Sample ConfigurationsSample configuration files

Page 62: Vcs Mysql Install

system Node2 (

)

group SGz_MySQL (

SystemList = { Node1 = 0, Node2 = 1 }

Administrators = { z_RESz_Zone_Node2, z_RESz_Zone_Node1 }

)

DiskGroup RESz_Dg (

DiskGroup = mysql

)

Mount RESz_Mount (

MountPoint = "/zones/mysql/"

BlockDevice = "/dev/vx/dsk/mysql/mysql_vol_zone"

FSType = vxfs

FsckOpt = "-y"

)

MySQL RESz_MySQL (

ResLogLevel = TRACE

MySQLAdmin = mysql

MySQLAdminPasswd = iwoUlwL

BaseDir = "/opt/mysql/mysql/"

DataDir = "/var/lib/mysql/"

MyCnf = "/etc/my.cnf"

HostName = mysql

SecondLevelMonitor = 1

ContainerName = mysql

)

NIC RESz_NIC (

Device = bge0

)

Volume RESz_Vol (

Volume = mysql_vol_zone

DiskGroup = mysql

)

Zone RESz_Zone (

ZoneName = mysql

)

RESz_Mount requires RESz_Vol

RESz_MySQL requires RESz_Zone

RESz_Vol requires RESz_Dg

RESz_Zone requires RESz_Mount

RESz_Zone requires RESz_NIC

// resource dependency tree

Sample ConfigurationsSample configuration files

62

Page 63: Vcs Mysql Install

//

// group SGz_MySQL

// {

// MySQL RESz_MySQL

// {

// Zone RESz_Zone

// {

// Mount RESz_Mount

// {

// Volume RESz_Vol

// {

// DiskGroup RESz_Dg

// }

// }

// NIC RESz_NIC

// }

// }

// }

Sample service group configurations for MySQLThis section includes sample service groups configurations in aVCS environment.

Figure A-1 shows a service group with a MySQL instance running in a VCSenvironment.

63Sample ConfigurationsSample service group configurations for MySQL

Page 64: Vcs Mysql Install

Figure A-1 Sample service group for a MySQL instance

RES_MySQL

Mount

Volume

DiskGroup

IP

NIC

MySQL

RES_Mount

RES_Volume

RES_DiskGroup

RES_NIC

RES_IP

Figure A-2 shows a sample service group with Solaris zone support.

Sample ConfigurationsSample service group configurations for MySQL

64

Page 65: Vcs Mysql Install

Figure A-2 Sample service groups with Solaris zone support

RESz_MySQL

Mount

Volume

DiskGroup

Zone

NIC

MySQL

RESz_Mount

RESz_Volume

RESz_DiskGroup

RESz_NIC

RESz_Zone

65Sample ConfigurationsSample service group configurations for MySQL

Page 66: Vcs Mysql Install

Sample ConfigurationsSample service group configurations for MySQL

66

Page 67: Vcs Mysql Install

Aabout

configuring service groups 49about ACC library 24ACC library

installing 24removing 27

agentattributes 31clean function 16configuration 60features 12importing agent types files 29installing, VCS environment 25monitor function 15offline function 14online function 14overview 11service group configuration 63type definition 57uninstalling, VCS environment 26what’s new 12

agent configuration fileimporting 29

agent functionsimf_getnotification 39imf_init 39imf_register 39

agent installationgeneral requirements 23steps to install 25

Bbefore

configuring the service groups 49

Cconfiguring monitor function 35

Eexecuting custom monitor program 35

Iinstalling

MySQL 17Intelligent Monitoring Framework (IMF)

about 37agent functions 39attributes 39configuring 41troubleshooting 44

Llogs

reviewing error log files 55using MySQL logs 56

MMySQL

about 17configuring resources for Solaris zones 50entities 50installing 17virtualization 20

Host names 21Path names 21

MySQL entities, clustered environment 50

Rremoving agent, VCS environment 26

Ssetting

MySQL in a cluster 16Solaris zone support

configuring MySQLresources 50

Index

Page 68: Vcs Mysql Install

Ttroubleshooting

meeting prerequisites 53reviewing error log files 55

using MySQL log files 56using correct software 53verifying virtualization 54

Uuninstalling agent, VCS environment 26

Index68