廣告

2025 年 4 月
 123456
78910111213
14151617181920
21222324252627
282930  

彙整

VMware MPIO

http://www.weithenn.org/cgi-bin/wiki.pl?VMware_MPIO#Heading4

LACP (Link Aggregation Control Protocol )

在交換器上啟用 LACP 功能配合 ESXi NIC Teaming 設定僅能達成 iSCSI 多重路徑的 故障切換 需求 (但無法達成負載平衡需求),主要是因為 ESXi NIC Teaming 的方式為使用 IP Hash 來進行負載平衡作業,所以當 iSCSI Target 只有一個 IP 位址時 (One TCP Connection) 那麼便只會產生 1 個 Hash 值 (除非 Active 實體網卡斷線才會走不同路徑),因此 iSCSI Initiator 與 iSCSI Target 之間將會永遠只走同一條路徑無法達到多重路徑同時存取的需求,所以無法達成負載平衡需求。而 LACP 設計適合用於特定的環境中使用例如當 Outbound 的目標是多個 IP 位址的環境便能透過 IP Hash 雜湊出不同 Hash 值並存取不同路徑進而顯現出它的效益 (例如存取 NFS Server),總之就是 (NAS / NFS) 這種屬於 File Level 就適用 LACP 來處理。

MPIO (MultiPath Input / Output)

MPIO 在一開始的設計上就是針對 SAN (IP-SAN、FC-SAN) 故障切換及負載平衡 進行設計,因此 iSCSI Initiator 會使用多個 Session 並透過多個實體網路卡做到故障切換及負載平衡方式來登入 iSCSI Target 進行存取,總之就是 (SAN) 這種屬於 Block Level 就適用 MPIO 來處理。

ESXi安裝在USB上開機出現 vSphere 5: System Logging Not Configured

參考網址http://vmforsp.typepad.com/vm-for-service-providers/2011/07/vsphere-5-system-logging-not-configured-by-default.html

安裝在USB上開機,本機沒有硬碟,故會出現此提示,LOG記錄沒有設定存取路徑

clip_image001

規劃使用 ESXi 連接 NAS的NFS服務提供空間存取ESXi LOG

clip_image002

設定ESXi LOG存放路徑參數

clip_image003

設定路逕與資料夾 [ESXi-NFS-BACKUP]/ESXi-log

clip_image005

可以看到系統已在指定的路徑記錄LOG檔了,且該訊息也不在提示

clip_image007

dns: sendto() failed: Connection refused at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/DnsResolver.pm line 411, line 7613

USER反應今天的信都收不到,看了一下MAIL SERVER LOG,發現有下列訊息

Oct 21 06:14:52 mail spamd[1130]: spamd: connection from mail [127.0.0.1] at port 49154

Oct 21 06:14:52 mail spamd[1130]: spamd: setuid to sharon.wang succeeded

Oct 21 06:14:52 mail spamd[1131]: spamd: connection from mail [127.0.0.1] at port 49155

Oct 21 06:14:52 mail spamd[1131]: spamd: setuid to mailbak succeeded

Oct 21 06:14:52 mail spamd[1131]: spamd: processing message <c4128db6ae7249d481212b1e336d3e53@ACAS32.corp.ardentec.com> for mailbak:512

Oct 21 06:14:52 mail spamd[1130]: spamd: processing message <c4128db6ae7249d481212b1e336d3e53@ACAS32.corp.ardentec.com> for sharon.wang:553

Oct 21 06:14:53 mail spamd[1131]: dns: sendto() failed: Connection refused at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/DnsResolver.pm line 411, <GEN13160> line 7613.

Oct 21 06:14:53 mail spamd[1131]: Use of uninitialized value in string ne at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/AsyncLoop.pm line 174, <GEN13160> line 7613.

Oct 21 06:14:53 mail spamd[1131]: plugin: eval failed: oops, no key at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/AsyncLoop.pm line 174, <GEN13160> line 7613.

Oct 21 06:14:53 mail spamd[1131]: dns: sendto() failed: Connection refused at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/DnsResolver.pm line 411, <GEN13160> line 7613.

Oct 21 06:14:53 mail spamd[1131]: Use of uninitialized value in string ne at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/AsyncLoop.pm line 173, <GEN13160> line 7613.

Oct 21 06:14:53 mail spamd[1131]: dns: sendto() failed: Connection refused at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/DnsResolver.pm line 411, <GEN13160> line 7613.

Oct 21 06:14:53 mail spamd[1131]: Use of uninitialized value in string ne at /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/AsyncLoop.pm line 173, <GEN13160> line 7613.

 

信件卡在佇列區無法將信送到使用者信箱。

為了先讓信件可正確寄發,先停用spamassassin 套件。
[root@mail incoming]# /etc/rc.d/init.d/spamassassin stop

停用Postfix呼叫 spamassassin 程序
[root@mail incoming]# vim /etc/procmailrc
將這兩行註解掉
:0fw
| /usr/bin/spamc

 

查了網路上的訊息,應該是說DNS無法正確解析。

http://mail-archives.apache.org/mod_mbox/spamassassin-users/200903.mbox/%3C200903240309.30217.Mark.Martinec+sa@ijs.si%3E
==========================================================
Chris,

> Mar 23 18:01:08 localhost spamd[3676]: dns: sendto() failed:
> Connection refused
> at /usr/lib/perl5/site_perl/5.10.0/Mail/SpamAssassin/DnsResolver.pm
> line 395, <GEN71> line 45.

man 2 sendto

  [ECONNREFUSED]     The socket received an ICMP destination
         unreachable message from the last message sent.  This typically
         means that the receiver is not listening on the remote port.

Your DNS server is not reachable – either it is not running, or
is being blocked by a firewall, or your <chroot>/etc/resolv.conf
is misconfigured.

  Mark
===========================================================

果然發現DC  的DNS服務是關閉的,啟動後再恢復spamassassin 運作即可正常。至於DC DNS為何會關閉,也看不出任何錯誤訊息,再觀察觀察。

CentOS 6.3 安裝 Cacti 監控系統

下載CentOS6 X86-64BIT版

選DeskTop安裝模式

重開機後做基本設定

使用root登入視窗系統

這版網卡要自己手動啟用,請在視窗右上角點右鍵後點選System eth0啟用

clip_image001

編輯連線資訊

clip_image002

clip_image003

clip_image004

讓系統開機自動開啟網路:

一時興起下載了 CentOS-6.3-x86_64-minimal.iso 在 VBox 安裝起來,開機後竟然沒有網路可用。應是是預設沒有開啟,於是在網路上找到解法,要改網路設定檔,把開機啟動的選項設為 yes:

[root@lab ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"

BOOTPROTO="dhcp"

HWADDR="08:00:27:61:6E:0B"

NM_CONTROLLED="yes"

ONBOOT="yes"

TYPE="Ethernet"

UUID="b8e9dffa-0733-4352-8803-900b9dde4bd2"

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

在CENTOS中的防火牆開PORT,可利用下列指令完成(這邊我直接關閉):
#/sbin/iptables -I INPUT -p tcp –dport 10000 -j ACCEPT
上面指令是指,開PORT 10000可以讓外部存取。指令執行後,下列指令做儲存,以便下次開機也套用新值。

#/etc/rc.d/init.d/iptables save
正在儲存防火牆規則到 /etc/sysconfig/iptables:              [  確定  ]
另外可透過下列指令來查看現有防火牆的規則有那些:
#/etc/init.d/iptables status
重新啟動防火牆:
#/etc/init.d/iptables restart
停用防火牆,先查看那個LEVEL有開啟:
#chkconfig –list iptables
iptables        0:關閉  1:關閉  2:開啟  3:開啟  4:開啟  5:開啟  6:關閉
再依照上面的層級關閉,即停用。
#chkconfig –level 2345 iptables off
要再開啟的話:
#chkconfig iptables on

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

設定YUM

更新套件(使用 yum)

YUM – Yellowdog Updater Modified
YUM 官方網站:http://linux.duke.edu/projects/yum/

修改設定檔:

cd /etc/yum.repos.d/
cp CentOS-Base.repo CentOS-Base.repo.bak
vi CentOS-Base.repo

:%s/mirror.centos.org\/centos/ftp.cse.yzu.edu.tw\/pub\/CentOS

:%s/mirror.centos.org\/centos/ftp.cs.pu.edu.tw\/Linux\/CentOS


mirror.centos.org/centos
換成
ftp.cse.yzu.edu.tw/pub/CentOS

ftp.cs.pu.edu.tw/Linux/CentOS

[base]
name=CentOS-$releasever – Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://ftp.cse.yzu.edu.tw/pub/CentOS/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://ftp.cse.yzu.edu.tw/pub/CentOS/RPM-GPG-KEY-CentOS-5

#released updates
[update]
name=CentOS-$releasever – Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://ftp.cse.yzu.edu.tw/pub/CentOS/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://ftp.cse.yzu.edu.tw/pub/CentOS/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://ftp.cse.yzu.edu.tw/pub/CentOS/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://ftp.cse.yzu.edu.tw/pub/CentOS/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://ftp.cse.yzu.edu.tw/pub/CentOS/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://ftp.cse.yzu.edu.tw/pub/CentOS/RPM-GPG-KEY-CentOS-5

更新:

yum -y update

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

安裝 vim-enhanced 加強 vi 的功能:

yum -y install vim-enhanced
mv /bin/vi /bin/vi.bak
ln -s /usr/bin/vim /bin/vi
echo "set nu" >> /etc/vimrc
#在檔案最後面新增 set nu,顯示行數

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

安裝完畢後重新開機進入視窗登入模式:

安裝GCC 套件 For VMware tools用

yum install kernel-devel kernel-headers gcc make

安裝VMware Tools

clip_image006

系統會自動掛載CDROM跳出VM tools程式,解壓縮它到任一目錄下

clip_image007

解壓縮到桌面

clip_image008

執行剛解好的目錄下的 vmware-install.pl

[root@Monitor yum.repos.d]# cd ~

[root@Monitor ~]# ls

anaconda-ks.cfg install.log install.log.syslog 下載 公用 圖片 影片 文件 桌面 範本 音樂

[root@Monitor ~]# cd 桌面

[root@Monitor vmware-tools-distrib]# ./vmware-install.pl

Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?

[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?

[/etc/rc.d]

What is the directory that contains the init scripts?

[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?

[/usr/sbin]

In which directory do you want to install the library files?

[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is

going to create it, including needed parent directories. Is this what you want?

[yes]

In which directory do you want to install the documentation files?

[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program

is going to create it, including needed parent directories. Is this what you

want? [yes]

The installation of VMware Tools 8.3.2 build-257589 for Linux completed

successfully. You can decide to remove this software from your system at any

time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by

invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want

this program to invoke the command for you now? [yes]

Initializing…

Stopping VMware Tools services in the virtual machine:

Guest operating system daemon: [ 確定 ]

Virtual Printing daemon: [ 確定 ]

Unmounting HGFS shares: [ 確定 ]

Guest filesystem driver: [ 確定 ]

Found a compatible pre-built module for vmmemctl. Installing it…

Found a compatible pre-built module for vmhgfs. Installing it…

Found a compatible pre-built module for vmxnet. Installing it…

Found a compatible pre-built module for vmblock. Installing it…

Found a compatible pre-built module for vmci. Installing it…

Found a compatible pre-built module for vsock. Installing it…

Found a compatible pre-built module for vmxnet3. Installing it…

Found a compatible pre-built module for pvscsi. Installing it…

Detected X.org version 7.1.

Host resolution detected as "0 x 0".

Please choose one of the following display sizes that X will start with:

[1] "320×200"

[2] "320×240"

[3] "400×300"

[4] "512×384"

[5] "640×400"

[6] "640×480"

[7] "720×480"

[8] "800×480"

[9] "854×480"

[10] "720×576"

[11] "800×600"

[12] "1024×768"

[13] "1280×720"

[14] "1280×768"

[15] "1152×864"

[16] "1280×800"

[17] "1366×768"

[18] "1280×960"

[19] "1440×900"

[20] "1280×1024"

[21] "1400×1050"

[22] "1680×1050"

[23] "1600×1200"

[24] "1920×1080"

[25] "1920×1200"

[26] "1920×1440"

[27] "2048×1536"

[28] "2560×1600"

[29] "2560×1920"

Please enter a number between 1 and 29:

[3] 12

X Window System Version 7.1.1

Release Date: 12 May 2006

X Protocol Version 11, Revision 0, Release 7.1.1

Build Operating System: Linux 2.6.18-53.el5 i686 Red Hat, Inc.

Current Operating System: Linux mail1.winpex-gl.com 2.6.18-194.8.1.el5 #1 SMP Thu Jul 1 19:07:06 EDT 2010 i686

Build Date: 13 May 2010

Build ID: xorg-x11-server 1.1.1-48.76.el5_5.1

Before reporting problems, check http://wiki.x.org

to make sure that you have the latest version.

Module Loader present

Markers: (–) probed, (**) from config file, (==) default setting,

(++) from command line, (!!) notice, (II) informational,

(WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(++) Log file: "/tmp/vmware-config0/XF86ConfigLog.4401", Time: Wed Aug 11 11:32:50 2010

(++) Using config file: "/tmp/vmware-config0/XF86Config.4401"

The XKEYBOARD keymap compiler (xkbcomp) reports:

> Warning: Multiple symbols for level 1/group 1 on key <I5F>

> Using XF86Sleep, ignoring XF86Standby

> Warning: Symbol map for key <I5F> redefined

> Using last definition for conflicting fields

Errors from xkbcomp are not fatal to the X server

X is running fine with the new config file.

FreeFontPath: FPE "unix/:7100" refcount is 2, should be 1; fixing.

Creating a new initrd boot image for the kernel.

Checking acpi hot plug [ 確定 ]

Starting VMware Tools services in the virtual machine:

Switching to guest configuration: [ 確定 ]

Paravirtual SCSI module: [ 確定 ]

Guest memory manager: [ 確定 ]

VM communication interface: [ 確定 ]

VM communication interface socket family: [ 確定 ]

Guest operating system daemon: [ 確定 ]

Virtual Printing daemon: [ 確定 ]

The configuration of VMware Tools 8.3.2 build-257589 for Linux for this running

kernel completed successfully.

You must restart your X session before any mouse or graphics changes take

effect.

You can now run VMware Tools by invoking the following command:

"/usr/bin/vmware-toolbox" during an X server session.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and

file and text copy/paste), you will need to do one (or more) of the following:

1. Manually start /usr/bin/vmware-user

2. Log out and log back into your desktop session; and,

3. Restart your X session.

Enjoy,

–the VMware team

PieTTY、PtTTY:Microsoft Windows 下好用的 ssh 連線工具

PieTTY 官方網站:http://ntu.csie.org/~piaip/pietty/

下載:http://ntu.csie.org/~piaip/pietty/stable/pietty0327.exe

設定:

選項 / 字元編碼 / Unicode(圖一)

選項 / 亞洲語系修正 / 取消勾選「Unicode 亞洲寬符號字元」(圖二)

設定 ssh 連線安全限制

/etc/rc.conf 加入 sshd_enable="yes"

新增管理者帳號:

useradd mis

passwd mis

只允許管理者使用 ssh 登入:

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

vi /etc/ssh/sshd_config

AllowUsers mis

#在檔案最後面加上這一行,這樣就只有 mis 可以使用 ssh 連線了

#若要設定多人,就用空格隔開:AllowUsers mis mis2

注意:上面這個設定很重要,建議一定要做

重新讀取 ssh 設定檔:

/etc/rc.d/init.d/sshd restart

用 mis 帳號登入後,再用 su – 指令變成 root

三、網路基本設定

FQDN 設定:

hostname mail

vi /etc/hosts

vi /etc/sysconfig/network

DNS 設定:

vi /etc/resolv.conf

nameserver 10.10.10.1 <==指到內部的dns

nameserver 10.10.10.2

#nameserver 168.95.1.1

#nameserver 168.95.192.1

重新啟動網卡:

/etc/rc.d/init.d/network restart

四、tcp_wrappers 基本設定

vi /etc/hosts.deny

ALL:ALL

vi /etc/hosts.allow

ALL:10.10.0.0/255.255.0.0:allow

ALL:10.20.0.0/255.255.0.0:allow

sshd:10.10.0.0/255.255.0.0:allow

sshd:10.20.0.0/255.255.0.0:allow

postfix:ALL:allow

mailscanner:ALL:allow

單一IP設定法

ALL:220.130.47.91:allow

ALL:220.133.4.124:allow

五、關閉 SELinux

vi /etc/sysconfig/selinux

SELINUX=enforcing 改成–> SELINUX=disabled

六、關閉、啟動基本服務

執行 ntsysv 指令,只留下以下服務:

acpid

anacron

cpuspeed

crond

network

sshd

syslog

yum

八、自動校時 (記得防火牆要開 NPT 123 PORT)

yum -y install ntp

ntpdate watch.stdtime.gov.tw && clock -w

時間與頻率國家標準實驗室:http://www.stdtime.gov.tw/chinese/home.htm

NTP 校時軟體(for Windows):http://www.stdtime.gov.tw/chinese/EXE/NTPClock.exe

vi /etc/crontab

0 0-23 * * * root /usr/sbin/ntpdate watch.stdtime.gov.tw > /dev/null 2>&1

#每個小時校時一次

九、WEB server

Apache HTTP Server 官方網站:http://httpd.apache.org/

yum -y install httpd mod_ssl

cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak

vi /etc/httpd/conf/httpd.conf

250行 ServerAdmin root@localhost

354行 UserDir disable 修改成–> #UserDir disable 可開啟個人首頁這邊不開啟

361行 #UserDir public_html 修改成–> UserDir www

#將個人網頁資料夾改成由 public_html 改成 www,方便輸入

390行 DirectoryIndex index.html index.html.var 修改成–> DirectoryIndex index.html index.htm index.php index.html.var

730行 LanguagePriority zh-TW en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN

746行 AddDefaultCharset UTF-8 修改成–> #AddDefaultCharset UTF-8

/etc/rc.d/init.d/httpd restart

chkconfig httpd on

十、Webmin:好用的web介面作業系統管理工具

Webmin 官方網站:http://www.webmin.com

抓新版

wget http://downloads.sourceforge.net/project/webadmin/webmin/1.600/webmin-1.600-1.noarch.rpm?r=http%3A%2F%2Fwww.webmin.com%2Fdownload.html&ts=1349770459&use_mirror=nchc

rpm -ivh webmin-1.600-1.noarch.rpm

測試:http://IP:10000

若開不起來,看看是不是本機防火牆擋掉了,開啟10000 port

clip_image010

clip_image012

中文化設定:Webmin Configuration / Language / Traditional Chinese(ZH_TW.BIG5)

啟動 Webmin 的 SSL 支援:

yum -y install perl-Net-SSLeay

Webmin / Webmin 組態 / SSL加密 / 如果可用 SSL 的話啟用

Webmin 官方文件:http://www.webmin.com/index2.html

測試127.0.0.1 SNMP是否正常,並秀MIB資料

[root@localhost ~]# snmpwalk -v 2c -c public 127.0.0.1

安裝參考(一):

http://download.ithome.com.tw/article/index/id/288

軟體開箱文~~系統效能監控軟體Cacti 安裝

Cacti 執行環境建立

要安裝Cacti 程式之前請先確認系統的部分功能已經完成安裝,所包含的部分有php,MySQL,snmp等功能,如果沒有提供簡單的指令請先將這些功能建立好。

Step 1. 安裝php 程式執行環境。

[root@localhost ~]# yum -y install php php-devel php-snmp php-mysql

Step 2. 安裝mysql 資料庫軟體。

[root@localhost ~]# yum -y install mysql mysql-server mysql-devel

Step 3. 安裝snmp 訊息服務。

[root@localhost ~]# yum -y install net-snmp net-snmp-devel net-snmp-utils

Step 4. 取得rrdtool 第三方安裝套件。

這邊改抓64BIT版本

[root@localhost ~]# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

Step 5. 使用rpm 安裝第三方支援套件。

[root@localhost ~]# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

Step 6. yum 安裝rrdtool 程式。

[root@localhost ~]# yum -y install rrdtool

Step 7. 以上的軟體安裝完畢後請檢查檢查幾個項目是否有正確安裝,檢查的指令使用

[root@localhost ~]# php -m

Step 8. 需要檢查的項目mysql,snmp,xml,session,sockets。

[root@localhost ~]# php -m | grep mysql

[root@localhost ~]# php -m | grep snmp

[root@localhost ~]# php -m | grep xml

[root@localhost ~]# php -m | grep session

[root@localhost ~]# php -m | grep sockets

MySQL 資料庫服務安裝

確認都有安裝需要的套件後請啓動MySQL 服務,並且進行MySQL 資料庫設定。

Step 1. 啓動MySQL 資料庫服務。

[root@localhost ~]# service mysqld start

Step 2. 設定MySQL 資料庫管理密碼。

[root@localhost ~]# mysqladmin –user=root password <要設定的密碼>

PHPMYADMIN安裝與設定

[root@Monitor html]# yum install phpmyadmin

加入瀏覽權限

[root@Monitor html]# vi /etc/httpd/conf.d/phpmyadmin.conf

# Web application to manage MySQL

#

<Directory "/usr/share/phpmyadmin">

Order Deny,Allow

Deny from all

Allow from 127.0.0.1 10.10.10.0/16

</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin

Alias /phpMyAdmin /usr/share/phpmyadmin

Alias /mysqladmin /usr/share/phpmyadmin

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

設定PHPMYADMIN連線認證方式

[root@cacti cacti]# vi /usr/share/phpmyadmin/config.inc.php

$cfg[‘blowfish_secret’] = ‘cookie’; //這個要設為 cookie 喔~

$cfg[‘Servers’][$i][‘auth_type’] = ‘http’;
/* User for advanced features */
$cfg[‘Servers’][$i][‘controluser’] = ‘root’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘*設定你的root密碼*’;
===================================

問題: 無法登入
phpMyAdmin預設的登入方式為:『config』。此時需要事先將上述的帳號密碼修改正確。若想要在登錄時才輸入帳號密碼認證,則可以修改下列一行:
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’; // (註:另外有http協定)
此時,會忽略 config.inc.php內之user / password 設定。
問題: 設定檔案現在需要密碼 (passphrase) (blowfish_secret).
$cfg[‘blowfish_secret’] = ‘cookie’; //這個要設為 cookie 喔~
問題: 找不到 PHP 內的 mbstring 編碼模組, 沒有這個模組, phpMyAdmin 無法準確地分割雙字元文字, 而可能產生問題.
安裝php5-mbstring, 于原始光碟片中的rpm資料夾中可以找到,直接執行即可.
問題: 無法讀取 mysql 模組,
請檢查 PHP 設定
http://rpmfind.net/linux/rpm2html/search.php?query=Mcrypt.so 下載
最好的辦法:
$cfg[‘Servers’][$i][‘auth_type’] = ‘http’;
/* User for advanced features */
$cfg[‘Servers’][$i][‘controluser’] = ‘root’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘*設定你的root密碼*’;
匯入文字檔時,中文無法匯入
文字檔預設編碼為big5,可使用big5匯入或者將文字檔轉碼為utf8.

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

將CentOS 改為TEXT模式開機,節省記憶體使用:

[root@cacti ~]# vi /etc/inittab

5為視窗模式開機,改為3變文字模式

id:5:initdefault: ==> id:3:initdefault:

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

安裝Cacti 程式

Step 1. yum安裝cacti。

[root@Monitor html]# yum install cacti

Step 4. 建立cacti 資料庫

[root@localhost html]# mysqladmin –user=root –password=abcd1234 create cacti

Step 5. 切換到cacti 資料夾中(YUM安裝預設目錄)。

[root@Monitor www]# cd /var/www/cacti/

Step 6. 將cacti.sql 的資料表匯入到cacti 資料庫中。

[root@Monitor cacti]# mysql –user=root –password=winpex@29113637 cacti < cacti.sql

Step 7. GRANT 權限給其他的使用者。(這一個部分如果只有一個root 的使用者就可以先略過不設定。)

登入mysql 資料庫(直接給root管資料庫不修改)。

[root@localhost cacti]# mysql –user=root –password=密碼 mysql

Step 8. GRANT cacti 資料庫權限給Cacti 資料庫使用者(直接給root管資料庫不修改)。

mysql > GRANT ALL ON cacti.* TO 帳號@主機名稱(預設是localhost) IDENTIFIED BY ‘密碼’;

mysql > flush privileges;

mysql > exit

Step 9. 設定資料庫連線資訊。

[root@localhost cacti]# vim include/config.php

$database_type = "mysql";

$database_default = "cacti"; /* 設定資料庫名稱 */

$database_hostname = "localhost";

$database_username = "root"; /* 設定資料庫帳號 */

$database_password = "abcd1234"; /* 設定資料庫密碼 */

$database_port = "3306"; /* 設定資料庫連線的PORT */

$database_ssl = false;

Step 10. 設定防火牆開啓MySQL 資料庫通訊PORT(已用安裝參考二把這台的防火牆關閉,步驟可免)。

[root@localhost cacti]# vim /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT

Step 11. 重新啓動防火牆服務(也免做這步驟)。

[root@localhost cacti]# service iptables restart

Step 12. 修改rra 與log 資料夾擁有者。

[root@localhost cacti]# chown -R root.root rra/ log/

Step 13. 設定Cacti 的排程設定。

yum安裝cacti 已自動載入設定

[root@cacti cacti]# vi /etc/cron.d/cacti

*/5 * * * * cacti php /var/www/cacti/poller.php &>/dev/null

給網頁目錄權線

[root@cacti rra]# chown -R cacti.root /var/www/cacti/

完成Cacti 安裝進入首次使用設定畫面。

開放http目錄權限

[root@Monitor ~]# vi /etc/httpd/conf.d/cacti.conf

Alias /cacti/ /var/www/cacti/

<Directory /var/www/cacti/>

DirectoryIndex index.php

Options -Indexes

AllowOverride all

order deny,allow

deny from all

allow from 127.0.0.1 10.10.10.0/24

AddType application/x-httpd-php .php

php_flag magic_quotes_gpc on

php_flag track_vars on

</Directory>

[root@Monitor ~]# /etc/init.d/httpd restart

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

啟動HTTPD出錯誤訊息

Performing sanity check on apache22 configuration:
httpd: apr_sockaddr_info_get() failed for www.yourdomain.com
httpd2: Could not determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

查了許久,終於發現問題了
問題是出在lookup www.yourdomain.com時DNS認不得新的主機

解決方法:
檢查DNS設定是否正確
確認www.yourdomain.com 有正確的設定在/etc/hosts裡頭
初始設定的DNS設定為
# ::1 localhost domain.com
# 127.0.0.1 localhost domain.com
將其設成
::1 localhost yourdomain.com
127.0.0.1 localhost yourdomain.com

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

Step 1. 連結http://10.10.10.25/cacti/ 連線Cacti 系統,並開始第一次使用設定。

clip_image013

Step 2. 設定安裝的類別,完成按下Next>>。

clip_image014

Step 3. 系統設定資訊不用去修改,就是使用目前的預設資訊即可。

clip_image015

Step 4. 輸入第一次登入的帳號密碼,Cacti 系統預設是admin/admin。

clip_image016

Step 5. 完成第一次登入之後Cacti 系統會強置要求你修改密碼。

clip_image017

Step 6. Cacti 系統畫面,看到這邊表示已經安裝成功。

Cacti 是使用SNMP 的服務收集Cilent 端回覆的系統資訊,再將所獲得的系統資訊轉化成圖表跟系統狀態狀態資訊,完成了Cacti 的安裝還要設定好SNMP 的服務才可以開始收到需要的報表。

設定SNMP 分爲兩個部分,就是Client 端和Server 端兩段,設定的方式不同,但是都不會太困難只要依照指示將設定資訊設定在正確的位置上就可以了。

SNMP Server 端設定。

Step 1.  修改設定檔snmpd.conf。

[root@localhost ~]# vim /etc/snmp/snmpd.conf

view systemview included .1.3.6.1.2.1.1

view systemview included .1.3.6.1.2.1.2 /*新增設定值*/

view systemview included .1.3.6.1.2.1.25.1.1

設定的相關資訊。

clip_image018

Step 2. 修改增加SNMP 服務的PORT 服務(防火牆已關可省略)。

[root@localhost ~]# vim /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 161 -j ACCEPT

Step 3. 重新啓動SNMP 服務。

root@localhost ~]# service snmpd restart

以上就完成了Server 端的設定,再來設定Client 端的資訊。

Step 1. 開啓設定檔案修改Client 設定資訊。

[root@localhost ~]# vim /etc/snmp/snmpd.conf

Step 2. 設定Server 端的IP 資訊Client 端的設定檔。

這裡我這樣設定:

com2sec local localhost public

com2sec mynetwork 10.20.0.0/16 public

com2sec mynetwork 10.10.0.0/16 public

com2sec mynetwork 10.11.0.0/16 public

com2sec mynetwork 10.12.0.0/16 public

com2sec mynetwork 10.13.0.0/16 public

com2sec mynetwork 10.14.0.0/16 public

com2sec mynetwork 10.15.0.0/16 public

com2sec mynetwork 10.200.0.0/16 public

Step 3.  修改group 的資訊。

這裡我這樣設定:

group MyRWGroup v1 local

group MyRWGroup v2c local

group MyRWGroup usm local

group MyROGroup v1 mynetwork

group MyRWGroup v1 otherv3user

Step 4. 修改view 的資訊。

view systemview included .1.3.6.1.2.1.2

view all included .1 80

clip_image019

Step 5. 修改access 資訊。

access MyROGroup "" any noauth exact all none none

access MyRWGroup "" any noauth exact all all none

clip_image020

Step 6. 在設定檔的最後面加上設定Client 回傳硬碟資訊。

disk / 10000

disk /dev/shm 10000

Step 7. 完成設定重新啓動SNMP 服務。

[root@localhost ~]# service snmpd restart

Step 8. 開啓防火牆SNMP 服務的PORT(已關防火牆)。

[root@localhost ~]# vim /etc/sysconfig/iptables

-A RH-Firewall-1-INPUT -m state –state NEW -m udp -p udp –dport 161 -j ACCEPT

Step 9. 重新啓動防火牆服務(已關防火牆)。

[root@localhost ~]# service iptables restart

建立監控圖表

Cacti 有提供一個最基本監控系統需要的資訊,設定的步驟還算簡單。

Step 1. 設定設備資訊,點選Console->Device。

clip_image021

Step 2. 選擇Add 增加新的設備資訊。

clip_image023

Step 3.在Description 輸入主機的名稱,Hostname 輸入主機的IP,HostTemplate選擇ucd/net SNMP Host,Down Device Detection 選擇Ping and SNMP 完成這幾個項目的設定再按下Create 按鈕產生新的主機。

clip_image025

加入Windows 監控:

安裝Windows SNMP服務:

打開Control Panel、Add or Remove Programs、Add/Remove Windows Components、Management and Monitoring Tools 、Details、Simple Network Management Protocol開始安裝。

設定Windows SNMP服務:

我的電腦按右鍵 => 管理 => 服務 => 找到 “SNMP服務” 按右鍵選 “內容”

設定安全性如下

clip_image026

Ip列表內的主機才可抓到此台WINDOWS SNMP資料。

clip_image027

連入 Cacti 管理頁面新增Windows 監控主機

clip_image029

clip_image031

clip_image033

設定要監控的選項,這圖要監控Logged in Users與 Processes狀況

clip_image035

這圖要監控網路、處理器資訊、硬碟使用狀況

clip_image037

建立監控圖

clip_image039
勾選要建立監控資訊並建立監控圖
clip_image041
clip_image043

clip_image044

建立好的圖表選項會反灰

clip_image046

剛建好的主機 DC1

clip_image048

建立Windows 專用根目錄

clip_image049

clip_image050

加入DC1到Windows 根目錄下:

clip_image051

clip_image052

clip_image053

clip_image054

查看DC1狀態

clip_image055

clip_image057

vCenter Converter Standalone 轉換發生FAILED: Unable to obtain the IP address of the helper virtual machine

發生FAILED: Unable to obtain the IP address of the helper virtual machine.

clip_image001

轉DMZ區的Linux系統時,系統會使用DHCP抓個IP來給輔助VM使用,若轉換的目的ESXi Server區段沒有DHCP服務即會發生此問題,在轉換時手動給IP可解決此問題。

手動給予IP

3

從網路位置開啟檔案時,Office 程式速度緩慢或可能停止回應

一切都是微軟的問題……………

解決方法:
[方法一]
安裝Microsoft Fix it 50741 (微軟官方網站)
[方法二]
依序移除KB2541025和KB2502786。

參考網址
http://bonisbusy.blogspot.tw/2011/07/office-2003-excelxls.html

http://support.microsoft.com/kb/833041/zh-tw

http://diary.blog.yam.com/vicki92/article/9913122

http://jerry2yang.wordpress.com/2011/07/06/%E9%80%8F%E9%81%8E%E7%B6%B2%E8%B7%AF%E7%A3%81%E7%A2%9F%E8%AE%80%E5%8F%96excel%E6%AA%94%E6%A1%88%E9%80%9F%E5%BA%A6%E5%BE%88%E6%85%A2%EF%BC%9Foffice2003/

QNAP iSCSI 連線模式測試兩台ESXi Server斷線復原與備援

話說VM ESXi 5.1 越來越強,ESXi 4.1版 以前ASUS M5000系列的 PC 都無法安裝(內建網卡抓不到),現在可直接支援,連瑞昱的 giga網卡也都抓的到了,真是太棒了!!

測試環境:

1.QNAP TS259 使用iSCSI模式

2.兩台ESXi Server A與B

3.A Server使用iSCSI連線兩台VM XP( XP1 XP2)

 

測試方式:

 

1.由A Server先安裝兩台VM XP,模擬網路中斷或A Server故障後復原的情況:

l 若是網路斷線或設備異常修復後接回網路線,測試結果是 iSCSI連線的VM會回復斷線前開機的模樣,也就是不影響VM主機的狀態,是完完整整的回復系統當下開機斷線前的狀態,可直接復原操作系統。

 

2.A Server故障時,由B Server開啟iSCSI連線開啟原先A Server的iSCSI VM XP1:

l 系統會詢問是移動還是複製,這裡選moved ,系統會以重新開機的方式開啟VM XP1

clip_image001

 

結論:

若A server已開啟VM XP1,則B Server就無法開啟VM XP1 ,一個iSCSI VM連線同時間下只能對應一個Server開啟。

只要iSCSI設備不故障,機本上不怕Server硬體或網路故障,只要有備援Server隨時可切換,只是得人工手動到現場處理。

當然若是預算夠,Strage iSCSI設備可買HA功能的,然後VM ESXi 也可買有HA功能的,這樣除了硬體外,連VM的軟體也都可做到HA,不怕設備壞,工作不間斷的系統環境就可達成。

VM ESXi 新增硬碟出現 Call "HostDatastoreSystem.QueryVmfsDatastoreCreateOptions" for object "ha-datastoresystem" on ESXi "x.x.x.x" failed. 訊息

解決方式
以 SSH 連線登入 ESXi Server,此時可將 iSCSI 磁碟視為「安裝」好的本機磁碟,查詢 iSCSI 磁碟的裝置名稱與磁區狀態,用的當然是 Linux 的 fdisk 指令…

================================
查尋磁碟機名稱
~ # fdisk -l

Disk /dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1M: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

設定該磁碟機分割區
~#fdisk /dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1M

The number of cylinders for this disk is set to 121601.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

新建分歌區(若已有分割區請按d刪除後重建)
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)

設定為主要分割區1
p
Partition number (1-4): 1
First cylinder (1-121601, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601): Using default value 121601

列出分割區狀況
Command (m for help): p

Disk /dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1M: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                                                                               Device Boot      Start         End      Blocks  Id System
/dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1Mp1             1    121601 976760001   83  Linux

寫入狀態後離開
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table

最後執行這段官方指令
~ # dd if=/dev/zero of="/dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1M" bs=512 count=34 conv=notrunc
34+0 records in
34+0 records out

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

參考來源
http://blogs.yyes.chc.edu.tw/post/2/3401
http://kb.vmware.com/selfservice/documentLinkInt.do?micrositeID=&popup=true&languageId=&externalID=1008886

VM ESXi 新增硬碟出現 Call "HostDatastoreSystem.QueryVmfsDatastoreCreateOptions" for object "ha-datastoresystem" on ESXi "x.x.x.x" failed. 訊息

解決方式
以 SSH 連線登入 ESXi Server,此時可將 iSCSI 磁碟視為「安裝」好的本機磁碟,查詢 iSCSI 磁碟的裝置名稱與磁區狀態,用的當然是 Linux 的 fdisk 指令,「fdisk -l」顯示這個硬碟已被切割為三個磁區,難怪 ESXi 無法格式化,逐一刪除磁區後,回到 VMware vSphere Client 重複 Add Storage 步驟就可以了。

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

~ # fdisk -l

Disk /dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1M: 1000.2 GB, 10002048860                                                                                               16 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                                                                               Device Boot      Start         En                                                                                               d      Blocks  Id System

Disk /dev/disks/mpx.vmhba32:C0:T0:L0: 4005 MB, 4005560320 bytes
64 heads, 32 sectors/track, 3820 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

                           Device Boot      Start         End      Blocks  Id System
/dev/disks/mpx.vmhba32:C0:T0:L0p1             5       900    917504    5  Extended
/dev/disks/mpx.vmhba32:C0:T0:L0p4   *         1         4      4080    4  FAT16 <32M
/dev/disks/mpx.vmhba32:C0:T0:L0p5             5       254    255984    6  FAT16
/dev/disks/mpx.vmhba32:C0:T0:L0p6           255       504    255984    6  FAT16
/dev/disks/mpx.vmhba32:C0:T0:L0p7           505       614    112624   fc  VMKcore
/dev/disks/mpx.vmhba32:C0:T0:L0p8           615       900    292848    6  FAT16

 

~ # fdisk /dev/disks/t10.ATA_____Hitachi_HDS721010CLA332_______________________JP6921HD1PJY1M

Command (m for help): m
Command Action
a       toggle a bootable flag
b       edit bsd disklabel
c       toggle the dos compatibility flag
d       delete a partition
l       list known partition types
n       add a new partition
o       create a new empty DOS partition table
p       print the partition table
q       quit without saving changes
s       create a new empty Sun disklabel
t       change a partition’s system id
u       change display/entry units
v       verify the partition table
w       write table to disk and exit
x       extra functionality (experts only)

 

Command (m for help): d
Selected partition 1

 

Command (m for help): w
The partition table has been altered!

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

參考來源
http://blogs.yyes.chc.edu.tw/post/2/3401

HP2510G設定開啟與關閉802.3ad-LACP

HP2510G設定開啟與關閉802.3ad-LACP

telnet 連入HP2510

============
HP2910al>
HP2910al> config
HP2910al(config)# int 1-4 disable
HP2910al(config)# int 1-4 lacp passive
HP2910al(config)# int 1-4 enable
HP2910al(config)#

============
HP2910al(config)# show lacp

                           LACP

   PORT   LACP      TRUNK     PORT      LACP      LACP
   NUMB   ENABLED   GROUP     STATUS    PARTNER   STATUS
   —-   ——-   ——-   ——-   ——-   ——-
   1      Passive   1         Down      No        Success
   2      Passive   2         Down      No        Success
   3      Passive   3         Down      No        Success
   4      Passive   4         Down      No        Success

HP2910al(config)#

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

If you do have cables connected, and the attached network node is properly configured, then this is what you should see after executing the show lacp command.:

HP2910al(config)# show lacp

                           LACP

   PORT   LACP      TRUNK     PORT      LACP      LACP
   NUMB   ENABLED   GROUP     STATUS    PARTNER   STATUS
   —-   ——-   ——-   ——-   ——-   ——-
   1      Passive   Dyn1      Up        Yes       Success
   2      Passive   Dyn1      Up        Yes       Success
   3      Passive   Dyn1      Up        Yes       Success
   4      Passive   Dyn1      Up        Yes       Success

HP2910al(config)#

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

關閉 lacp

Hi Jagyouare –

If you want to turn lacp off on only interface A2, you can do it as follows:

  (config)# int a2
  (eth-A2)# no lacp

If you want to turn it off for a range of interfaces, such as A1 through B4, you can do:

  (config)# int a1-b4
  (eth-A1-A24,B1-B4)# no lacp

In either case, you can do a "show run" to verify that it did what you intended.