- 论坛徽章:
- 0
|
Sybase的集群出来的较晚,我们也是较早使用Sybase集群的公司。因此有机会学习ASE Cluster Edition。我在网上发现有关Sybase集群的资料很少,所以把这次安装的过程记录下来,供大家参考。。。
此次使用两台Redhat5.2虚拟机作为ASE CE 节点(分别为sdc1,sdc2)。分别建了两个Cluster:
mycluster: 两个instance,分别跑在sdc1和sdc2上,两者共享存储。
my3nodes: 三个instance,都跑在sdc1上,使用本地文件系统。
为了实现上述目的,需要作如下准备:
1.sdc1,sdc2上分别使用sdc用户安装ASE CE。非常简单,比Oracle easy多了,基本上只要按回车就行。
2.共享存储分区情况:
sdc1,sdc2上使用fdisk将共享的/dev/sdb分区:
[root@sdc1 ~]# fdisk -l
Disk /dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 2479 19808145 83 Linux
/dev/sda3 2480 2610 1052257+ 82 Linux swap / Solaris
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 25 200781 83 Linux
/dev/sdb2 26 50 200812+ 83 Linux
/dev/sdb3 51 75 200812+ 83 Linux
/dev/sdb4 76 391 2538270 5 Extended
/dev/sdb5 76 100 200781 83 Linux
/dev/sdb6 101 125 200781 83 Linux
/dev/sdb7 126 150 200781 83 Linux
/dev/sdb8 151 175 200781 83 Linux
/dev/sdb9 176 200 200781 83 Linux
/dev/sdb10 201 225 200781 83 Linux
/dev/sdb11 226 250 200781 83 Linux
/dev/sdb12 251 275 200781 83 Linux
/dev/sdb13 276 300 200781 83 Linux
/dev/sdb14 301 325 200781 83 Linux
/dev/sdb15 326 391 530113+ 83 Linux
在sdc1,sdc2上分别进行裸设备绑定:
[root@sdc1 ~]# cat /etc/udev/rules.d/60-raw.rules
# This file and interface are deprecated.
# Applications needing raw device access should open regular
# block devices with O_DIRECT.
#
# Enter raw device bindings here.
#
# An example would be:
# ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N"
# to bind /dev/raw/raw1 to /dev/sda, or
# ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m"
# to bind /dev/raw/raw2 to the device with major 8, minor 1.
ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2", RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdb3", RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdb5", RUN+="/bin/raw /dev/raw/raw5 %N"
ACTION=="add", KERNEL=="sdb6", RUN+="/bin/raw /dev/raw/raw6 %N"
ACTION=="add", KERNEL=="sdb7", RUN+="/bin/raw /dev/raw/raw7 %N"
ACTION=="add", KERNEL=="sdb8", RUN+="/bin/raw /dev/raw/raw8 %N"
ACTION=="add", KERNEL=="sdb9", RUN+="/bin/raw /dev/raw/raw9 %N"
ACTION=="add", KERNEL=="sdb10", RUN+="/bin/raw /dev/raw/raw10 %N"
ACTION=="add", KERNEL=="sdb11", RUN+="/bin/raw /dev/raw/raw11 %N"
ACTION=="add", KERNEL=="sdb12", RUN+="/bin/raw /dev/raw/raw12 %N"
ACTION=="add", KERNEL=="sdb13", RUN+="/bin/raw /dev/raw/raw13 %N"
ACTION=="add", KERNEL=="sdb14", RUN+="/bin/raw /dev/raw/raw14 %N"
ACTION=="add", KERNEL=="sdb15", RUN+="/bin/raw /dev/raw/raw15 %N"
ACTION=="add", KERNEL=="raw*", WNER=="sdc", GROUP=="sdc", MODE=="0664"
重启sdc1和sdc2使之生效。
3.修改两个node的/etc/hosts
sdc1:
[root@sdc1 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
11.24.114.192 sdc1
11.24.114.182 sdc2
192.168.202.130 sdc1-priv1
192.168.202.131 sdc1-priv2
192.168.202.133 sdc1-priv3
192.168.202.134 sdc1-priv4
192.168.202.129 sdc2-priv1
sdc1-priv1和sdc2-priv1作为sdc1/sdc2在mycluster集群中的心跳IP,sdc1-priv2~sdc1-priv4作为sdc1在my3nodes集群的心跳IP。
sdc2:
[root@sdc2 ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
11.24.114.192 sdc1
11.24.114.182 sdc2
192.168.202.130 sdc1-priv1
192.168.202.129 sdc2-priv1
4.sdc1和sdc2上建立软连接,以便mycluster集群使用[sdc@sdc1 data]$ ll
total 0
-rw-r--r-- 1 sdc sdc 0 Dec 18 17:46 empty
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:13 master.dat -> /dev/raw/raw1
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:13 procs.dat -> /dev/raw/raw2
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:17 quorum.dat -> /dev/raw/raw5
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:29 sdc1_lst.dat -> /dev/raw/raw6
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:29 sdc2_lst.dat -> /dev/raw/raw7
lrwxrwxrwx 1 sdc sdc 13 Mar 31 04:19 sdc3_lst.dat -> /dev/raw/raw9
lrwxrwxrwx 1 sdc sdc 14 Mar 31 04:20 sdc4_lst.dat -> /dev/raw/raw10
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:13 sybsystem.dat -> /dev/raw/raw3
lrwxrwxrwx 1 sdc sdc 13 Mar 29 05:46 temp.dat -> /dev/raw/raw8
[sdc@sdc1 data]$ pwd
/opt/sdc/data
5. sdc1,sdc2上分别启动agent:
uafstartup.sh &
6.创建mycluster集群:
两个nodes(sdc1,sdc2),两个instance(inst01,inst02)集群mycluster的创建:
sybcluster -Uuafadmin -P -Cmycluster -Fsdc1,sdc2
> show agents
Verifying the supplied agent specifications...
Agent Information: service:jmx:rmi:///jndi/rmi://sdc1:9999/agent
-----------------------------------------------------
Node Name: sdc1
Agent Port: 9999
Agent Version: 2.5.0
Agent Build: 1003
OS Name: Linux
OS Version: 2.6.18-92.el5
OS Architecture: amd64
Agent Service Info:
Agent Service (Agent) Build: 1003 Status: running
BootstrapService (BootstrapService) Build: <unavailable> Status: running
Configuration Service (ConfigService) Build: 1003 Status: running
Deployment Service (DeploymentService) Build: 20 Status: running
Environment Service (EnvironmentDiscoveryService) Build: 1003 Status: running
File Transfer Service (FileTransferService) Build: 1003 Status: running
Plugin Registration Service (PluginRegisterService) Build: 1003 Status: running
RMI Service (RMIService) Build: 1003 Status: running
Remote Shell Service (RemoteShellService) Build: 1003 Status: running
Security Service (SecurityService) Build: 1003 Status: running
Self Discovery Service (SelfDiscoveryService) Build: 1003 Status: running
Service Registration Service (ServiceRegistrationService) Build: 1003 Status: running
Session Service (SessionService) Build: 1003 Status: running
Sybase Home Service (SybaseHomeService) Build: 14 Status: running
Agent Plugin Info:
Agent Information: service:jmx:rmi:///jndi/rmi://sdc2:9999/agent
-----------------------------------------------------
Node Name: sdc2
Agent Port: 9999
Agent Version: 2.5.0
Agent Build: 1003
OS Name: Linux
OS Version: 2.6.18-92.el5
OS Architecture: amd64
Agent Service Info:
Agent Service (Agent) Build: 1003 Status: running
BootstrapService (BootstrapService) Build: <unavailable> Status: running
Configuration Service (ConfigService) Build: 1003 Status: running
Deployment Service (DeploymentService) Build: 20 Status: running
Environment Service (EnvironmentDiscoveryService) Build: 1003 Status: running
File Transfer Service (FileTransferService) Build: 1003 Status: running
Plugin Registration Service (PluginRegisterService) Build: 1003 Status: running
RMI Service (RMIService) Build: 1003 Status: running
Remote Shell Service (RemoteShellService) Build: 1003 Status: running
Security Service (SecurityService) Build: 1003 Status: running
Self Discovery Service (SelfDiscoveryService) Build: 1003 Status: running
Service Registration Service (ServiceRegistrationService) Build: 1003 Status: running
Session Service (SessionService) Build: 1003 Status: running
Sybase Home Service (SybaseHomeService) Build: 14 Status: running
Agent Plugin Info:
> create cluster
Cluster mycluster - Enter the maximum number of instances: [ 4 ] 2
How many agents will participate in this cluster: [ 4 ] 2
Verifying the supplied agent specifications...
1) sdc1 9999 2.5.0 Linux
2) sdc2 9999 2.5.0 Linux
Enter the number representing the cluster node 1: [ 2 ] 1 1
2) sdc2 9999 2.5.0 Linux
Enter the number representing the cluster node 2: [ 2 ] 2
Will this cluster be configured using private SYBASE installations? (Y/N) : [ N ] y
------------------ Quorum Device ---------------------
The quorum device is used to manage a cluster. It contains information shared between instances and nodes.
Enter the full path to the quorum disk: /opt/sdc/data/quorum.dat
Enter any traceflags:
-------------------- Page Size --------------------
Enter the page size in kilobytes: [ 2 ] 4
--------------- Master Database Device ----------------
The master database device controls the operation of the Adaptive Server and stores information about all user databases and their associated database devices.
Enter the full path to the master device: /opt/sdc/data/master.dat
Enter the size the Master Device (MB): [ 60 ] 150
Enter the size the Master Database (MB): [ 26 ] 100
------------ Sybase System Procedure Device --------
Sybase system procedures (sybsystemprocs) are stored on a device.
Enter the System Procedure Device path: /opt/sdc/data/procs.dat
Enter System Procedure Device size (MB): [ 152 ]
Enter the System Procedure Database size (MB): [ 152 ]
-------------- System Database Device ------------------
The system database (sybsystemdb) stores information about distributed transactions.
Enter the System Database Device path: /opt/sdc/data/sybsystem.dat
Enter the System Database Device size (MB): [ 12 ] 50
Enter the System Database size (MB): [ 12 ] 50
--------------- PCI Device ----------------
Pluggable Component Interface (PCI) provides support for Java in database by loading off-the-shelf JVMs from any vendor. If you want to use JVM, create a device for it.
Enable PCI in Adaptive Servier (Y/N): [ N ]
--------------------------------------------------------
Does this cluster have a secondary network: [ Y ] n
Enter the port number from which this range will be applied: [ 15100 ]
--------------------------------------------------------
--------------------------------------------------------
You will now be asked for the instance information on a node by node basis.
-- Cluster: mycluster - Node: sdc1 - Agent: sdc1:9999 --
Enter the name of the cluster instance: inst01
Enter the Sybase installation directory on mycluster: [ /opt/sdc ]
Enter the environment shell script path on mycluster: [ /opt/sdc/SYBASE.sh ]
Enter the ASE home directory on mycluster: [ /opt/sdc/ASE-15_0 ]
Enter path to the dataserver config file: [ /opt/sdc/mycluster.cfg ]
Enter the interface file query port number for instance sdc1: 6001
Enter the primary protocol address for sdc1: [ sdc1 ] sdc1-priv1
--------------- Local System Temporary Database ---------
The Local System Temporary Database Device contains a database for each instance in the cluster.
Enter the LST device name: sdc1_lst
Enter the LST device path: /opt/sdc/data/sdc1_lst.dat
Enter LST device size (MB): 150
Enter the LST database name: [ mycluster_tdb_1 ]
Enter the LST database size (MB): [ 150 ]
-- Cluster: mycluster - Node: sdc2 - Agent: sdc2:9999 --
Enter the name of the cluster instance: inst02
Enter the Sybase installation directory on mycluster: [ /opt/sdc ]
Enter the environment shell script path on mycluster: [ /opt/sdc/SYBASE.sh ]
Enter the ASE home directory on mycluster: [ /opt/sdc/ASE-15_0 ]
Enter path to the dataserver config file: [ /opt/sdc/mycluster.cfg ]
Enter the interface file query port number for instance sdc2: 6001
Enter the primary protocol address for sdc2: [ sdc2 ] sdc2-priv1
--------------- Local System Temporary Database ---------
The Local System Temporary Database Device contains a database for each instance in the cluster.
Enter the LST device name: sdc2_lst
Enter the LST device path: /opt/sdc/data/sdc2_lst.dat
Enter LST device size (MB): 150
Enter the LST database name: [ mycluster_tdb_2 ]
Enter the LST database size (MB): [ 150 ]
Would you like to save this configuration information in a file? [ Y ]
Enter the name of the file to save the cluster creation information: [ /home/sdc/mycluster.xml ]
--------------------------------------------------------
Create the cluster now? [ Y ]
INFO - Creating the Cluster Agent plugin on host address sdc1 using agent: sdc1:9999
INFO - Creating the Cluster Agent plugin on host address sdc2 using agent: sdc2:9999
Enter the path to the Interfaces file on sdc1: [ /opt/sdc ]
Enter the path to the Interfaces file on sdc2: [ /opt/sdc ]
Would you like to check whether this device supports IO fencing capability (Y/N)? [ Y ]
Validating the device /opt/sdc/data/master.dat for IO Fencing Capabilities.
This device does not have SCSI-3 PGR capability. It does not support I/O fencing
Do you want to continue (Y/N)? [ N ] y
Validating the device /opt/sdc/data/procs.dat for IO Fencing Capabilities.
This device does not have SCSI-3 PGR capability. It does not support I/O fencing
Do you want to continue (Y/N)? [ N ] y
Validating the device /opt/sdc/data/sybsystem.dat for IO Fencing Capabilities.
This device does not have SCSI-3 PGR capability. It does not support I/O fencing
Do you want to continue (Y/N)? [ N ] y
INFO - Cluster "mycluster" creation in progress.
INFO - Choosing the first instance to be created using the connected agent...
INFO - The Sybase home directory is /opt/sdc.
INFO - The ASE home directory is /opt/sdc/ASE-15_0.
INFO - Retrieving environment variables from /opt/sdc/SYBASE.sh.
INFO - The first instance created will be sdc1.
INFO - Warning: You have selected '4k' as the logical page size for the Adaptive
INFO - Server. If you plan to load dump from another database, make sure this logical
INFO - page size matches the size of the source database. The default logical page
INFO - size in previous Adaptive Server versions was 2KB.
INFO - Warning: Unable to verify /opt/sdc/data/master.dat device size. Please verify
INFO - that this device is not already in use and that it has sufficient space
INFO - available.
INFO - Warning: Unable to verify /opt/sdc/data/procs.dat device size. Please verify
INFO - that this device is not already in use and that it has sufficient space
INFO - available.
INFO - Building Adaptive Server 'inst01':
INFO - Writing entry into directory services...
INFO - Directory services entry complete.
INFO - Building master device...
INFO - Master device complete.
INFO - Starting server...
INFO - Server started.
INFO - Building sysprocs device and sybsystemprocs database...
INFO - sysprocs device and sybsystemprocs database created.
INFO - Running installmaster script to install system stored procedures...
INFO - installmaster: 10% complete.
INFO - installmaster: 20% complete.
INFO - installmaster: 30% complete.
INFO - installmaster: 40% complete.
INFO - installmaster: 50% complete.
INFO - installmaster: 60% complete.
INFO - installmaster: 70% complete.
INFO - installmaster: 80% complete.
INFO - installmaster: 90% complete.
INFO - installmaster: 100% complete.
INFO - installmaster script complete.
INFO - Creating two-phase commit database...
INFO - Two phase commit database complete.
INFO - Installing common character sets (Code Page 437, Code Page 850, ISO Latin-1,
INFO - Macintosh and HP Roman- ...
INFO - Character sets installed.
INFO - Server 'inst01' was successfully created.
INFO - Connecting to the dataserver using the host and query port sdc1:6001.
INFO - Creating the Local System Temporary device sdc1_lst at /opt/sdc/data/sdc1_lst.dat of size 150M.
INFO - Creating the Local System Temporary device sdc2_lst at /opt/sdc/data/sdc2_lst.dat of size 150M.
INFO - sdc1: Creating the Local System Temporary database mycluster_tdb_1 on sdc1_lst of size 150M.
INFO - sdc2: Creating the Local System Temporary database mycluster_tdb_2 on sdc2_lst of size 150M.
INFO - The cluster is now configured. Shutting down this first instance.
The cluster mycluster was successfully created. |
|