drbd 테스트 중에 이런 에러가 발생하니다. (Refusing to be Primary without at least one UpToDate disk)

익명 사용자의 이미지


안녕하세요.

근래 drbd, heartbeat를 이용한 mysql ha구성을 해보고 있습니다.

현재 drbd를 셋팅해서 테스트 중이며 일단 drbd 셋팅은 완료가 되서

primary(A서버), secondary(B서버) 서버의 파티션 동기화가 정상적으로 되고있습니다.

문제는.

현재 A서버의 drbd데몬을 내리고 B서버를 primary로 바꾸면

kernel: drbd0: State change failed: Refusing to be Primary without at least one UpToDate disk

에러와 함께 pirmary 로 변하지 않습니다.

제가 사용한 명령어를 정리하면

A서버에서

/etc/init.d/drbd stop 후

B서버에서 일단

cat /proc/drbd 로 확인해보면

version: 8.2.6 (api:88/proto:86-88)
GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by buildsvn@c5-x8664-build, 2008-10-03 11:30:17
0: cs:WFConnection st:Secondary/Unknown ds:Diskless/DUnknown C r---
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 oos:0

이렇게 나오고

drbdadm primary all 로

primary 파티션으로 바꾸려고 하면

/dev/drbd0: State change failed: (-2) Refusing to be Primary without at least one UpToDate disk

라는 메세지와 함께 변경이 되지 않습니다.

로그를 봐도

Jun 22 16:16:26 linux2 kernel: drbd0: State change failed: Refusing to be Primary without at least one UpToDate disk
Jun 22 16:16:26 linux2 kernel: drbd0: state = { cs:WFConnection st:Secondary/Unknown ds:Diskless/DUnknown r--- }
Jun 22 16:16:26 linux2 kernel: drbd0: wanted = { cs:WFConnection st:Primary/Unknown ds:Diskless/DUnknown r--- }

라고 나오고요.

특이한건 두 서버 connect 상태에서 B서버를 primary 로 바꾸고 난뒤 (A서버는 secondary 상태)

B서버의 drbd 데몬을 내리고 (/etc/init.d/drbd stop)

A서버를 primary 서버로 바꾸면 (drbdadm primary all) 정상적으로 primary 상태로 변하니다.

이게 해결이 되질 않네요. ㅠ

/etc/drbd.cpnf 파일 내용은 아래와 같습니다.

cat /etc/drbd.conf

resource drbd0 {
protocol C;

on linux1 {
device /dev/drbd0;
disk /dev/sda5 ;
address 192.168.0.2:7789;
meta-disk internal;
}

on linux2 {
device /dev/drbd0;
disk /dev/sda5 ;
address 192.168.0.3:7789;
meta-disk internal;
}
}

조언 부탁드립니다.

감사합니다.

junilove의 이미지

저도 drbd를 사용중이라서 찾아보았습니다.

Refusing to be Primary without at least one UpToDate disk

이런 메시지가 나오면 primary에서 아래 명령을 실행하라고 하네요.

drbdadm -- --overwrite-data-of-peer primary all

* 버전에 따라 옵션사용법이 약간 다르니, --help나 man을 참조하세요.
참고자료 : http://wiki.samba.org/index.php/6.0:_DRBD

추가) 왜 그런지에 대해 궁금해 찾아봤는데..잘 모르겠네요.. 아마도 두 host간의 오류가 발생한 sync를 다시 작성해주는 것 같습니다.

익명 사용자의 이미지

답변감사합니다.!!

참고해서 테스트 해보겠습니다.

juy0215의 이미지

A 서버에 디스크 마운트 해제 하셨나용 ?

일반적인 장애 및 복구 절차 입니당 참고 하셔용

A(primary) B(Secondary)
A 장애시

B 서버에서의 수행 명령
drbdadm primary all
mount /dev/drbd0 /home

이렇게 하면 그냥 끝입니다.

이상태에서 A 서버 복구후
A 서버에서의 수행 명령
drbdadm secondary all
drbdadm -- --overwrite-data-of-peer primary all

B 서버에서의 수행 명령
drbdadm connect all

이렇게하면 A 서버가 그동안 바뀐 B 서버의 데이터를 동기화 합니다. cat /proc/drbd 확인하여 update 된걸 확인후

B 서버에서
마운트를 정상적으로 해제 후
drbdadm secondary all
수행

A 서버에서
drbdadm primary all
mount /dev/drbd0 /(TARGET)
해주면 끝~~~~~~

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.