본문 바로가기

넋두리/linux 이야기

Bacula 설정과 사용하기 -PartII

서버환경은 Part I과 동일함.

백업할 클라이언트 환경
OS: ubuntu 12.04
IP: 59.29.142.9
백업 대상: /home

1. bacula 클라이언트 설치

# apt-get install bacula-client

2. bconsole 설정

/etc/bacula/bconsole.conf 를 수정한다. address는 bacula 서버의 ip주소나 hosts 화일에 등록된 hostname을 사용한다. password는 bacula 서버의 bconsole.conf와 동일하게 설정하면된다.

Director {
Name = fox1-dir
DIRport = 9101
# address = localhost
address = fox1 # bacula 서버의 호스트네임 또는 ip주소
# Password = “cO-Hvjg-l_noGgMkQpKHEwAHDBGeszNuR”
Password = “……”
}

3.  bacula-fd 설정

/etc/bacula/bacula-fd.conf 를 수정한다.

Director {
Name = fox1-dir # bacula 서버의 디렉터 이름
# Password = “j1QSgOsGBf11Ur2T3KXqwAiMwFvsrC4OH”
Password = “vOchjaYxGgFnKdbE5me5a3Tp5vs763FyoIhXdqUF733A
}

FileDaemon { # this is me
Name = tech-fd
FDport = 9102 # where we listen for the director
WorkingDirectory = /var/lib/bacula
Pid Directory = /var/run/bacula
Maximum Concurrent Jobs = 20
# FDAddress = 127.0.0.1
FDAddress = 59.29.142.9 #클라이언트 ip 즉, 백업 대상 컴퓨터
}

Messages {
Name = Standard
director = tech-dir = all, !skipped, !restored
}

4. bacula 서버(fox1)에서  클라이언트(tech) 등록.

/etc/bacula/bacula-dir.conf 화일에 아래 내용 등록.

### Linux Client
Client {
Name = tech-fd
Address = 59.29.142.9
FDPort = 9102
Catalog = MyCatalog
Password = “vOchjaYxGgFnKdbE5me5a3Tp5vs763FyoIhXdqUF733A
File Retention = 7 days
Job Retention = 1 Month
AutoPrune = yes
}
Job{
Name = “tech-fd”
Type = Backup
Client = tech-fd
FileSet = “LinuxClient
Schedule = “WeeklyCycle”
Storage = File
Messages = Standard
#Pool = Default
Pool = File
Write Bootstrap = “/var/lib/bacula/tech.bsr”
}
FileSet {
Name = “LinuxClient
Include {
Options {
signature = MD5
}
File = “/home”  # 백업할 디렉토리
}
}

5. 백업의 실행

위와 같이 설정하고, bconsole에서 백업을 실행했지만 아래와같은 메시지와 함께 백업이 진행되지 않음.

Running Jobs:
Console connected at 13-Jun-13 23:26
JobId Level Name Status
======================================================================
14 Full tech-fd.2013-06-13_20.41.07_03 is waiting for an appendable Volume
15 Increme BackupClient1.2013-06-13_23.05.00_06 is waiting execution
16 Full tech-fd.2013-06-13_23.05.00_07 is waiting execution
17 Full BackupCatalog.2013-06-13_23.10.00_08 is waiting execution
====

 

stat stor=File
Automatically selected Storage: File
Connecting to Storage daemon File at 59.29.142.85:9103

fox1-sd Version: 5.2.5 (26 January 2012) x86_64-pc-linux-gnu ubuntu 12.04
Daemon started 12-Jun-13 23:10. Jobs: run=5, running=0.
Heap: heap=270,336 smbytes=232,641 max_bytes=298,701 bufs=105 max_bufs=109
Sizes: boffset_t=8 size_t=8 int32_t=4 int64_t=8 mode=0,0

Running Jobs:
Writing: Full Backup job tech-fd JobId=14 Volume=”"
pool=”Default” device=”FileStorage” (/backup/archive)
spooling=0 despooling=0 despool_wait=0
Files=0 Bytes=0 Bytes/sec=0
FDReadSeqNo=6 in_msg=6 out_msg=4 fd=5
====

Jobs waiting to reserve a drive:
====

…..

====

Device status:
Device “FileStorage” (/backup/archive) is not open.
Device is BLOCKED waiting to create a volume for:
Pool: Default
Media type: File
====

Used Volume status:
====

====

원인은 Default pool에 속한 볼륨이 없어서 발생. label 커맨드로 vol_3을 Default pool로 만들어고 다시 백업.  Pool을 Default 에서 File로 변경.

*label
Automatically selected Storage: File
Enter new Volume name: vol_3
Media record for new Volume “vol_3″ already exists.
Enter new Volume name: vol_4
Defined Pools:
1: Default
2: File
3: Scratch
Select the Pool (1-3): 2
Connecting to Storage daemon File at 59.29.142.85:9103 …
Sending label command for Volume “vol_4″ Slot 0 …
3000 OK label. VolBytes=184 DVD=0 Volume=”vol_4″ Device=”FileStorage” (/backup/archive)
Catalog record for Volume “vol_4″, Slot 0 successfully created.
Requesting to mount FileStorage …
3001 OK mount requested. Device=”FileStorage” (/backup/archive)

그래도 잘 안됨.

 

6. Restore

Restore는 별도 설정이 없는한 서버의 standard restore template를 사용한다.

만약, bacula server의 Restore job이 아래와 같다면,

Job {
Name = “RestoreFiles”
Type = Restore
Client=fox1-fd
FileSet=”Full Set”
Storage = File
Pool = Default
Messages = Standard
#Where = /nonexistant/path/to/file/archive/dir/bacula-restores
Where = /backup/restore
}

Restore 한 화일은 는 클라이언트의 /backup/restore에 저장된다. 따라서 클라이언트에 /backup/restore 디렉토리가 없다면, Restore가 되지 않는다. 그냥 간단히 필요한 디렉토리를 만들어주면 된다.

 

'넋두리 > linux 이야기' 카테고리의 다른 글

서버 랜(hardware) 포트 확인 시  (0) 2013.10.01
Ubuntu Cloudstack repo 구성 방법  (0) 2013.10.01
Bacula catalog 백업 오류.  (0) 2013.10.01
Bacula 설정과 사용하기 -Part III  (0) 2013.10.01
heartbeat 설치 및 설정  (0) 2013.10.01