LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-21-2016, 09:50 AM   #1
Arthur Cheng
LQ Newbie
 
Registered: Apr 2016
Posts: 1

Rep: Reputation: Disabled
pacemaker corosynce lsb resource script( Sybase Database ASE Server and Backup Server)


Hello

I'm trying to create a lsb resource with pcs on rhel7.2 The "sybase" script is about Sybase Database ASE Server and Backup Server Startup & Stop & Restart $ status script

The script is all pass
http://clusterlabs.org/doc/en-US/Pac...ed/ap-lsb.html
, but it doesn't work!

[root@pldbsv01 ~]# pcs resource create ase157_res lsb:sybase op monitor interval=30s
[root@pldbsv01 ~]# pcs constraint order start gfs2sybasedata_res-clone then ase157_res
Adding gfs2sybasedata_res-clone ase157_res (kind: Mandatory) (Options: first-action=start then-action=start)

[root@pldbsv01 ~]# pcs constraint colocation add ase157_res with gfs2sybasedata_res-clone
[root@pldbsv01 ~]# pcs status
Cluster name: PLDBSV_CLUSTER
Last updated: Wed Apr 20 12:22:51 2016 Last change: Wed Apr 20 12:20:18 2016 by root via cibadmin on pldbsv01-cr
Stack: corosync
Current DC: pldbsv01-cr (version 1.1.13-10.el7-44eb2dd) - partition with quorum
2 nodes and 10 resources configured

Online: [ pldbsv01-cr pldbsv02-cr ]

Full list of resources:

Resource Group: PLDBSV_RESOURCE
PLDBSV_VIP (ocf::heartbeat:IPaddr2): Started pldbsv02-cr
idrac-pldbsv01 (stonith:fence_ipmilan): Started pldbsv01-cr
idrac-pldbsv02 (stonith:fence_ipmilan): Started pldbsv01-cr
Clone Set: dlm-clone [dlm]
Started: [ pldbsv02-cr ]
Stopped: [ pldbsv01-cr ]
Clone Set: clvmd-clone [clvmd]
Started: [ pldbsv02-cr ]
Stopped: [ pldbsv01-cr ]
Clone Set: gfs2sybasedata_res-clone [gfs2sybasedata_res]
Started: [ pldbsv02-cr ]
Stopped: [ pldbsv01-cr ]
ase157_res (lsb:sybase): Stopped

Failed Actions:
* ase157_res_start_0 on pldbsv02-cr 'unknown error' (1): call=41, status=Timed Out, exitreason='none',
last-rc-change='Wed Apr 20 12:21:35 2016', queued=0ms, exec=20002ms
* ase157_res_start_0 on pldbsv01-cr 'unknown error' (1): call=45, status=Timed Out, exitreason='none',
last-rc-change='Wed Apr 20 12:19:56 2016', queued=0ms, exec=20002ms



PCSD Status:
pldbsv01-cr: Online
pldbsv02-cr: Online

Daemon Status:
corosync: active/enabled
pacemaker: active/enabled
pcsd: active/enabled






My scripts

#!/bin/sh
#
# Startup script for Sybase ASE
# Description: Service script for starting/stopping/monitoring \
# Sybase Adaptive Server on: \
# Red Hat Enterprise Linux 6 \
# Release date 2015-08-11
# Version 1
# Processname: dataserver
# (1) Before running this script, we assume that user has installed
# Sybase ASE 15.0.2 or higher version on the machine.
# (2) This script should be put under /etc/init.d. Its owner should be "root" with
# execution permission.
# (3) You must define the variables "SYBASE" "SERVER" BACKUPSERVER"
# (4) You can change Adaptive Server login name and password in line 96,
# defaults are "sa" and "sybase"



SYBASE=/opt/sybase
SERVER=PLDBSV
BACKUPSERVER=PLDBSV_BS

# Source environment variables.
. $SYBASE/SYBASE.sh


# Find the name of the script
NAME=`basename $0`


# For SELinux we need to use 'runuser' not 'su'
if [ -x /sbin/runuser ]
then
SU=runuser
else
SU=su
fi


# Start sybase Adaptive Server and Backup Server
start() {
SYBASE_ASE_START=$"Starting ${NAME} Adaptive Server: "
$SU sybase -c ". $SYBASE/SYBASE.sh; $SYBASE/$SYBASE_ASE/install/startserver \
-f $SYBASE/$SYBASE_ASE/install/RUN_${SERVER} > /dev/null"
ret=$?
if [ $ret -eq 0 ]
then
echo -n "$SYBASE_ASE_START ["
echo -n -e "\033[32m Success \033[0m"
echo "]"
else
echo -n "$SYBASE_ASE_START ["
echo -n -e "\033[31m Failed \033[0m"
echo "]"
exit 1
fi

for ((i=1; i<31; i++))
do
sleep 1
echo "waitting $i sec to prepare Backup Server!"
done

SYBASE_BS_START=$"Starting ${NAME} Backup Server: "
$SU sybase -c ". $SYBASE/SYBASE.sh; $SYBASE/$SYBASE_ASE/install/startserver \
-f $SYBASE/$SYBASE_ASE/install/RUN_${BACKUPSERVER} > /dev/null"
ret=$?
if [ $ret -eq 0 ]
then
echo -n "$SYBASE_BS_START ["
echo -n -e "\033[32m Success \033[0m"
echo "]"
else
echo -n "$SYBASE_BS_START ["
echo -n -e "\033[31m Failed \033[0m"
echo "]"
exit 1
fi
}

#stop sybase adaptive server and backup server
stop() {
SYBASE_BS_STOP=$"Stopping ${NAME} Backup Server"
pid=$(pidof backupserver)
if [ $pid > 0 ]
then
$SU root -c "kill -9 $pid > /dev/null"
echo -n "$SYBASE_BS_STOP ["
echo -n -e "\033[32m Success \033[0m"
echo "]"
else
echo -n "$SYBASE_BS_STOP ["
echo -n -e "\033[31m Failed \033[0m"
echo "]"
fi

SYBASE_ASE_STOP=$"Stopping ${NAME} Adaptive Server: "
$SU sybase -c ". $SYBASE/SYBASE.sh; isql -S $SERVER -U sa -P sybase < \
$SYBASE/$SYBASE_ASE/upgrade/shutdown.sql > /dev/null"
ret=$?
if [ $ret -eq 0 ]
then
echo -n "$SYBASE_ASE_STOP ["
echo -n -e "\033[32m Success \033[0m"
echo "]"
else
echo -n "$SYBASE_ASE_STOP ["
echo -n -e "\033[31m Failed \033[0m"
echo "]"
exit 0
fi
}

restart() {
stop
start
}

# Check Sybase Adaptive Server and Backup Server status
status() {
dataserver=$(pidof dataserver)
backupserver=$(pidof backupserver)
if [ -n "$dataserver" ]; then
echo "sybase Adaptive Server is running!"
else
echo "sybase Adaptive Server is stopped!"

fi

if [ -n "$backupserver" ]; then
echo "sybase Backup Server is running!" && exit 0 || exit $?
else
echo "sybase Backup Server is stopped!"
exit 3
fi
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac


how to solve the problem ? Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sybase ASE install on Ubuntu problem marinav Linux - Newbie 3 02-06-2010 05:19 AM
Script to Backup MySQL Database on Server Automatically ? Hammad101 Linux - Server 7 12-23-2008 12:52 PM
whith sybase ase is instalable on suse10? samba4010 Linux - Software 1 07-29-2006 07:34 AM
Sybase ASE Express startup issue lacerto Linux - Software 0 09-16-2004 04:00 PM
Need script to dump database, ftp file to backup server glock19 Linux - Networking 17 05-12-2003 05:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration