Конфигурирование Active-Standby pair репликации и Oracle Clusterware
Ограничения: В данном примере описывается создание простой конфигурации (basic level of availability).
Вначале добавим сущность в cluster.oracle.ini, в которой пропишем узлы, на которых будет запущена репликация, и директорию для CRS-скриптов (check, start, stop) для определенной репликации). … [ha_ds] MasterHosts=rac1,rac2 ScriptInstallDir=/u01/app/oracle/product/11.2.1/TimesTen/tt1/info/crs_scripts …
Теперь нужно повторить настройки cluster.oracle.ini и sys.odbc.ini на втором узле (rac2). Далее регистрируем TimesTen кластер в OCR.
[root@rac1 ~]$ cd /u01/app/oracle/product/11.2.1/TimesTen/tt1/bin/
[root@rac1 bin]$ ./ttCWAdmin -ocrconfig
Oracle Clusterware home = /u01/app/oracle/product/11.1.0/crs
Далее запускаем агенты кластера TimesTen на обоих узлах. [root@rac1 bin]$ ./ttCWAdmin -init
Теперь создадим Active-Standby pair репликацию. Данную репликацию можно создать двумя способами: используя команду create active standby pair replication или с помощью ttCWAdmin, но не обоими одновременно! В данном случае создавать и управлять репликацией будем с помощью ttCWAdmin. При запросе имени пользователя с привилегией ADMIN вводим имя adm (создан на этапе создания базы данных и объектов). [root@rac1 bin]$ ./ttCWAdmin -create -dsn ha_ds
Successful connection with Oracle clusterware stack replication DDL = create active standby pair "HA_DS" on "rac1","HA_DS" on "rac2" Enter internal UID with ADMIN privileges: adm Enter password for the same UID: Enter any phrase for password encryption: Uid/Pwd verified on host rac1 Create active standby pair scheme on this host? (Y/N)Y Waiting for confirmation from hosts... Active Standby pair created on host rac1 ================================================================== Warning!! Data store on host(s) rac2 may be destroyed in order to be duplicated from active after the roll out. Please back up this data store manually if necessary, before executing ttCWAdmin -start Command ================================================================== Registering TimesTen Cluster with Oracle Clusterware ================================================================== Number of unregistered dsn resources = 2 Registering dsn resources:... Registration complete. ================================================================== ================================================================== Number of unregistered service resources = 2 Registering service resources:... Registration complete. ================================================================== [root@rac1 bin]$
После этого в CRS появятся еще четыре сервиса, связанные непосредственно с репликацией HA_DS. Также можно заметить, что два из них не запущены - имеют статусы OFFLINE.
[oracle@rac1 info]$ crs_stat -t
Name Type Target State Host ------------------------------------------------------------ TT_A...e_HA_DS application ONLINE ONLINE rac1
Также после этого в директории, прописанной в файле конфигурации репликации (cluster.oracle.ini), появится ряд CRS-файлов (start, stop, check) для определенной репликации. [oracle@rac2 crs_scripts]$ ls
Status of Cluster related to DSN HA_DS: ==================================================================== 1. Status of Cluster monitoring components: Monitor Process for Master Datastore 1 on Host RAC1: NOT RUNNING Monitor Process for Master Datastore 2 on Host RAC2: NOT RUNNING Monitor Process for Active datastore:RUNNING on Host rac1 Monitor Process for Standby datastore:RUNNING on Host rac1
2.Status of Datastores comprising the cluster Master Datastore 1: Host:RAC1 Status:AVAILABLE State:ACTIVE Master Datastore 2: Host:RAC2 Status:UNAVAILABLE State:UNKNOWN ==================================================================== The cluster containing the replicated DSN is offline
Видим, что агенты кластера Oracle TimesTen запущены, репликация существует, но она не запущена. Теперь запустим нашу репликацию. [root@rac1 bin]$ ./ttCWAdmin -start -dsn ha_ds
Successful connection with Oracle clusterware stack Starting Cluster resources with Oracle clusterware TimesTen Cluster is starting [root@rac1 bin]$
Проверим статус репликации. [root@rac1 bin]$ ./ttCWAdmin –status
TimesTen Cluster status report as of Sat Feb 27 14:49:00 2010 ================================================================== TimesTen daemon monitors: Host:RAC1 Status: online Host:RAC2 Status: online
================================================================== Status of Cluster related to DSN HA_DS: ================================================================== 1. Status of Cluster monitoring components: Monitor Process for Master Datastore 1 on Host rac1: RUNNING Monitor Process for Master Datastore 2 on Host rac2: RUNNING Monitor Process for Active datastore:RUNNING on Host rac1 Monitor Process for Standby datastore:RUNNING on Host rac2
2. Status of Datastores comprising the cluster Master Datastore 1: Host:rac1 Status:AVAILABLE State:ACTIVE Master Datastore 2: Host:rac2 Status:AVAILABLE State:STANDBY ================================================================== The cluster containing the replicated DSN is online
Видно, что реплицируемая база данных находится в состоянии online. Узлы находятся в состояниях Active и Standby. Проверим CRS. [oracle@rac1 info]# crs_stat -t