亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: drbd安裝使用指南 [打印本頁(yè)]

作者: exitgogo    時(shí)間: 2008-01-08 22:24
標(biāo)題: drbd安裝使用指南
一:概述:

DRBD 是由內(nèi)核模塊和相關(guān)腳本而構(gòu)成,用以構(gòu)建高可用性的集群。其實(shí)現(xiàn)方式是通過(guò)網(wǎng)絡(luò)來(lái)鏡像整個(gè)設(shè)備。您可以把它看作是一種網(wǎng)絡(luò)RAID。 Drbd 負(fù)責(zé)接收數(shù)據(jù),把數(shù)據(jù)寫到本地磁盤,然后發(fā)送給另一個(gè)主機(jī)。另一個(gè)主機(jī)再將數(shù)據(jù)存到自己的磁盤中。   

源碼下載http://oss.linbit.com/drbd/0.7/drbd-0.7.19.tar.gz

核心參考文檔:http://www.drbd.org/drbd-howto.html



二:主要實(shí)現(xiàn)

假設(shè)有兩臺(tái)機(jī)器nannan:192.168.0.136 需要鏡像的硬盤:/dev/hdc3

IXDBA.NET社區(qū)論壇

  root:192.168.0.139 需要鏡像的硬盤:/dev/hdc2

主服務(wù)器為192.168.0.136 簡(jiǎn)稱為136

備份服務(wù)器為192.168.0.139 簡(jiǎn)稱為139

平常對(duì)數(shù)據(jù)讀寫都在136上實(shí)現(xiàn),當(dāng)136 down掉后可以啟動(dòng)139,實(shí)現(xiàn)數(shù)據(jù)的熱備份。

真正的熱切換需要才用HA 來(lái)實(shí)現(xiàn)。



三:下載安裝

安裝環(huán)境:Red Hat Enterprise Linux AS release 4,內(nèi)核版本:2.6.9-22.EL

確認(rèn)內(nèi)核源碼存在,可到http://oss.linbit.com/drbd/去載.

下載源碼注意:當(dāng)前最新的drbd-8.0pre3,配置文件無(wú)法正常配置,出現(xiàn)一大堆錯(cuò)誤,所以下載以前的穩(wěn)定版本。tar源碼解包后

運(yùn)行:

A、make KDIR=/usr/src/linux   /*內(nèi)核所在的位置*/

/*如果你沒(méi)有更改內(nèi)核可以直接運(yùn)行make,軟件會(huì)直接到/lib/module里邊去尋找系統(tǒng)環(huán)境,如果是新的內(nèi)核需要對(duì)內(nèi)核進(jìn)行編譯安裝,

否則make時(shí)候會(huì)錯(cuò)誤中斷掉*/

B、make install

安裝完主要生成命令:drbdsetup ,drbdadmin

和配置文件:/etc/drbd.conf ,啟動(dòng)文件,/etc/init.d/drbd

模塊文件:drbd.ko(在編譯好的安裝包目錄下的drbd下可以找到)

所有命令和配置文件都可以在源碼包編譯成功的目錄下面找到。

./scripts/drbd.conf是最原始的配置文件,當(dāng)/etc/drbd.conf被破壞,可以直接拷貝覆蓋掉。

C、創(chuàng)建硬件設(shè)備drbd

mknod /dev/drbd0 b 147 0

mknod /dev/drbd1 b 147 1

mknod /dev/drbd2 b 147 2

或者用shell來(lái)建立多個(gè):

#for i in $(seq 0 15) ; do mknod /dev/drbd$i b 147 $i ; done

D、DRBD 協(xié)議說(shuō)明

    A 數(shù)據(jù)一旦寫入磁盤并發(fā)送到網(wǎng)絡(luò)中就認(rèn)為完成了寫入操作。

    B 收到接收確認(rèn)就認(rèn)為完成了寫入操作。

    C 收到寫入確認(rèn)就認(rèn)為完成了寫入操作。

    您還可以選擇其它參數(shù)來(lái)將數(shù)據(jù)傳輸給磁盤和網(wǎng)絡(luò)選項(xiàng)。更多詳情,請(qǐng)參見(jiàn)drbdsetup 手冊(cè)頁(yè)。

四:配置drbd

修改/etc/drbd.conf

主要修改了:機(jī)器名和設(shè)備名ip地址

==================================================

  on web1{

    device     /dev/drbd0;

    disk       /dev/hdc3;

    address    192.168.0.136:7788;

    meta-disk  internal;

# meta-disk is either 'internal' or '/dev/ice/name [idx]'

    #

    # You can use a single block device to store meta-data

    # of multiple DRBD's.

    # E.g. use meta-disk /dev/hde6[0]; and meta-disk /dev/hde6[1];

    # for two different resources. In this case the meta-disk

    # would need to be at least 256 MB in size.

    #

    # 'internal' means, that the last 128 MB of the lower device

    # are used to store the meta-data.

    # You must not give an index with 'internal'.

  }

on web2 {

    device    /dev/drbd0;

    disk      /dev/hdc2;

    address   192.168.0.139:7788;

    meta-disk internal;

  }

==================================================

下面是整個(gè)drbd.conf的配置文件:

注意:配置的版本是drbd-0.7.19.tar.gz,不同版本無(wú)法兼容。修改的地方就以上幾個(gè)地方和注釋,還有把除了resource r0 外的其他配置塊如resource r1等全部去掉。

也就是說(shuō)

/****

on root {

    device    /dev/drbd0;

    disk      /dev/hdc2;

    address   192.168.0.139:7788;

    meta-disk internal;

  }

}

****/

后面的所有內(nèi)容全部去掉,



下面是一個(gè)完整的配置好的drbd.conf

#

# drbd.conf example

#

skip {

  As you can see, you can also comment chunks of text

  with a 'skip[optional nonsense]{ skipped text }' section.

  This comes in handy, if you just want to comment out

  some 'resource <some name> {...}' section:

  just precede it with 'skip'.

  The basic format of option assignment is

  <option name><linear whitespace><value>;

  

  It should be obvious from the examples below,

  but if you really care to know the details:

  

  <option name> :=

        valid options in the respective scope

  <value>  := <num>|<string>|<choice>|...

              depending on the set of allowed values

              for the respective option.

  <num>    := [0-9]+, sometimes with an optional suffix of K,M,G

  <string> := (<name>|\"([^\"\\\n]*|\\.)*\")+

  <name>   := [/_.A-Za-z0-9-]+

}

# global {

    # use this if you want to define more resources later

    # without reloading the module.

    # by default we load the module with exactly as many devices

    # as configured mentioned in this file.

    #

    # minor-count 5;

    # The user dialog counts and displays the seconds it waited so

    # far. You might want to disable this if you have the console

    # of your server connected to a serial terminal server with

    # limited logging capacity.

    # The Dialog will print the count each 'dialog-refresh' seconds,

    # set it to 0 to disable redrawing completely. [ default = 1 ]

    #

    # dialog-refresh 5; # 5 seconds

    # You might disable one of drbdadm's sanity check.

    # disable-ip-verification;

# }

#

# this need not be r#, you may use phony resource names,

# like "resource web" or "resource mail", too

#

resource r0 {

  protocol C;

# what should be done in case the cluster starts up in

  # degraded mode, but knows it has inconsistent data.

  incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";

  startup {

    degr-wfc-timeout 120;    # 2 minutes.

  }

  disk {

  }

  net {

  }

  syncer {

    rate 10M;

    group 1;

    al-extents 257;

  }

  on web1{

    device     /dev/drbd0;

    disk       /dev/hdc3;

    address    192.168.0.136:7788;

    meta-disk  internal;

  }

  on web2 {

    device    /dev/drbd0;

    disk      /dev/hdc2;

    address   192.168.0.139:7788;

    meta-disk internal;

  }

}

=================================================



五、啟動(dòng)drbd

先確認(rèn)兩臺(tái)要鏡像的機(jī)器是否正常,之間的網(wǎng)絡(luò)是否通暢,需要加載的硬盤是否處于umount狀態(tài)。

A、 drbd采用的是模塊控制的方式

所以先要加載drbd.ko 模塊

在136服務(wù)器執(zhí)行:

#insmod drbd.ko 或者modprobe drbd

drbd.ko可以在編譯好的源碼包里找到。

判斷是否加載成功可以使用lsmod來(lái)查看:

#lsmod

Module     size    Used by

drbd     143088   -

有的話表示加載模塊成功

#drbdadm up all

啟動(dòng)drbd服務(wù),使他掛在后臺(tái)狀態(tài)下運(yùn)行.

可以使用命令netstat -an查看

有啟動(dòng)端口7788,同時(shí)也監(jiān)聽對(duì)方的7788端口,來(lái)實(shí)現(xiàn)數(shù)據(jù)交換。

netstat -ant的輸出結(jié)果里有一行:

#netstat -ant

tcp        0      0 192.168.0.136:7789          0.0.0.0:*                   LISTEN



B:在139服務(wù)器執(zhí)行

#modprobe drbd

#/etc/rc.d/init.d/drbd start

netstat -atn的輸出結(jié)果,說(shuō)明兩臺(tái)虛擬機(jī)的drbd服務(wù)已經(jīng)連接上了:

#netstat -ant

tcp        0      0 192.168.0.136:7789          192.168.0.139:32845         ESTABLISHED

tcp        0      0 192.168.0.136:32770         192.168.0.139:7789          ESTABLISHED

六:設(shè)置權(quán)限

drbd的基本服務(wù)都起來(lái)了,現(xiàn)在需要對(duì)主的服務(wù)器也就使192.168.0.136這臺(tái)服務(wù)器進(jìn)行配置,讓他能夠?qū)rbd0設(shè)備進(jìn)行讀寫。

在136機(jī)器上運(yùn)行

#drbdadm -- --do-what-I-say  primary all   #設(shè)置136服務(wù)器為同步主目錄,也就是同步以136的這個(gè)分區(qū)為準(zhǔn).

注意命令格式需要一樣,沒(méi)有任何提示的話表示基本上成功了

#sfdisk -s

可以看見(jiàn)有一個(gè)硬件設(shè)備:/dev/drbd0

此時(shí),兩臺(tái)設(shè)備之間就建立起一個(gè)鏡像,您可以查看/proc/drbd 進(jìn)行核實(shí)。

# cat /proc/drbd

如果原來(lái)硬盤沒(méi)有文件系統(tǒng)的話,現(xiàn)在您可以在設(shè)備/dev/drbd0上創(chuàng)建一個(gè)文件系統(tǒng),然后把它加載到136上。

#mkfs.ext3 -j /dev/drbd0

#mkdir /mnt/gaojf

# mount /dev/drbd  /mnt/gaojf

現(xiàn)在/dev/drbd0就等于你服務(wù)器上面的一個(gè)硬件設(shè)備,你可以對(duì)他進(jìn)行任何的讀寫操作。

七:drbd測(cè)試:

1:在136主服務(wù)器上:

#drbdadm primary all

#touch /mnt/gaojf/gaojf

完后,在執(zhí)行

#umount /mnt/gaojf

#drbdadm secondary all

2:接著到139備用服務(wù)器上執(zhí)行

#drbdadm primary all

#mkdir -p /mnt/gaojf

#mount /dev/drbd0 /mnt/gaojf

#ls -l /mnt/gaojf/gaojf

gaojf

Ok,沒(méi)問(wèn)題,可以看到數(shù)據(jù)在136服務(wù)器寫入,在139馬上可以看到.



幾點(diǎn)注意的地方:

1. mount drbd設(shè)備以前必須把設(shè)備切換到primary狀態(tài)。

2. 兩個(gè)節(jié)點(diǎn)中,同一時(shí)刻只能有一臺(tái)處于primary狀態(tài),另一臺(tái)處于secondary狀態(tài)。

3. 處于secondary狀態(tài)的服務(wù)器上不能加載drbd設(shè)備。

4. 主備服務(wù)器同步的兩個(gè)分區(qū)大小最好相同,這樣不至于浪費(fèi)磁盤空間,因?yàn)閐rbd磁盤鏡像相當(dāng)于網(wǎng)絡(luò)raid 1.

5: 在配置過(guò)程中,如果出現(xiàn)下面錯(cuò)誤

Missing argument 'meta_data_dev'

USAGE:

disk lower_dev meta_data_dev meta_data_index [{--size|-d} 0 ... 8587575296]

     [{--on-io-error|-e} {pass_on|call-local-io-error|detach}]

     [{--fencing|-f} {dont-care|resource-only|resource-and-stonith}] [{--use-bmbv|-b}]

那么就還要初始化meta-data area

drbdadm create-md r0

更詳細(xì)的參考:http://www.ixdba.net/article/5c/125.html
作者: molecar    時(shí)間: 2008-01-08 22:48
螞蟻。我用821測(cè)試過(guò)了。這玩意兒目前來(lái)說(shuō)不太可靠!
作者: exitgogo    時(shí)間: 2008-01-08 22:50
確實(shí)有一定問(wèn)題,對(duì)于關(guān)鍵的,大型的應(yīng)用的確不太適合,一般的應(yīng)用還是可以的。
作者: xinyv    時(shí)間: 2008-01-09 09:02
也許這個(gè)方法能解決你們說(shuō)的不太可靠的問(wèn)題。:)
在這種方法中我遇到的一個(gè)問(wèn)題就是當(dāng)集群中主節(jié)點(diǎn)down機(jī)或拔掉網(wǎng)線的時(shí)候,從可以順利接管主服務(wù)器,實(shí)現(xiàn)高可用,但這個(gè)時(shí)候如果你往現(xiàn)在的主(原來(lái)的從)的drbd磁盤上寫入數(shù)據(jù),那么在另一臺(tái)機(jī)器重新啟動(dòng)或插上網(wǎng)線的時(shí)候,就會(huì)發(fā)生“split brain” ,這個(gè)時(shí)候drbd的數(shù)據(jù)就不是同步的了,想要同步就必須手工恢復(fù)。很奇怪的是如果沒(méi)有mount drbd就很少發(fā)生這種情況。這就好像一個(gè)半自動(dòng)的高可用,我們需要經(jīng)常去監(jiān)視他是否斷掉了,那怕是重啟一臺(tái)機(jī)器都經(jīng)常會(huì)發(fā)生“split brain”,我看了drbd的文檔,里面有很多策略應(yīng)該可以避免我上面的情況,可惜我的實(shí)驗(yàn)全部失敗了。希望有成功的指點(diǎn)我一下。
我的e文不太好,我這段幫助貼上來(lái),e文好的自己看吧。
       -A, --after-sb-0pri asb-0p-policy
              possible policies are:

              disconnect
                     No automatic resynchronisation, simply disconnect.

              discard-younger-primary
                     Auto sync from the node that was primary before the split-  brain situation occurred.

              discard-older-primary
                     Auto sync from the node that became primary as second during the split-brain situation.

              discard-zero-changes
                     In case one node did not write anything since the split brain became evident, sync from the node that wrote something to the node that did
                     not write anything. In case none wrote anything this policy uses a random decission to perform a "resync" of 0 blocks. In case  both  have
                     written something this policy disconnects the nodes.

              discard-least-changes
                     Auto sync from the node that touched more blocks during the split brain situation.

              discard-node-NODENAME
                     Auto sync to the named node.
       -B, --after-sb-1pri asb-1p-policy
              possible policies are:

              disconnect
                     No automatic resynchronisation, simply disconnect.

              consensus
                     Discard the version of the secondary if the outcome of the after-sb-0pri algorithm would also destroy the current secondary’s data. Other-
                     wise disconnect.

              discard-secondary
                     Discard the secondary’s version.

              call-pri-lost-after-sb
                     Always honour the outcome of the after-sb-0pri
                      algorithm. In case it decides the current secondary has the right data, call the pri-lost-after-sb on the current primary.

              violently-as0p
                     Always honour the outcome of the after-sb-0pri
                      algorithm. In case it decides the current secondary has the right data, accept a possible instantaneous change of the primary’s data.

       -C, --after-sb-2pri asb-2p-policy
              possible policies are:

              disconnect
                     No automatic resynchronisation, simply disconnect.

              call-pri-lost-after-sb
                     Always honour the outcome of the after-sb-0pri
                      algorithm. In case it decides the current secondary has the right data, call the pri-lost-after-sb on the current primary.

              violently-as0p
                     Always honour the outcome of the after-sb-0pri
                      algorithm. In case it decides the current secondary has the right data, accept a possible instantaneous change of the primary’s data.

我理解的意思就是 split brain, after - sb (不知道你會(huì)不會(huì)和我的理解一樣……)
這里我解決的辦法是用一個(gè)腳本來(lái)檢測(cè) split brain ,并自動(dòng)判斷同步。
shell.1 發(fā)到啟動(dòng)組里面
#!/bin/sh
PATH=$PATH:/sbin:/usr/sbin:/usr/local/bin
[ -f /proc/drbd ] || exit 1
if ( grep 'Secondary/Unknown' /proc/drbd );then
        drbdadm disconnect all
        drbdadm -- --discard-my-data connect all
        (sleep 1;echo 'drbd';sleep 2;echo 'drbd';sleep 3)|telnet 192.16.1.22
fi
shell.2 由heartbeat執(zhí)行。
#! /bin/bash
#
# chkconfig: 345 15 88
# description: Linux High availability services .

# Source function library.
. /etc/init.d/functions
[ ! -f /etc/sysconfig/network ] && exit 1
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

# if the ip configuration utility isn't around we can't function.
[ -x /sbin/ip ] || exit 1;[ -f /proc/drbd ] || exit 1
DRBDSTATE=$(drbdadm state all)
while $(grep -E "SyncSource.*Inconsistent" /proc/drbd >/dev/null 2<&
   do
        sleep 10
   done

start () {
        sleep 5
        ip addr add 192.16.1.20/24 brd 192.16.3.255 dev bond0
        /etc/init.d/portmap start
        drbdadm primary all
        mount -t ext3 -o rw /dev/drbd0 /mnt/disk0
        mount -t ext3 -o rw /dev/drbd1 /mnt/disk1
        /etc/init.d/nfs start
        /etc/init.d/nfslock start
        exportfs -avr
        return $RETVAL
}
stop () {
        ip addr del 192.16.1.20/24 brd 192.16.1.255 dev bond0
        /etc/init.d/nfs stop
        /etc/init.d/nfslock stop
        umount /mnt/disk0
        umount /mnt/disk1
        drbdadm secondary all
        /etc/init.d/portmap stop
        if ( grep 'Secondary/Unknown' /proc/drbd );then
        exec /etc/rc.d/my-shell.sh;fi
        return $RETVAL
}

# See how we were called.
case "$1" in
  start|stop)
        $1
        ;;
  restart|reload)
        /etc/init.d/$0 stop
        /etc/init.d/$0 start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload}"
        exit 1
esac

exit 0
添加用戶 drbd
passwd
drbd:105:105RBD:/home/drbd:/sbin/drbdsh
drbdsh文件
#!/bin/sh
# Variables and Function definition
PATH=$PATH:/sbin:/usr/sbin:/usr/local/bin

#Program Main
[ -f /proc/drbd ] || exit 1
TEMP=$(drbdadm state all)
D_STATE=(${TEMP//\// })
if ( echo ${D_STATE[@]}|grep Primary >/dev/null 2<&- ) && \
   ( echo ${D_STATE[@]}|grep Unknown >/dev/null 2<&- );then
        drbdadm connect all
        else exit 1
fi
exit 0
啟動(dòng) telnet
在 hosts.deny 里添加 in.telnet :ALL :ALL EXCEPT 192.16.1.22
這樣就可以保證每次啟動(dòng)后數(shù)據(jù)的同步了。
下面是我的部分配置文件:
drbd.conf
global { usage-count yes; }
common { syncer { rate 10M; } }
resource r0 {
        protocol C;
        handlers { pri-on-incon-degr "halt -f"; }
        disk { on-io-error detach; }
        net {
                cram-hmac-alg sha1;
                shared-secret "800hr_disk_0";
        }
        on test01 {
                device          /dev/drbd0;
                disk            /dev/sda6;
                address         192.16.1.21:7789;
                meta-disk       internal;
        }
        on test02 {
                device          /dev/drbd0;
                disk            /dev/sda6;
                address         192.16.1.22:7789;
                meta-disk       internal;
        }
}

[ 本帖最后由 xinyv 于 2008-1-9 09:03 編輯 ]
作者: molecar    時(shí)間: 2008-01-09 11:57
我目前也沒(méi)弄明白怎么保證數(shù)據(jù)完整性的。呵呵!所以還是等有了商業(yè)應(yīng)用看看別人用的效果吧!

[ 本帖最后由 molecar 于 2008-1-9 12:12 編輯 ]
作者: jason0127    時(shí)間: 2008-01-19 16:28
net {
        after-sb-0pri discard-older-primary;
        after-sb-1pri call-pri-lost-after-sb;
        after-sb-2pri call-pri-lost-after-sb;
}
在drbd.conf中配置如上參數(shù),也許能解決各位所遇到的split brain問(wèn)題
作者: troyme    時(shí)間: 2008-01-21 09:43
split brain是很正常的現(xiàn)象
主節(jié)點(diǎn)當(dāng)機(jī)后,輔節(jié)點(diǎn)成為primary,并且有數(shù)據(jù)的改動(dòng)
然后主節(jié)點(diǎn)重啟后,默認(rèn)肯定是primary,但是又由于數(shù)據(jù)的不一致性,于是兩個(gè)primary就開始split brain了。
作者: molecar    時(shí)間: 2008-02-04 13:21
推薦一下,這個(gè)是螞蟻原創(chuàng)的。可否考慮設(shè)置為精華
作者: szwzzak    時(shí)間: 2008-03-04 11:15
標(biāo)題: DRBD
剛好我手上有一個(gè)菲律賓的博彩項(xiàng)目。數(shù)據(jù)庫(kù)采用的是MYSQL 5.0.41.用戶要求在不增加投資情況下提供高可用性。我初步測(cè)試了HEARTBEAT+DRBD+NFS+MYSQL+MON這個(gè)組合。(HEARTBEAT 2.0.8;DRBD 8.2.4,Red Hat Enterprise Linux AS release 4,內(nèi)核版本:2.6.9-34.EL

計(jì)劃滿足以下要求:
1)  service heartbeat stop
2)  kiallall heartbeat
3)  reboot
4)  拔掉生產(chǎn)網(wǎng)絡(luò)網(wǎng)線
5)  拔掉主服務(wù)器的電源線
在以上情況下,集群可以自動(dòng)進(jìn)行集群ip和mysql切換,同時(shí)保證數(shù)據(jù)完整性。
我參照mysql公司提供的mysql+drbd集群文檔進(jìn)行了配置,同時(shí)參考了你的設(shè)置。
結(jié)論是
service heartbeat stop;kiallall heartbeat;拔掉生產(chǎn)網(wǎng)絡(luò)網(wǎng)線
以上情況是滿足我的要求的。
但是當(dāng)拔掉主服務(wù)器的電源線后,備份服務(wù)器heartbeat不能啟動(dòng)相應(yīng)資源。
錯(cuò)誤信息:return code 20 from /etc/ha.d/resource.d/drbddisk
我分析DRBD需要兩個(gè)節(jié)點(diǎn)cs處于connected狀態(tài)才能設(shè)置primary狀態(tài),進(jìn)而掛載/dev/drbd0設(shè)備。當(dāng)拔掉主服務(wù)器的電源線后,cs肯定不是connected狀態(tài),因此不能將備份服務(wù)器drbd設(shè)置為primary狀態(tài)。從而造成heartbeat服務(wù)不能啟動(dòng)相應(yīng)資源。
按照我的測(cè)試,heartbeat+mysql是可以滿足以上五個(gè)要求的(測(cè)試時(shí)未考慮數(shù)據(jù)完整性。)
我的drbd.conf
on web1{

    device     /dev/drbd0;

    disk       /dev/drbd0;

    address    10.10.10.1:7788;(使用的是心跳網(wǎng)線)

    meta-disk  internal;

  }
net {
        after-sb-0pri discard-older-primary;
        after-sb-1pri call-pri-lost-after-sb;
        after-sb-2pri call-pri-lost-after-sb;
}
ha.cf
使用ipfail,dopd同步進(jìn)程
Haresources
Local139 192.168.30.249 drbddisk::r0 filesystem::.dev/drbd0::/opt/mysql/data portmap nfslock nfs mysqld
在我這里拔掉生產(chǎn)網(wǎng)絡(luò)網(wǎng)線的數(shù)據(jù)完整性已經(jīng)可以保證了。數(shù)據(jù)沒(méi)有問(wèn)題。
你們?cè)谂渲胐rbd+和heartbeat過(guò)程中能滿足我的全部用戶要求嗎?
作者: molecar    時(shí)間: 2008-03-12 16:18
最好能讓mysql server帶數(shù)據(jù),同是正在寫入或讀取數(shù)據(jù)的時(shí)候宕機(jī)!然后再檢驗(yàn)數(shù)據(jù)
作者: luoriddr    時(shí)間: 2008-03-18 09:49
我用的版本是8.2.5。
在執(zhí)行drbdadm create-md r0的時(shí)候出錯(cuò),提示如下:

Found ext3 filesystem which uses 2048256 kB
current configuration leaves usable 2048156 kB

Device size would be truncated, which
would corrupt data and result in
'access beyond end of device' errors.
You need to either
   * use external meta data (recommended)
   * shrink that filesystem first
   * zero out the device (destroy the filesystem)
Operation refused.

Command 'drbdmeta /dev/drbd1 v08 /dev/sda12 internal create-md' terminated with exit code 40
drbdadm aborting

就是如果設(shè)置元數(shù)據(jù)在分區(qū)內(nèi)部即設(shè)置為 internal,提示的三種解決方法我倒是看懂了。第一種將 元數(shù)據(jù)設(shè)置在別的分區(qū),我不想。第二種縮小文件系統(tǒng),不會(huì) ,第三種 破壞文件系統(tǒng),也不太會(huì),不過(guò)最后用dd命令搞定了。也不知道對(duì)不對(duì),反正最后能用。
測(cè)試了主備轉(zhuǎn)換什么的都成功了。
這個(gè)分區(qū)是我裝系統(tǒng)的時(shí)候劃分的,于是就自動(dòng)格式化成ext3了。請(qǐng)教螞蟻和ben了。賜教一下!
作者: molecar    時(shí)間: 2008-03-18 12:35
我對(duì)DRBD不太熟悉!還是請(qǐng)教螞蟻吧
作者: moxnet    時(shí)間: 2008-03-18 12:45
同上,我也碰到過(guò)這個(gè)問(wèn)題,也樣是用dd破壞的文件系統(tǒng)。。。。
作者: huifeideluotuo    時(shí)間: 2008-03-20 16:18
期待高手出現(xiàn),數(shù)據(jù)的完整性對(duì)數(shù)據(jù)庫(kù)來(lái)說(shuō)是很重要的。

如果原來(lái)的主DRBD服務(wù)器重新啟動(dòng)了,現(xiàn)在的主服務(wù)器可以判斷---等到和原來(lái)的主服務(wù)器數(shù)據(jù)同步后,在此時(shí)很短的時(shí)間內(nèi)阻止數(shù)據(jù)寫入,然后切換過(guò)去,就不會(huì)出現(xiàn)腦裂問(wèn)題了,不知道DRBD有沒(méi)有這個(gè)功能?
作者: flybird525    時(shí)間: 2008-03-26 14:43
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽
作者: szwzzak    時(shí)間: 2008-04-09 14:39
標(biāo)題: 測(cè)試基本結(jié)束
基本滿足要求。由于我們是oltp應(yīng)用,要求切換速度要求較高,F(xiàn)在主機(jī)不重啟,3秒內(nèi)可以完成業(yè)務(wù)接管;主機(jī)重啟的話需要11秒,主要是備機(jī)接管時(shí)drbddisk設(shè)置primary不能一次性設(shè)置成功。如果不用drbd,采用iscsi估計(jì)可以省略這部分延遲。集群內(nèi)部節(jié)點(diǎn)數(shù)據(jù)一致性完全不存在問(wèn)題。美中不足是heartbeat切換時(shí)間還是不夠快。在切換過(guò)程中,如果應(yīng)用程序要寫入的話,這部分代碼將因連接不到集群ip而等待,在連接超時(shí)后事務(wù)被放棄。在oltp應(yīng)用上這類ha,在單機(jī)上不存在問(wèn)題,但是集群環(huán)境下出現(xiàn)了程序問(wèn)題。。待調(diào)試。。后面另一個(gè)客戶要求高些數(shù)據(jù)庫(kù)可以買oracle,需要看看rac的速度和穩(wěn)定性是否更好。
作者: szwzzak    時(shí)間: 2008-04-10 14:44
標(biāo)題: drbd8版本存在很多疑問(wèn)
宕機(jī)情況下heartbeat不能使用drbddisk設(shè)置primary狀態(tài),我使用0.7.23版本。
作者: Herry_DLZeng    時(shí)間: 2008-04-14 20:05
我試過(guò),用來(lái)做NFS的,同步的時(shí)間好像就主盤都不能寫,數(shù)據(jù)量是200GB。不知是什么原因?




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2