最近把所有pc上的vm全部轉到 HP DL380 G7 上
而guest os全部放在server的肚子裡 這樣就可以方便用 snapshot來進行backup 而不用停機
(建議使用外接的storage跑iscsi 這樣也可以用snapshot備份)
但最近發現備份總是備不完
原因是卡在其中的一個guest
找了好久 發現應該是snapshot滿了
因為vzdump預設只會開1G的snapshot 而當snapshot滿了後 整個備份就會停住 卡在當時備份的guest 這時就要把這個process kill掉才能再接下去 而kill 掉的這個備份也就不會成功
早上又發生了
用lvs看了一下
proxmox#lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
data pve owi-aos- 1.25t
root pve -wi-ao-- 40.00g
swap pve -wi-ao-- 70.00g
vzsnap-proxmox78-0 pve swi-aos- 1.00g data 100
果然是滿了
再到forum找找如何增加sanpshot的size
Re: Backup vzdump hanging at vmtar
its only 1 gb, increase to 2 gb (see below).
as you did not answer to my question regarding vzdump.conf I assume you do not have any settings there.
just create the file and enter:
Code:
nano /etc/vzdump.conf
Code:
size: 2048
為了省麻煩
這裡直接加到10G
再觀察看看囉
2012/06/25
今天在找利用python 來傳gtalk訊息的方法
並不困難
程式碼如下
import xmpp
login = 'abcde' # @gmail.com
pwd = '123456'
cnx = xmpp.Client('gmail.com')
cnx.connect( server=('talk.google.com',5222) )
cnx.auth(login,pwd, 'botty')
cnx.send( xmpp.Message( "defghi@gmail.com" ,"Hello World from abcde!!!" ) )
==========================================================
加上測port變成一個監控机器人
import xmpp
import socket
address='1.1.1.1'
port = int(80)
p = str(port)
mes=address+' port '+p+' ok'
s = socket.socket()
try:
s.connect((address,port))
print s
login = 'abcde' # @gmail.com
pwd = '123456'
cnx = xmpp.Client('gmail.com')
cnx.connect( server=('talk.google.com',5222) )
cnx.auth(login,pwd, 'botty')
cnx.send( xmpp.Message( "defghi@gmail.com" ,mes ) )
except:
print "fail"
2012/06/24
最近有一個需求是想把小主機放在螢幕後
取代原電子看板
os使用ubuntu 12.04
這樣只要固定開特定網頁就可以了
但只要把keyboard mouse拆下來再重開後
過不了多久螢幕還是會進入保護模式而變黑
測了好久
發現是xwindows的問題
就算在設定上都把螢幕保護及電源管理關了
還是會發生
最後找到下列的指令
加到預設登入user的.profile後
就沒再發生了
export DISPLAY=:0.0 && /usr/bin/xset -dpms
export DISPLAY=:0.0 && /usr/bin/xset s 0 0
export DISPLAY=:0.0 && /usr/bin/xset s noblank
export DISPLAY=:0.0 && /usr/bin/xset s noexpose
要看所有設定的話用
xset -q
2012/06/23
之前用openfiler來測iscsi給proxmox用
測完把openfiler拿掉後
proxmox的機器上就一直出現
/dev/sdh: read failed after 0 of 4096 at 0: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234036224: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234093568: Input/output error
/dev/sdh: read failed after 0 of 4096 at 4096: Input/output error
這樣的error
應該是雖然iscsi拿掉
但os捉到的disk卻還掛著
本來是想不理他
等下次升級kernel再reboot應該就會解決了
但最近的排程backup一直出問題
不知道是不是因為這個原因
所以查了一下資料
要怎麼在不reboot的情況下把disk拿掉
只要一行指令
echo offline > /sys/block/sdh/device/state
雖然在/proc/scsi/scsi還是有看到
Host: scsi9 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
Host: scsi10 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access
但i/o error的訊息不會再跑出來了
測完把openfiler拿掉後
proxmox的機器上就一直出現
/dev/sdh: read failed after 0 of 4096 at 0: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234036224: Input/output error
/dev/sdh: read failed after 0 of 4096 at 10234093568: Input/output error
/dev/sdh: read failed after 0 of 4096 at 4096: Input/output error
這樣的error
應該是雖然iscsi拿掉
但os捉到的disk卻還掛著
本來是想不理他
等下次升級kernel再reboot應該就會解決了
但最近的排程backup一直出問題
不知道是不是因為這個原因
所以查了一下資料
要怎麼在不reboot的情況下把disk拿掉
只要一行指令
echo offline > /sys/block/sdh/device/state
雖然在/proc/scsi/scsi還是有看到
Host: scsi9 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access ANSI SCSI revision: 04
Host: scsi10 Channel: 00 Id: 00 Lun: 00
Vendor: OPNFILER Model: VIRTUAL-DISK Rev: 0
Type: Direct-Access
但i/o error的訊息不會再跑出來了
2012/06/13
2012/06/09
今天一直在找串流的解決方案
目前比較方便的方法是直接使用html5的video tag
再把檔案轉成webm 或 mp4放上去
以下是可以轉檔,合併,裁切的軟体
還不用
http://www.freemake.com/tw/
目前比較方便的方法是直接使用html5的video tag
再把檔案轉成webm 或 mp4放上去
以下是可以轉檔,合併,裁切的軟体
還不用
http://www.freemake.com/tw/
2012/05/29
2012/05/28
2012/05/27
要在ifame裡讓網頁能refresh
只要在原始的網頁加上meta就可以了
如下
test.html
<html>
<body>
<Iframe src="1.html"; width="800" height="25" scrolling="no" frameborder="0"></iframe>
</body>
</html>
=====================================================
1.html
<html>
<head>
<meta http-equiv="refresh" content="2" />
</head>
<body>
ifram 8888
</bdoy>
</html>
如此只要修改1.html的內容 test.html 2秒後就會自動更新
今天想到一個需求
要將youtube的影片自動並重複播放
新版iframe內嵌程式碼
新版因為採用新的技術來播放影片,而YouTube也尚未釋出新的自動播放參數,所以只需修改一下新版iframe內嵌程式碼 就可以達成我們自動播放YouTube嵌入影片的目的!
原理是把新版iframe內嵌程式碼的影片網址改成舊版embed內嵌程式碼的影片網址就可以重新使用舊版的YouTube嵌入影片的自動播放參數。
首先必須把藍色的embed
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/pY5jko0w8PQ" frameborder="0" allowfullscreen></iframe>
改成v
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/v/pY5jko0w8PQ" frameborder="0" allowfullscreen></iframe>
然後同樣地把自動播放參數
&autoplay=1
重複播放參數為
&loop=1
加在綠色的影片ID後面
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/v/pY5jko0w8PQ&autoplay=1&loop=1" frameborder="0" allowfullscreen></iframe>
http://happy-yblog.blogspot.com/2011/03/youtube_28.html
===================================================================
建立公開播放清單後也可以使用
<iframe width="853" height="480" src="http://www.youtube.com/embed/videoseries?list=PL79665B85A32A6DC1&hl=zh_TW" frameborder="0" allowfullscreen></iframe>
改為
<iframe width="853" height="480" src="http://www.youtube.com/embed/videoseries?list=PL79665B85A32A6DC1&autoplay=1&loop=1" frameborder="0" allowfullscreen></iframe>
用BlueGriffon編輯時以上的語法會顯示有錯誤
要改成如下
<iframe width="560"
height="315" frameborder="0" src="http://www.youtube.com/embed/videoseries?list=PL79665B85A32A6DC1&autoplay=1;loop=1;hl=zh_TW"
allowfullscreen="1"></iframe>
還沒找到去除廣告的方法
要將youtube的影片自動並重複播放
新版iframe內嵌程式碼
新版因為採用新的技術來播放影片,而YouTube也尚未釋出新的自動播放參數,所以只需修改一下新版iframe內嵌程式碼 就可以達成我們自動播放YouTube嵌入影片的目的!
原理是把新版iframe內嵌程式碼的影片網址改成舊版embed內嵌程式碼的影片網址就可以重新使用舊版的YouTube嵌入影片的自動播放參數。
首先必須把藍色的embed
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/pY5jko0w8PQ" frameborder="0" allowfullscreen></iframe>
改成v
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/v/pY5jko0w8PQ" frameborder="0" allowfullscreen></iframe>
然後同樣地把自動播放參數
&autoplay=1
重複播放參數為
&loop=1
加在綠色的影片ID後面
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/v/pY5jko0w8PQ&autoplay=1&loop=1" frameborder="0" allowfullscreen></iframe>
http://happy-yblog.blogspot.com/2011/03/youtube_28.html
===================================================================
建立公開播放清單後也可以使用
<iframe width="853" height="480" src="http://www.youtube.com/embed/videoseries?list=PL79665B85A32A6DC1&hl=zh_TW" frameborder="0" allowfullscreen></iframe>
改為
<iframe width="853" height="480" src="http://www.youtube.com/embed/videoseries?list=PL79665B85A32A6DC1&autoplay=1&loop=1" frameborder="0" allowfullscreen></iframe>
用BlueGriffon編輯時以上的語法會顯示有錯誤
要改成如下
<iframe width="560"
height="315" frameborder="0" src="http://www.youtube.com/embed/videoseries?list=PL79665B85A32A6DC1&autoplay=1;loop=1;hl=zh_TW"
allowfullscreen="1"></iframe>
還沒找到去除廣告的方法
2012/05/25
今天使用了openfiler測了一下iscsi
感覺還不錯用
iscsi應該是未來考慮的方向
但iscsi無法用來backup
所以backup還是要用nfs
LVM Groups with Network Backing
In this configuration, network block devices (iSCSI targets) are used as the physical volumes for LVM logical volume storage. This is a two step procedure and can be fully configured via the web interface.
- First, add the iSCSI target. (On some iSCSI targets you need to add the IQN of the Proxmox VE server to allow access.)
- Click 'Add iSCSI Target' on the Storage list
- As storage name use whatever you want but take care, this name cannot be changed later.
- Give the 'Portal' IP address or servername and scan for unused targets
- disable 'use LUNs direcly'
- Click save
- Second, add LVM group on this target.
- Click 'Add LVM Group' on the Storage list
- As storage name use whatever you want but take care, this name cannot be changed later.
- For 'Base Storage', use the drop down menu to select the previously defined iSCSI target.
- For 'Base Volume' select a LUN
- For 'Volume Group Name' give a unique name (this name cannot be changed later).
- Enable shared use (recommended)
- Click save
http://pve.proxmox.com/wiki/Storage_Model#LVM_Groups_with_Network_Backing
這個方法是開win7分享比較快的方法
控制台/ 網路和網路時間 / 網路和共用中心
點 網路共用設定 遵守以下開放設定
開放網路探索
開啟檔案及印表機共用
開啟共用,只獨取具有網路存取的人員讀取和寫入公用資料夾中的檔案
關閉以檔案保護共用
使用使用者帳戶和密碼連線到其他電腦 <<我這個剛好沒設定到!
在資料夾 按 鼠標 右鍵
共用對象 / 特定人員
選擇 Guest 點 新增(A) 後 按下 共用(H) 離開 其他作業系統 網路芳鄰 就可進入
這是要在名稱那設個Guest這個名稱,再按照過程設定!
http://tw.myblog.yahoo.com/jw!s3sQQxaBGw6A8aLmgO3xCzgU/article?mid=290&prev=291&next=289
控制台/ 網路和網路時間 / 網路和共用中心
點 網路共用設定 遵守以下開放設定
開放網路探索
開啟檔案及印表機共用
開啟共用,只獨取具有網路存取的人員讀取和寫入公用資料夾中的檔案
關閉以檔案保護共用
使用使用者帳戶和密碼連線到其他電腦 <<我這個剛好沒設定到!
在資料夾 按 鼠標 右鍵
共用對象 / 特定人員
選擇 Guest 點 新增(A) 後 按下 共用(H) 離開 其他作業系統 網路芳鄰 就可進入
這是要在名稱那設個Guest這個名稱,再按照過程設定!
http://tw.myblog.yahoo.com/jw!s3sQQxaBGw6A8aLmgO3xCzgU/article?mid=290&prev=291&next=289
2012/05/22
今天把snort 升到2923
有點小麻煩
首先需要再上
libdnet-1.11-1.2.el6.rf.i686.rpm
才能安裝
裝完改完config
執行
/usr/sbin/snort-mysql -i eth1 -D -c /etc/snort/snort.conf
出現找不到 libdnet.1這個檔
明就有裝 Orz
找了一下
/usr/lib/libdnet.so.1.0.1
/usr/lib/libdnet.so.1
但沒有libdnet.1
算了
link給牠
ln -s libdnet.1 libdnet.so.1.0.1
再執行
/usr/sbin/snort-mysql -i eth1 -D -c /etc/snort/snort.conf
搞定!!
PS. oinkcodes還是不能下載 已經一個多星期了 效率有夠差的 還收錢
有點小麻煩
首先需要再上
libdnet-1.11-1.2.el6.rf.i686.rpm
才能安裝
裝完改完config
執行
/usr/sbin/snort-mysql -i eth1 -D -c /etc/snort/snort.conf
出現找不到 libdnet.1這個檔
明就有裝 Orz
找了一下
/usr/lib/libdnet.so.1.0.1
/usr/lib/libdnet.so.1
但沒有libdnet.1
算了
link給牠
ln -s libdnet.1 libdnet.so.1.0.1
再執行
/usr/sbin/snort-mysql -i eth1 -D -c /etc/snort/snort.conf
搞定!!
PS. oinkcodes還是不能下載 已經一個多星期了 效率有夠差的 還收錢
2012/05/21
2012/05/18
今天有必須在win上使用sftp來備份的需求
找到了這一篇
還不錯用
winscp可以下載portable的版本 不用安裝
@echo on (將執行中的訊息印出來)
cd c:\program files\winscp (再把工作目錄轉到 winscp的安裝目錄)
winscp.com /command "option transfer automatic" "option echo on" "open sftp://username:password@11.22.33.44:22" "synchronize remote -mirror -delete -criteria=both d:/somedir /myhome/remotedir" "close " "exit"
其中一對quotation mark代表一個指令
前面兩個option設定transfer mode(option transfer automatic), 並印出執行間的訊息(option echo on)
再來用ssh的帳號(e.g. username)密碼(password,請用你自己的) 走sftp,port22登入 (open sftp://username:password@11.22.33.44:22)
最後 "synchronize remote -mirror -delete -criteria=both d:/somedir /myhome/remotedir"
做synchronize 採單向備分(參數remote),如果有檔案在遠端 (/myhome/remotedir)目錄下,卻不在local (d:\somedir) 裡,就將其刪除 (參數 -delete)
完成以後利用 "close" 關閉這一個session,再利用 "exit"離開 winscp
最後再排程執行即可
http://freegroupon.blogspot.com/2012/03/winscpsftp.html
找到了這一篇
還不錯用
winscp可以下載portable的版本 不用安裝
@echo on (將執行中的訊息印出來)
cd c:\program files\winscp (再把工作目錄轉到 winscp的安裝目錄)
winscp.com /command "option transfer automatic" "option echo on" "open sftp://username:password@11.22.33.44:22" "synchronize remote -mirror -delete -criteria=both d:/somedir /myhome/remotedir" "close " "exit"
其中一對quotation mark代表一個指令
前面兩個option設定transfer mode(option transfer automatic), 並印出執行間的訊息(option echo on)
再來用ssh的帳號(e.g. username)密碼(password,請用你自己的) 走sftp,port22登入 (open sftp://username:password@11.22.33.44:22)
最後 "synchronize remote -mirror -delete -criteria=both d:/somedir /myhome/remotedir"
做synchronize 採單向備分(參數remote),如果有檔案在遠端 (/myhome/remotedir)目錄下,卻不在local (d:\somedir) 裡,就將其刪除 (參數 -delete)
完成以後利用 "close" 關閉這一個session,再利用 "exit"離開 winscp
最後再排程執行即可
http://freegroupon.blogspot.com/2012/03/winscpsftp.html
2012/05/14
升到12.04後
mysql_db_query已不再支援
所以程式做了一點修正
$link=mysql_connect(localhost,test,test);//先連上資料庫
$sdb=mysql_select_db(cacti,$link);//再選擇使用那一個db(cacti)
$sqlins="select hostname,status,status_fail_date from host where status = 1;";
//$res=mysql_db_query(cacti,$sqlins,$link);//已不再支援
$res=mysql_query($sqlins,$link);//改用mysql_query
mysql_db_query已不再支援
所以程式做了一點修正
$link=mysql_connect(localhost,test,test);//先連上資料庫
$sdb=mysql_select_db(cacti,$link);//再選擇使用那一個db(cacti)
$sqlins="select hostname,status,status_fail_date from host where status = 1;";
//$res=mysql_db_query(cacti,$sqlins,$link);//已不再支援
$res=mysql_query($sqlins,$link);//改用mysql_query
訂閱:
文章 (Atom)