###################################################
##                                               ##
##           ForestRecovery README               ##
##                                               ##
###################################################

(1)ܥץˤĤ

PostgresForest۲DB˾㳲ȯݤΡǡΥꥫХԤ
ǤޤʣDBФưʣˤʤ꤬PostgresForestΥ
ưפ˼¸뤳ȤǤޤꥫХϡAPˤȥ
󥶥ߤ뤳ȤʤǡԤȤǤޤ

ʤư³DBФΥǡƥץ졼ȤȤΥǡ
١إǡžǼޤΥȥ󥶥ˤĤƤ⡢
󥰤ȤΥŬѤԤǿΤȤ줿֤ǥǡ١
ΥꥫХԤޤ


(2)Ϣե

󥹥ȡǥ쥯ȥ$FOREST_ROOTȤʲΥե뤬ɬ
Ȥʤޤ󥹥ȡˤäƲեΰŬڤʲս
˥󥹥ȡѤߤʤᡢꥫХ¹ԤݤˤɬɬפǤϤ
ޤ(㡧PostgreSQLΥ桼ؿȤ褦Υ饤֥ʤɡ

    $FOREST_ROOT/
        bin/ForestRecovery.sh
        lib/RecoveryManager32.jar
        lib/forest_recovery.a
        lib/libforest_recovery.so
        lib/libforest_recovery.so.0
        lib/libforest_recovery.so.0.0
        share/forest_recovery.sql
        share/pg74.215.jdbc3.jar
        share/postgresql-8.0-313.jdbc3.jar


(3)
󥹥󥹾㳲ͥåȥ㳲PostgresForestνൡǽΥǡ
뤳ȤŪȤƤޤäơHWΥȥ֥䡢
OS¾ƥեȥΥȥ֥ϻ˲褷Ƥɬפޤ
ޤPostgreSQLˤĤƤϡ󥹥ȡ塢ǡ١饹κ
(initdb)λŬڤʴĶԤưƤɬפޤ

ʤȤ1ΡʤưƤǡ١ФɬפǤ
DBФإAPߤɬפϤޤ


(4)ưˡ
$FOREST_ROOT/bin/ForestRecovery.shѤޤ

Ūʵưˡϰʲ̤Ǥ
ܺܤ"-help"ץˤƵưǧƤ

    ForestRecovery.sh \
        [-phase1 | -phase2 | -start_vm | -stop_vm | -cleanup] \
        -user [str] \
        -pass [str] \
        -gsc_url [str] \
        [source server_id] \
        [dest server_id] \
        [dbname]

桼:PostgresForestδĶۤԤäǡ١ø桼
ѥ:ǡ١ø桼Υѥ
GSC URL:(ǽ)Х륷ƥ५JDBCURL
dbname:Ԥǡ١̾

ƥID: 
ʤưDBФΥIDȡԤȤDBФΥ
IDꤷޤƥIDPostgresForestδĶۥġѤ
ȤǳǧǤޤ



(5)¹Լ
[Ķ]
DBФ2湽(IDϤ줾01)
GSCϥID=0ˤΤȤޤ
ID=1DB˾㳲ȯȤޤ
㳲äФǤOSPostgreSQLκƥåȥåסư
μԤäƤޤ

    ǡ١
        host0(ID=0)host1(ID=1)
    
    PostgreSQL
        ꥹ˥󥰥ݡ = 5432
    
    桼DB̾
        testDB
    
    PostgresForest
        󥹥ȡǥ쥯ȥ = /user/local/forest
        GSC = jdbc:postgresql:/host0:5432/gsc

[Υե]
1 phase1:   γϤȡơ֥νԡӹŬ
2 stop_vm:  ơ֥ĺɤȲ۲⥸塼ٻ
3 phase2:   Ŭ
4 start_vm: ơ֥γ۲⥸塼κƳ
5 cleanup:  ơ֥κʤɸ
6 ưǧ


[]

FORET_ROOT=/usr/local/forest/

# Phase 1
    $FORET_ROOT/ForestRecovery.sh \
        -phase1 \
        -user postgres \
        -pass postgres \
        -gsc_url jdbc:postgresql://localhost:5432/gsc \
        0 \
        1 \
        testDB

# Suspend online transactions
    $FORET_ROOT/ForestRecovery.sh \
        -stop_vm \
        -user postgres \
        -pass postgres \
        -gsc_url jdbc:postgresql://localhost:5432/gsc \
        0 \
        1 \
        testDB

# Phase 2
    $FORET_ROOT/ForestRecovery.sh \
        -phase2 \
        -user postgres \
        -pass postgres \
        -gsc_url jdbc:postgresql://localhost:5432/gsc \
        0 \
        1 \
        testDB

# Activate PostgresForest
    $FORET_ROOT/ForestRecovery.sh \
        -start_vm \
        -user postgres \
        -pass postgres \
        -gsc_url jdbc:postgresql://localhost:5432/gsc \
        0 \
        1 \
        testDB

# Clean up temporary DATA used in recovery
    $FORET_ROOT/ForestRecovery.sh \
        -cleanup \
        -user postgres \
        -pass postgres \
        -gsc_url jdbc:postgresql://localhost:5432/gsc \
        0 \
        1 \
        testDB



EOF