公告版位

一、名詞定義與必要packages:

      (1) Server為Monitoring Host
           - $ yum install -y httpd php gcc glibc glibc-common \
                gd gd-devel openssl openssl-devel

           - nagios-3.4.1.tar.gz (Nagios Core)
           - nagios-plugins-1.4.15.tar.gz (Nagios plugins)
           - nrpe-2.13.tar.gz (NRPE)

      (2) Client為Remote Host
           - $ yum install -y httpd php gcc glibc glibc-common \
                gd gd-devel openssl openssl-devel xinetd

           - nagios-plugins-1.4.15.tar.gz (Nagios plugins)
           - nrpe-2.13.tar.gz (NRPE)

dreamtails 發表在 痞客邦 留言(0) 人氣()

step 1. $ yum install xfsprogs*

step 2. $ yum install xfsdump

step 3. $ fdisk /dev/sdc

                n → Enter

                p → Enter

                1 → Enter

                Enter → Enter → w

 

step 4. $ mkfs -t xfs -f /dev/sdc1

dreamtails 發表在 痞客邦 留言(0) 人氣()

若我們要用IOZone來測試mount在/mnt/iscsi下的iSCSI磁區benchmark, 指令可以如下:

Example 1:
$ iozone -Rab output.xls -i 0 -i 1 -i 2 -y 4K -q 2M -n 4K -g 2G -S 8M -+u -f /mnt/iscsi/iotest.file -z

Example 2:
$ iozone -Rb output.xls -r 4K -s 2G

dreamtails 發表在 痞客邦 留言(0) 人氣()

$ yum install -y sysstat

$ iostat -d -m -t 2 10

dreamtails 發表在 痞客邦 留言(0) 人氣()

$ time ls > output.txt 2>&1

註:一定要加"2>&1"才會將時間寫入output.txt喔!

dreamtails 發表在 痞客邦 留言(0) 人氣()

$ time ls

real 0m0.007s
user 0m0.006s
sys 0m0.001s

dreamtails 發表在 痞客邦 留言(0) 人氣()

Q:
     
原來在Vsphere 5在安裝後,使用local端只能設定一個管理IP (如:10.10.1.1),假如有兩張網卡時,而且這兩張網卡又要設定不同網段時怎麼辦呢? 假設現在我們有兩張實體網路卡,vmnic0(設定10.10.1.1)與vmnic1(192.168.1.1)。

dreamtails 發表在 痞客邦 留言(0) 人氣()

情境:若今天我們要建立兩個Pool,第一個Pool有兩個Lun,這兩個Lun分別只給192.168.1.1與192.168.2.2掛載。而第二個Pool只有一個Lun,這個Lun可以給所有人掛載。那我們的設定檔可以如下。

$ vim /etc/tgt/targets.conf

-------------------------------------------------------------------------
default-driver iscsi

<target iqn.2012-05.hostname:iSCSI-Pool_one>
        <backing-store /mnt/iscsi/LUN1>
                lun 1        #此為這個Pool下的Lun編號:1
                initiator-address 192.168.1.1
        </backing-store>

        <backing-store /mnt/iscsi/LUN2>
                lun 2        #此為這個Pool下的Lun編號:2
                initiator-address 192.168.2.2
        </backing-store>
</target>

<target iqn.2012-05.hostname:iSCSI-Pool_two>
        backing-store /mnt/iscsi/LUN3
        lun 1        #此為這個Pool下的Lun編號:1
        initiator-address ALL

</target>
-------------------------------------------------------------------------

dreamtails 發表在 痞客邦 留言(0) 人氣()

iSCSI-Target安裝啟用筆記

step 1. $ yum install -y scsi-target-utils

step 2. $ service tgtd start

step 3. $ chkconfig tgtd on

dreamtails 發表在 痞客邦 留言(0) 人氣()

iSCSI Client for Windows 7

「開始」「控制台」「系統管理工具」「iSCSI啟動器」→標籤「探索」→新增「探索入口...」→標籤「目標」→點選「重新整理」→點選目標名稱→點選「連線」「確定」

dreamtails 發表在 痞客邦 留言(0) 人氣()

iSCSI Server安裝與啟用:

step 1. $ yum install kernel-devel openssl-devel gcc rpm-build

step 2. 下載iSCSI-Target Packages(http://iscsitarget.sourceforge.net/)至/tmp

step 3. $ tar zxvf iscsitarget-1.4.20.2.tar.gz

step 4. $ cd /tmp/iscsitarget-1.4.20.2

step 5. $ make

step 6. $ make install

dreamtails 發表在 痞客邦 留言(0) 人氣()

表格名稱為TimeTable.

分別有兩個columns,一個是downTime,一個是upTime.

當我們要計算downTime與upTime的時間相差天數,我們可以用以下的語法產生一個新的column,名為Subtract.

 

mysql> select datediff(`downTime`,`upTime`) as Subtract from TimeTable;

dreamtails 發表在 痞客邦 留言(0) 人氣()

表格名稱為TimeTable. 

分別有兩個columns,一個是downTime,一個是upTime.

當我們要計算downTime與upTime的時間差距的話,我們可以用以下的語法產生一個新的column,名為Subtract.

而我們是以"分" minute來作輸出的單位, 也可使用"小時" hour為單位,或是"秒" second, "天" day, "月" month"年" year.

 

mysql> select timestampdiff(minute,`downTime`,`upTime`) as Subtract from TimeTable;

dreamtails 發表在 痞客邦 留言(0) 人氣()

今天我想要設定10個變數的值皆為100,十個變數分別是R1, R2, R3, R4, R5, R6, R7, R8, R9, R10

我們可以使用如下的方法來搭配for迴圈產生以上十個變數與給值:

for($i=1;$i<11;$i++)
{
      ${"R".$i} = 100;
}

 

以上來源參考至:http://www.cimi.com/space-2-do-blog-id-208.html

dreamtails 發表在 痞客邦 留言(0) 人氣()

使用以下指令:

# mysqladmin -u root password '1234'

 

註:1234就是我們要設定給root的密碼!

dreamtails 發表在 痞客邦 留言(0) 人氣()