Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

NetBackup

MySQL Backup
VCenterdan ilk önce 5GiB'lk thin disk eklenir. Master'a direk gidiyorsa 15GiB'lk thin alan verilebilir.

Disk tantlr. phsyical alan oluturulur. volume group extend edilir.

fdisk -l
fdisk /dev/sdc (n p t 8e)
pvcreate /dev/sdc1
vgs
vgextend
vg_sql /dev/sdc1
vgs

kurulum yaplacak dosyalar makineye gönderilir.

scp -r 10.35.72.147:/opt/netbackup/NetBackup_8.1.2_CLIENTS2 .
scp -r 10.35.72.147:/opt/netbackup/NBMySQLAgent_8.1.2.zip .

NetBackup_8.1.2_CLIENTS2 kurulumu yaplr.

cd NetBackup_8.1.2_CLIENTS2/ ./install (yes, yes, aslvrtpbck02.host.gittigidiyor.net, yes)

NBMySQLAgent_8.1.2 kurulumu yaplr.

unzip NBMySQLAgent_8.1.2.zip cd NBMySQLAgent_8.1.2_linuxR_x86/ ./install (yes)

vim /usr/NBMySQLAgent/nbmysql.conf dosyas düzenlenir.


vim /usr/NBMySQLAgent/nbmysql.conf

# $Header$ */

# $Copyright: Copyright (c) 2018 Veritas Technologies LLC. All rights reserved $

# Filename: nbmysql.conf
# NetBackup MySQL Agent configuration file

[MySQL Database server parameters]


#--------------------------------------------------------------------------------------------------------
----
# MySQL Database username.
# Configure this parameter for backup and for restoring mysqldump backups.
# eg., DB_USER=dbuser. If not configured, default value of "root" is considered.
# Configure and uncomment this parameter to override the default value.
#--------------------------------------------------------------------------------------------------------
----
# DB_USER=root
DB_USER=nbbackup

#--------------------------------------------------------------------------------------------------------
----
# MySQL Database server port number.
# Configure this parameter for backup and restore.
# eg., DB_PORT=3307. If not configured, default value of "3306" is considered.
# Configure and uncomment this parameter to override the default value.
#--------------------------------------------------------------------------------------------------------
----
DB_PORT=3306

#--------------------------------------------------------------------------------------------------------
----
# MySQL Library path
# Configure this parameter for backup.
# On Windows, configure this parameter to point to libmysql.dll. eg., MYSQL_LIB_INSTALL_PATH=C:\Program
Files\MySQL\MySQL Server 5.7\lib
# On Linux, configure this parameter to point to libmysqlclient.so. eg., MYSQL_LIB_INSTALL_PATH=/usr
/lib64/mysql
#--------------------------------------------------------------------------------------------------------
----
# MYSQL_LIB_INSTALL_PATH=
MYSQL_LIB_INSTALL_PATH=/usr/lib64

[NetBackup parameters]
#--------------------------------------------------------------------------------------------------------
----
# Identifies the host name for the NetBackup Master Server.
# Configure this parameter for all operations - backup. restore, query and delete.
# eg., MASTER_SERVER_NAME=nb_master
#--------------------------------------------------------------------------------------------------------
----
# MASTER_SERVER_NAME=
MASTER_SERVER_NAME=aslvrtpbck02.host.gittigidiyor.net

#--------------------------------------------------------------------------------------------------------
----
# Identifies a specific NetBackup datastore policy name to be used.
# Configure this parameter for backup and query.
# eg., POLICY_NAME=datastore_policy
#--------------------------------------------------------------------------------------------------------
----
# POLICY_NAME=
POLICY_NAME=A_MYSQL_ELKPMYQ01

#--------------------------------------------------------------------------------------------------------
----
# Identifies the Default Application Backup schedule name associated with the
# datastore policy name provided by POLICY_NAME.
# Configure this parameter for backup.
# eg., SCHEDULE_NAME=Default-Application-Backup
#--------------------------------------------------------------------------------------------------------
----
# SCHEDULE_NAME=
SCHEDULE_NAME=full

#--------------------------------------------------------------------------------------------------------
----
# Identifies the host name for the NetBackup Client.
# Configure this parameter for redirected restores and to query for backup information specific to a
client.
# eg., CLIENT_NAME=nb_client. If not configured, default value will be current hostname.
#--------------------------------------------------------------------------------------------------------
----
# CLIENT_NAME=
CLIENT_NAME=aslelkpmyq01.host.gittigidiyor.net

[NetBackup MySQL Agent Parameters]


#--------------------------------------------------------------------------------------------------------
----
# Identifies the snapshot size for LVM snapshots.
# Configure this parameter for backup on Linux systems configured with LVM.
# eg., SNAPSHOT_SIZE=500M (The value should be suffixed with K, M or G for KB, MB and GB respectively).
# By default, the size will be set in MB
#--------------------------------------------------------------------------------------------------------
----
# SNAPSHOT_SIZE=
SNAPSHOT_SIZE=4G

#--------------------------------------------------------------------------------------------------------
----
# Identifies the Backup Id or Copy Id.
# This value can be retrieved by performing a query operation.
# Configure this parameter to restore backups associated with this Backup Id or Copy Id.
# eg., COPY_ID=1500234512
#--------------------------------------------------------------------------------------------------------
----
# COPY_ID=

#--------------------------------------------------------------------------------------------------------
----
# Identifies the target directory for restores.
# Configure this parameter for restore.
# Please ensure that it is a valid MySQL instance data directory. Otherwise the user will have to
# manually copy it over to the appropriate MySQL instance data directory after restore is completed
# and then start the MySQL service.
# On Linux alone, after copying the restored files over to the appropriate MySQL instance data
directory,
# please change the files/directories ownership and group to "mysql" before restarting the MySQL service.
# $chown -R mysql <data_dir> #changes the ownership to "mysql"
# $chgrp -R mysql <data_dir> #changes the group to "mysql"
# On Windows, eg., MYSQL_TARGET_DIRECTORY=C:\ProgramData\MySQL\MySQL Server 5.7\data
# On Linux, eg., MYSQL_TARGET_DIRECTORY=/var/lib/mysql
#
---------------------------------------------------------------------------------------------------------
--
# MYSQL_TARGET_DIRECTORY=

[NetBackup MySQL Agent Log Parameters]


#--------------------------------------------------------------------------------------------------------
----
# Log verbose level for nbmysql.
# Values can range from 1 - 4.
# 1 - ERR, 2 - WARN, 3 - INFO, 4 - DEBUG
# eg., NBMYSQL_LOG_LEVEL=3. If not configured or if the value is outside the range 1 - 4, the default
value is set to "1".
# Configure and uncomment this parameter to override the default value.
#--------------------------------------------------------------------------------------------------------
----
# NBMYSQL_LOG_LEVEL=1
NBMYSQL_LOG_LEVEL=4

#--------------------------------------------------------------------------------------------------------
----
# Log size for nbmysql.log in MB.
# nbmysql.log will be generated in the nbmysql install directory .
# eg., NBMYSQL_LOG_SIZE=20. If not configured, the default size is set to 10MB.
# Configure and uncomment this parameter to override the default value.
#--------------------------------------------------------------------------------------------------------
----
# NBMYSQL_LOG_SIZE=10

mysql_netbackup scriptinin hazrlanr.

cd /usr/openv/netbackup/ext/db_ext/
mkdir mysql
chown root.bin mysql
cd mysql/
vim mysql_netbackup
chown root.bin mysql_netbackup
chmod 777 mysql_netbackup

mysql_netbackup Scriptinin içerii aadaki gibidir.

mysql_netbackup

#!/bin/sh

#bcpyrght
#***************************************************************************
#* $Copyright: Copyright (c) 2017 Veritas Technologies LLC. All rights reserved VT25-0977-2658-84-51-3 $
*
#***************************************************************************
#ecpyrght

#NOTE:This is sample script can be changed according to the environment

RETURN_STATUS=0

echo "Execute $CMD_LINE"


CMD_LINE="/usr/NBMySQLAgent/nbmysql -o backup -S aslvrtpbck02.host.gittigidiyor.net -P A_MYSQL_ELKPMYQ01
-s fullc -l /usr/lib64 -z 4G"

echo "Execute $CMD_LINE"

su root -c "$CMD_LINE"

RETURN_STATUS=$?

exit $RETURN_STATUS

sudoers dosyann içeriine aadaki ifade eklenir.

vim /etc/sudoers
Defaults:root !requiretty
nbbackup usernn mysql_config_editor

mysql_config_editor set --login-path=3306 --host=localhost --user=nbbackup --password cp .mylogin.cnf /usr/NBMySQLAgent/

ln -s libperconaserverclient.so.18 libmysqlclient.so linklenir.

ASWVIRPVCA02 makinesine balanlr. Yeni policy oluturulur. Varolan policyde kopyalanp, gerekli deiiklikler yaplabilir.

Örnek Attributes ayarlar aadaki görseldeki gibidir. policy storage ayaralarna NetBackup Management Stroge Stroge Lifecycle
Policies bölümünden ulaabilirsiniz.

Örnek Schedules ayarlar aadaki görseldeki gibidir.


Clients ksmna makinenin Client Name'e makine ismi girilir.

Backup Selections ksmna aadaki path listelenir.

/usr/openv/netbackup/ext/db_ext/mysql/mysql_netbackup

You might also like