| 1 | = 2012-04-05 = |
| 2 | |
| 3 | == hadoop.nchc.org.tw == |
| 4 | |
| 5 | * 參考 [wiki:jazz/11-06-20 2011-06-20 筆記] |
| 6 | * <服務> 將 hadoop.nchc.org.tw 的 /home 容量加大 |
| 7 | * 這次比較不同的是採用 iSCSI 的硬碟 |
| 8 | * 測試環境:Debian GNU/Linux 6.0.4 |
| 9 | {{{ |
| 10 | jazz@hadoop:~$ lsb_release -a |
| 11 | No LSB modules are available. |
| 12 | Distributor ID: Debian |
| 13 | Description: Debian GNU/Linux 6.0.4 (squeeze) |
| 14 | Release: 6.0.4 |
| 15 | Codename: squeeze |
| 16 | }}} |
| 17 | * 測試步驟: |
| 18 | * 安裝 open-iscsi |
| 19 | {{{ |
| 20 | jazz@hadoop:~$ sudo apt-get install open-iscsi |
| 21 | }}} |
| 22 | * 修改 /etc/iscsi/iscsid.conf |
| 23 | {{{ |
| 24 | #!diff |
| 25 | --- iscsid.conf.org 2012-04-05 17:04:06.000000000 +0800 |
| 26 | +++ iscsid.conf 2012-04-05 17:05:15.000000000 +0800 |
| 27 | @@ -25,10 +25,10 @@ |
| 28 | #***************** |
| 29 | |
| 30 | # To request that the iscsi initd scripts startup a session set to "automatic". |
| 31 | -# node.startup = automatic |
| 32 | +node.startup = automatic |
| 33 | # |
| 34 | # To manually startup the session set to "manual". The default is manual. |
| 35 | -node.startup = manual |
| 36 | +# node.startup = manual |
| 37 | |
| 38 | # ************* |
| 39 | # CHAP Settings |
| 40 | @@ -36,12 +36,12 @@ |
| 41 | |
| 42 | # To enable CHAP authentication set node.session.auth.authmethod |
| 43 | # to CHAP. The default is None. |
| 44 | -#node.session.auth.authmethod = CHAP |
| 45 | +node.session.auth.authmethod = CHAP |
| 46 | |
| 47 | # To set a CHAP username and password for initiator |
| 48 | # authentication by the target(s), uncomment the following lines: |
| 49 | -#node.session.auth.username = username |
| 50 | -#node.session.auth.password = password |
| 51 | +node.session.auth.username = 登入帳號 |
| 52 | +node.session.auth.password = 登入密碼 |
| 53 | |
| 54 | # To set a CHAP username and password for target(s) |
| 55 | # authentication by the initiator, uncomment the following lines: |
| 56 | @@ -50,12 +50,12 @@ |
| 57 | |
| 58 | # To enable CHAP authentication for a discovery session to the target |
| 59 | # set discovery.sendtargets.auth.authmethod to CHAP. The default is None. |
| 60 | -#discovery.sendtargets.auth.authmethod = CHAP |
| 61 | +discovery.sendtargets.auth.authmethod = CHAP |
| 62 | |
| 63 | # To set a discovery session CHAP username and password for the initiator |
| 64 | # authentication by the target(s), uncomment the following lines: |
| 65 | -#discovery.sendtargets.auth.username = username |
| 66 | -#discovery.sendtargets.auth.password = password |
| 67 | +discovery.sendtargets.auth.username = 登入帳號 |
| 68 | +discovery.sendtargets.auth.password = 登入密碼 |
| 69 | |
| 70 | # To set a discovery session CHAP username and password for target(s) |
| 71 | # authentication by the initiator, uncomment the following lines: |
| 72 | }}} |
| 73 | * 啟動 iscsid |
| 74 | {{{ |
| 75 | jazz@hadoop:~$ sudo /etc/init.d/open-iscsi restart |
| 76 | [sudo] password for jazz: |
| 77 | Unmounting iscsi-backed filesystems: Unmounting all devices marked _netdev. |
| 78 | Disconnecting iSCSI targets:. |
| 79 | Stopping iSCSI initiator service:. |
| 80 | Starting iSCSI initiator service: iscsid. |
| 81 | Setting up iSCSI targets: |
| 82 | iscsiadm: No records found! |
| 83 | . |
| 84 | Mounting network filesystems:. |
| 85 | }}} |
| 86 | * 掃描 iSCSI 硬碟 |
| 87 | {{{ |
| 88 | jazz@hadoop:~$ sudo iscsiadm -m discovery -t sendtargets -p X.X.X.X(iSCSI Target Server 的 IP) |
| 89 | X.X.X.X:3260,0 iqn.2011-09.com.ems5:das-2000-i112a-fff000958:dev0 |
| 90 | }}} |
| 91 | * 使用 iSCSI 硬碟 |
| 92 | {{{ |
| 93 | jazz@hadoop:~$ sudo iscsiadm -m node --targetname "iqn.2011-09.com.ems5:das-2000-i112a-fff000958:dev0" --login & |
| 94 | }}} |
| 95 | * 查看 dmesg 會發現找到 iSCSI 硬碟在 /dev/sdX (這裡找到在 /dev/sdd) |
| 96 | {{{ |
| 97 | [2659438.350894] Loading iSCSI transport class v2.0-870. |
| 98 | [2659438.359496] iscsi: registered transport (tcp) |
| 99 | [2659438.382648] iscsi: registered transport (iser) |
| 100 | [2659566.984113] scsi8 : iSCSI Initiator over TCP/IP |
| 101 | [2659567.555637] scsi 8:0:0:0: Direct-Access EMS5 DAS 2000-i112a 211 PQ: 0 ANSI: 4 |
| 102 | [2659567.556192] sd 8:0:0:0: [sdd] Very big device. Trying to use READ CAPACITY(16). |
| 103 | [2659567.556792] sd 8:0:0:0: [sdd] 7811891200 512-byte logical blocks: (3.99 TB/3.63 TiB) |
| 104 | [2659567.556937] sd 8:0:0:0: [sdd] Write Protect is off |
| 105 | [2659567.556940] sd 8:0:0:0: [sdd] Mode Sense: bb 00 00 00 |
| 106 | [2659567.557250] sd 8:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA |
| 107 | [2659567.557594] sd 8:0:0:0: [sdd] Very big device. Trying to use READ CAPACITY(16). |
| 108 | [2659567.558192] sdd: unknown partition table |
| 109 | [2659567.577709] sd 8:0:0:0: [sdd] Very big device. Trying to use READ CAPACITY(16). |
| 110 | [2659567.578310] sd 8:0:0:0: [sdd] Attached SCSI disk |
| 111 | }}} |
| 112 | * 把 /dev/sdd 用 fdisk 先切割一個 partition /dev/sdd1 |
| 113 | {{{ |
| 114 | jazz@hadoop:~$ sudo fdisk /dev/sdd |
| 115 | }}} |
| 116 | * 開始著手把 /dev/sdd1 加入 LVM2 |
| 117 | {{{ |
| 118 | jazz@hadoop:~$ sudo partprobe |
| 119 | jazz@hadoop:~$ sudo pvcreate /dev/sdd1 |
| 120 | Physical volume "/dev/sdd1" successfully created |
| 121 | }}} |