您的位置:首页 > 其它

常用正则表达式

2008-10-07 16:31 316 查看
Ntpd For Oracle RAC

Client: /etc/ntp.conf

restrict default ignore

restrict 127.0.0.1

restrict 192.168.0.254

server 192.168.0.254

driftfile /var/lib/ntp/drift

broadcastdelay 0.008

Server: /etc/ntp.conf

restrict default nomodify

restrict 127.0.0.1

server 127.127.1.0

fudge 127.127.1.0 stratum 10

driftfile /var/lib/ntp/drift

broadcastdelay 0.008

@@@check the result, "*" represent it is successed.

#system-config-date

#chkconfig ntpd on

#ntpq

#ntpq> peer

*LOCAL(0)

#chkconfig ntpd on

Iscsi Share Disk For Oracle RAC

1)share disk for oracle RAC.

1@@@@the shared disk sender=> target...

@@@192.168.0.60

@@@install target packages.

[root@station60 Desktop]#yum -y install scsi-target-utils

[root@station60 Desktop]# service tgtd start

Starting SCSI target daemon: [ OK ]

[root@station60 Desktop]# chkconfig tgtd on

[root@station60 Desktop]# netstat -lntp | grep 3260

tcp 0 0 0.0.0.0:3260 0.0.0.0:* LISTEN 19170/tgtd

tcp 0 0 :::3260 :::* LISTEN 19170/tgtd

@@@write a service self-define to check the status of tgtd service.

@@@there are two shared disk for primary db rac and standby db rac.

####begin#####################################################

[root@station78 ~]# service tgtdrules status

Target 1: iqn.2012-03-27.com.example.station78:rac-sharedisk

System information:

Driver: iscsi

State: ready

I_T nexus information:

LUN information:

LUN: 0

Type: controller

SCSI ID: IET 00010000

SCSI SN: beaf10

Size: 0 MB, Block size: 1

Online: Yes

Removable media: No

Readonly: No

Backing store type: null

Backing store path: None

Backing store flags:

LUN: 1

Type: disk

SCSI ID: IET 00010001

SCSI SN: beaf11

Size: 24696 MB, Block size: 512

Online: Yes

Removable media: No

Readonly: No

Backing store type: rdwr

Backing store path: /dev/mapper/vg-sharedisk

Backing store flags:

Account information:

ACL information:

192.168.0.3

192.168.0.4

Target 2: iqn.2012-06-01.com.example.station78:rac-sharedisk_maa

System information:

Driver: iscsi

State: ready

I_T nexus information:

LUN information:

LUN: 0

Type: controller

SCSI ID: IET 00020000

SCSI SN: beaf20

Size: 0 MB, Block size: 1

Online: Yes

Removable media: No

Readonly: No

Backing store type: null

Backing store path: None

Backing store flags:

LUN: 1

Type: disk

SCSI ID: IET 00020001

SCSI SN: beaf21

Size: 21475 MB, Block size: 512

Online: Yes

Removable media: No

Readonly: No

Backing store type: rdwr

Backing store path: /dev/mapper/vg-sharedisk_maa

Backing store flags:

Account information:

ACL information:

192.168.0.5

192.168.0.6

######end#####################################################

2@@@@the shared disk receiver

@@@192.168.0.61 (192.168.0.0/24 share the disk,too.)

@@@install initated packages

[root@station61 Desktop]# yum list "*initiat*"

[root@station61 Desktop]# yum -y install iscsi-initiator-utils.i686

[root@station60 Desktop]# service iscsid restart

Stopping iscsid: Starting iscsid: [ OK ]

@@@

@@@you could write the statement below to /etc/fstab for startup.

#vim /etc/fstab

/dev/sdb1 /iscsidirectory ext4 _netdev 0 0

3@@@@self-define a service to computer(which send share disk) startup each time.

@@@target

####begin#############################################

[root@station78 init.d]# cat tgtdrules

#!/bin/bash

# /etc/rc.d/init.d/oracle

# chkconfig: - 59 85

# description: oracle9id is meant to run under Linux Oracle Server

# Source function library.

. /etc/rc.d/init.d/functions

start() {

echo -e "Starting Tgtdrules Server:\n"

# Target

tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2012-03-27.com.example.station78:rac-sharedisk

tgtadm --lld iscsi --op new --mode target --tid 2 -T iqn.2012-06-01.com.example.station78:rac-sharedisk_maa

# Lun

tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/mapper/vg-sharedisk

tgtadm --lld iscsi --op new --mode logicalunit --tid 2 --lun 1 -b /dev/mapper/vg-sharedisk_maa

# Init

tgtadm --lld iscsi --op bind --mode target --tid 1 -I 192.168.0.3

tgtadm --lld iscsi --op bind --mode target --tid 1 -I 192.168.0.4

tgtadm --lld iscsi --op bind --mode target --tid 2 -I 192.168.0.5

tgtadm --lld iscsi --op bind --mode target --tid 2 -I 192.168.0.6

}

stop() {

echo -e "Stopping Tgtdrules Server:\n"

# Init

tgtadm --lld iscsi --op unbind --mode target --tid 1 -I ALL

tgtadm --lld iscsi --op unbind --mode target --tid 2 -I ALL

# Lun

tgtadm --lld iscsi --op delete --mode logicalunit --tid 1 --lun 1

tgtadm --lld iscsi --op delete --mode logicalunit --tid 2 --lun 2

# Target

tgtadm --lld iscsi --op delete --mode target --tid 1

tgtadm --lld iscsi --op delete --mode target --tid 2

}

status() {

tgtadm --lld iscsi --mode target --op show

}

case "$1" in

start) start ;;

stop) stop ;;

status) status ;;

*) echo "please input {start|stop|status}";;

esac

exit 0

######end#############################################

4@@@@receiver(which receive share disk)

@@@initated

####begin#############################################

[root@station78 Node_RHEL5.4_32_preinstallation]# cat iscsiadmrules

#!/bin/sh

#

# chkconfig: 400 15 99

# description: Logs into iSCSI targets needed at system startup

#

# Source function library.

. /etc/init.d/functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin

start()

{

iscsiadm --mode discovery --type sendtargets --portal 192.168.0.78

iscsiadm --mode node --targetname iqn.2012-03-27.com.example.station78:rac-sharedisk --portal 192.168.0.78:3260 --login

}

stop()

{

iscsiadm --mode discovery --type sendtargets --portal 192.168.0.78

iscsiadm --mode node --targetname iqn.2012-03-27.com.example.station78:rac-sharedisk --logout

}

case "$1" in

start)

start

;;

stop)

stop

;;

restart)

stop

start

;;

status)

status iscsid

;;

condrestart)

[ -f /var/lock/subsys/iscsi ] && restart

;;

*)

echo $"Usage: $0 {start|stop|restart|status|condrestart}"

exit 1

esac

exit

######end#############################################

chmod +x /etc/rc.d/init.d/iscsiadmrules

chkconfig iscsiadmrules on

本文出自 “Oracle+Linux=>Majesty” 博客,请务必保留此出处http://majesty.blog.51cto.com/3493901/806225
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: