차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
| cubrid_rhcs를_통한_클러스터링 [2017/02/07 00:45] – 만듦 koov | cubrid_rhcs를_통한_클러스터링 [2017/02/07 00:49] (현재) – koov | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== Cubrid RHCS를 통한 클러스터링 ====== | ====== Cubrid RHCS를 통한 클러스터링 ====== | ||
| + | 일반적인 RHCS구축 후 큐브리드 DB 제어를 위한 Cluster Resource Script 파일은 아래와 같이 구성하면 된다. | ||
| + | 큐브리드에서 제공하는 init.d 스크립트로는 적용할 수가 없다. | ||
| + | <WRAP prewrap> | ||
| + | <code vim cubrid.sh> | ||
| + | #!/bin/bash | ||
| + | |||
| + | # | ||
| + | # Copyright Red Hat Inc., 2002 | ||
| + | # Copyright Mission Critical Linux, 2000 | ||
| + | # | ||
| + | # This program is free software; you can redistribute it and/or modify it | ||
| + | # under the terms of the GNU General Public License as published by the | ||
| + | # Free Software Foundation; either version 2, or (at your option) any | ||
| + | # later version. | ||
| + | # | ||
| + | # This program is distributed in the hope that it will be useful, but | ||
| + | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| + | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| + | # General Public License for more details. | ||
| + | # | ||
| + | # You should have received a copy of the GNU General Public License | ||
| + | # along with this program; see the file COPYING. If not, write to the | ||
| + | # Free Software Foundation, Inc., 675 Mass Ave, Cambridge, | ||
| + | # MA 02139, USA. | ||
| + | # | ||
| + | # | ||
| + | # Author: Gregory P. Myrdal | ||
| + | # | ||
| + | |||
| + | # | ||
| + | # This file contains a template that you can use to create a script | ||
| + | # that will start, stop and monitor an application used in a cluster \\ | ||
| + | # service. | ||
| + | # | ||
| + | |||
| + | # | ||
| + | # Variable definitions | ||
| + | # | ||
| + | MYNAME=$(basename $0) | ||
| + | # The clug utility uses the normal logging levels as defined in | ||
| + | # sys/ | ||
| + | # for the Service Manager (clusvcmgrd). | ||
| + | LOG_EMERG=0 # system is unusable | ||
| + | LOG_ALERT=1 # action must be taken immediately | ||
| + | LOG_CRIT=2 # critical conditions | ||
| + | LOG_ERR=3 # error conditions | ||
| + | LOG_WARNING=4 # warning conditions | ||
| + | LOG_NOTICE=5 # normal but significant condition | ||
| + | LOG_INFO=6 # informational | ||
| + | LOG_DEBUG=7 # debug-level messages | ||
| + | |||
| + | # | ||
| + | # Start of execution | ||
| + | # | ||
| + | if [ $# -ne 1 ]; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | action=$1 # type of action, i.e. ' | ||
| + | |||
| + | # Record all output into a temp file in case of error | ||
| + | exec > / | ||
| + | |||
| + | clulog -s $LOG_DEBUG "In $0 with action=$action," | ||
| + | |||
| + | case $action in | ||
| + | ' | ||
| + | clulog -s $LOG_INFO " | ||
| + | # <<< | ||
| + | / | ||
| + | exit $? | ||
| + | ;; | ||
| + | ' | ||
| + | clulog -s $LOG_INFO " | ||
| + | # <<< | ||
| + | / | ||
| + | exit $? | ||
| + | ;; | ||
| + | ' | ||
| + | clulog -s $LOG_INFO " | ||
| + | # <<< | ||
| + | / | ||
| + | RETVAL=$? | ||
| + | if [ $RETVAL -eq 0 ]; then | ||
| + | exit 1 | ||
| + | fi | ||
| + | exit 0 | ||
| + | ;; | ||
| + | *) | ||
| + | clulog -s $LOG_ERR " | ||
| + | exit 1 # return failure | ||
| + | esac | ||
| + | </ | ||
| + | </ | ||