UnixBench是一款不錯的Linux下的VPS性能測試軟件,很多網站上對VPS都評測都採用這款軟件,幾乎是最基本的VPS測試。下面將說說如何使用UnixBench來測試你的VPS。
UnixBench 4.10 下載地址:http://soft.vpser.net/test/unixbench/unixbench-4.1.0-wht.tar.gz
下面是通過ssh安裝和使用UnixBench來做測試。
[root@sayhosts ~]# wget http://soft.vpser.net/test/unixbench/unixbench-4.1.0-wht.tar.gz
[root@sayhosts ~]# tar xzf unixbench-4.1.0-wht.tar.gz
[root@sayhosts ~]# ls
unixbench-4.1.0-wht-2 unixbench-4.1.0-wht.tar.gz
[root@sayhosts ~]# cd unixbench-4.1.0-wht-2/
[root@sayhosts unixbench-4.1.0-wht-2]# make
如果出現下面錯誤
make: gcc: Command not found
make: *** [pgms/arithoh] Error 127
出現下面錯誤可能是由於沒有安裝gcc,所以運行下面命令安裝下gcc就可以了。
[root@sayhosts unixbench-4.1.0-wht-2]# yum install make gcc
如果遇到 Error: Please install /usr/bin/time. 錯誤提示
centos/fedora 下運行
[root@sayhosts unixbench-4.1.0-wht-2]# yum install time
ubuntu/debian 下運行
[root@sayhosts unixbench-4.1.0-wht-2]# apt-get install time
最後運行
[root@sayhosts unixbench-4.1.0-wht-2]# ./Run
2012年1月8日 星期日
2012年1月5日 星期四
Ubuntu 11.04 x64 server install OpenQRM 4.9
1.wget http://sourceforge.net/projects/openqrm/files/openQRM-4.9/openqrm-4.9.tgz
2.tar zxvf openqrm-4.9.tgz
3.cd openqrm-4.8/src
5.sudo make ;sudo make install
6.sudo make start
web : http://localhost/openqrm
admin: openqrm
password:openqrm
2.tar zxvf openqrm-4.9.tgz
3.cd openqrm-4.8/src
4. nano etc/build.conf/dropbear.conf
OPENQRM_SOURCE_VERSION=”0.52″
5.sudo make ;sudo make install
6.sudo make start
web : http://localhost/openqrm
admin: openqrm
password:openqrm
2011年12月5日 星期一
台灣雲端發展應重視IAAS
雲端炒作與雲端發展契機
近年蘋果電腦在置型手機與平板電腦的成功,其中有一個非常重要的要素。就是AppStore後端平台的支持,一個好的服務背後需要有強大的基礎設備。擁有基礎架構,算是雲端發展的根基。台灣在發展電子業以往非常成功。靠著微軟與英戴爾的組合,複製以硬體提升模式為主流的發展模式,讓電子業發展在國際上成為典範。但自從2010起這種模式漸漸失效,再往後的發展裡,國內開始發展雲端運算如雨後春筍一般。政府也大力推動雲端產業發展,不過很多打著發展雲端口號的廠商,卻是以舊瓶新裝的方式如洪朝貴「(商業炒作之前的) 雲端簡史 -- SaaS 篇」所示,絕大部分的雲端服務都是舊有技術。而在中研院網格計算團隊主持人林誠謙在「雲端源自平行運算,但比網格更擅長資料運算」一文中,說明雲端計算源自於網格運算,兩種技術概念都源自平行運算技術和觀念發展出來。因此雲端服務顯然也未必需要雲端運算技術來支持達到服務的目的,而雲端運算技術的運用也未必要推出雲端服務。例如每天使用Google搜尋引擎利用MapReduce雲端運算的功能提升搜尋技術,成為搜尋引擎霸主。搜尋引擎在雲端未被炒作前是早已存在的服務,結論為雲端運算技術是一個在規模擴張中提升的手段。當規模一般的雲端服務,一般傳統模式運算即可達成。無謂的以雲端服務而導入雲端運算可說是畫蛇添足,效益難以顯著,更容易成為處處喊著雲端口號廠商口中的肥肉。
由此可知強大國際型SaaS服務,必須有IaaS作為基石。沒有好的地基,遑論建造高聳強固的大樓,若以PaaS作為國內發展的基石為目標,這種越多人使用創造平台價值越高的模式。在Google、微軟、甲骨文等大廠皆無法號召一定比例使用者下。國內PaaS幾乎無發展的機會,況且與PaaS平台也需要強大基礎架構才能運作。
擁有基礎架構,就是雲端的根基,IaaS可隨意部署應用程式,不限作業系統、不綁定平台與不限程式語言,彈性無限可能,國內在製造許多雲端基礎架構的產業都有非常好的技術,電源供應器、伺服器、網路設備製造等…供應鏈完整。發展IaaS是最適合國內發展雲端的模式,雲端炒作過度重視在「client、端」發展的使用,熟不知「Host、雲」才是重點。一般而言國內廠商將原本製造出的伺服器硬體模式賣給國際大廠,再經由大廠掛牌、大小型經銷商到最後的需求者。層層剝削的模式導致毛利率非常低落。但若不是經由代工模式,直接將伺服器送進轉為以IaaS雲端基礎架構服務模式。直接讓最終需求者依需求使用,這種製造後直接到最終使用者的模式最是完美。根本的IaaS是以軟體、作業系統強化整體系統的資源彈性與利用率,這種模式硬體需求會降低。然而軟體與資訊系統整合產業會提高。因此國內若依此舊模式,將日漸衰退下降。對於國內電子代工產業居多的情況,必定有若干影響。發展IaaS雲端基礎架構服務產業,將製造轉為服務,不但不必製造過多的硬體、在環境污染、節能、省碳、產業聚集,更創造提升國家產業模式。毛利率方面更是代工模式高出許多。帶動國內相關產業才能更加蓬勃發展,但若一眛再以wintel(微軟與英戴爾)模式發展,IaaS沒有自主的技術與經驗。最後結果難保重蹈覆轍讓利潤被分瓜稀釋。因此一個全開源自主並挾帶著眾多大廠支持的雲端IaaS架構,是一個非常有發展前景的未來產業。無關炒作實際而趨進現實產業面。畢竟未來雲端產業的發展,挾帶著強而有力的雲端基礎建設,才有能力左右雲端產業發展。
2011年8月11日 星期四
ubuntu 10.04 安裝 Libreoffice
Ubuntu中以指令安裝LibreOffice 有裝OpenOffice,先把OO.o移除掉:
or sudo apt-get install libreoffice-gnome
sudo apt-get purge openoffice*.*
加入Ubuntu的第三方軟體來源:sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update
sudo apt-get install libreoffice
or sudo apt-get install libreoffice-gnome
2011年7月9日 星期六
ubuntu 安裝 phpmyadmin 管理工具
安裝MySQL-Server
$
$
安裝PHP for Apache HTTP Server
$
安裝MySQL for Apache HTTP Server
$
$ sudo apt-get install phpmyadmin
http://127.0.0.1/phpmyadmin
$
sudo apt-get install mysql-server
安裝Apache HTTP Server$
sudo apt-get install apache2安裝PHP for Apache HTTP Server
$
sudo apt-get install php5安裝MySQL for Apache HTTP Server
$
sudo apt-get install libapache2-mod-auth-mysql
$ sudo apt-get install php5-mysql
安裝phpMyAdmin$ sudo apt-get install phpmyadmin
http://127.0.0.1/phpmyadmin
2011年7月6日 星期三
單台 Novacc all in one and other compute node
第一台 網路卡設定
auto lo
iface lo inet loopback
auto br100
iface br100 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 0.0.0.0
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 0.0.0.0
netmask 255.255.255.0
auto eth1:1
iface eth1:1 inet static
address 172.18.11.191
netmask 255.255.255.0
broadcast 172.18.11.255
gateway 172.18.11.254
dns-nameservers 10.0.0.90
第二台
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 0.0.0.0
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 172.18.11.192
netmask 255.255.255.0
broadcast 172.18.11.255
gateway 172.18.11.254
/etc/nova/nova.conf
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--lock_path=/var/lock/nova
--state_path=/var/lib/nova
--verbose
--s3_host=172.18.11.191
--rabbit_host=172.18.11.191
--cc_host=172.18.11.191
--ec2_url=http://172.18.11.191:8773/services/Cloud
--fixed_range=192.168.3.0/24
--network_size=256
--FAKE_subdomain=ec2
--routing_source_ip=172.18.11.191
--sql_connection=mysql://root:nova@172.18.11.191/nova
--glance_api_servers=172.18.11.191:9292
--image_service=nova.image.glance.GlanceImageService
--flat_network_dhcp_start=192.168.3.5
--public_interface=eth1
--flat_interface=eth0
--flat_injected=False
auto lo
iface lo inet loopback
auto br100
iface br100 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 0.0.0.0
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 0.0.0.0
netmask 255.255.255.0
auto eth1:1
iface eth1:1 inet static
address 172.18.11.191
netmask 255.255.255.0
broadcast 172.18.11.255
gateway 172.18.11.254
dns-nameservers 10.0.0.90
第二台
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 0.0.0.0
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 172.18.11.192
netmask 255.255.255.0
broadcast 172.18.11.255
gateway 172.18.11.254
/etc/nova/nova.conf
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--lock_path=/var/lock/nova
--state_path=/var/lib/nova
--verbose
--s3_host=172.18.11.191
--rabbit_host=172.18.11.191
--cc_host=172.18.11.191
--ec2_url=http://172.18.11.191:8773/services/Cloud
--fixed_range=192.168.3.0/24
--network_size=256
--FAKE_subdomain=ec2
--routing_source_ip=172.18.11.191
--sql_connection=mysql://root:nova@172.18.11.191/nova
--glance_api_servers=172.18.11.191:9292
--image_service=nova.image.glance.GlanceImageService
--flat_network_dhcp_start=192.168.3.5
--public_interface=eth1
--flat_interface=eth0
--flat_injected=False
2011年6月22日 星期三
2011年5月25日 星期三
NovaInstall for Single Machine Installation Record
Step 1: Install required prerequisites
sudo apt-get install -y rabbitmq-server
##Starting rabbitmq-server: SUCCESS
Step 2: Install Nova packages
sudo apt-get install -y python-software-properties
##Setting up python-software-properties (0.80.9) ...sudo add-apt-repository ppa:nova-core/trunk
###
gpg: requesting key 2A2356C9 from hkp server keyserver.ubuntu.comgpg: key 2A2356C9: public key "Launchpad Nova Packages" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
sudo apt-get update
###Reading package lists... Done
sudo apt-get install -y python-nova
###Processing triggers for python-support ...
###Processing triggers for python-support ...
sudo apt-get install -y nova-common nova-doc nova-api nova-network
####
nova-network is already the newest version.
nova-doc is already the newest version.
nova-common is already the newest version.
nova-api is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded
nova-doc is already the newest version.
nova-common is already the newest version.
nova-api is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded
sudo apt-get install -y nova-objectstore nova-scheduler nova-compute
###
nova-scheduler is already the newest version.nova-objectstore is already the newest version.
nova-compute is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
sudo apt-get install -y euca2ools
###euca2ools is already the newest version.sudo apt-get install -y unzip
###unzip is already the newest version.
###unzip is already the newest version.
Step 3:setting up the SQL Database (MySQL) on the Cloud Controller
bash MYSQL_PASS=nova NOVA_PASS=notnova bash MYSQL_PASS=nova NOVA_PASS=notnova cat >> MYSQL_PRESEED | debconf-set-selections mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS mysql-server-5.1 mysql-server/start_on_boot boolean true MYSQL_PRESEED mysql_preseed $mysql_pass="" boolean="" debconf-set-selections="" mysql-server-5.1="" mysql-server="" mysql_preseed<="" password="" pre="" root_password="" root_password_again="" start_on_boot="" true="" |="">
/usr/bin/nova-manage db sync
/usr/bin/nova-manage user admin dub###export EC2_ACCESS_KEY=afe710a5-bbc8-45ad-ba69-38db885d3542 ###export EC2_SECRET_KEY=54eeb1b8-2b00-4bb8-9092-5e32022be640 /usr/bin/nova-manage project create dubproject dub
/usr/bin/nova-manage network create 192.168.0.0/24 1 256
sudo apt-get install -y mysql-server
---設mysql root 密碼
---設mysql root 密碼
sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
sudo service mysql restart
sudo mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
###
mysql start/running, process 1819sudo mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'nova'@'%' WITH GRANT OPTION;"
sudo mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'nova'@'%' = PASSWORD('$NOVA_PASS');"
Step 4:Installing the Compute Node
nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto br100
iface br100 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 192.168.104.11
netmask 255.255.255.0
network 192.168.104.0
gateway 192.168.104.254
broadcast 192.168.104.255
dns-nameservers 8.8.4.4
sudo /etc/init.d/networking restart
restart libvirt-bin; restart nova-network; restart nova-compute;
libvirt-bin start/running, process 1994
nova-network start/running, process 2012
nova-compute start/running, process 2025
libvirt-bin start/running, process 1994
nova-network start/running, process 2012
nova-compute start/running, process 2025
restart nova-api; restart nova-objectstore; restart nova-scheduler
nova-api start/running, process 2113
nova-objectstore start/running, process 2121
nova-scheduler start/running, process 2135
nova-api start/running, process 2113
nova-objectstore start/running, process 2121
nova-scheduler start/running, process 2135
Step6 Creating Certifications
mkdir –p /root/creds
/usr/bin/python /usr/bin/nova-manage project zipfile $NOVA_PROJECT $NOVA_PROJECT_USER /root/creds/novacreds.zip
unzip /root/creds/novacreds.zip -d /root/creds/
Archive: /root/creds/novacreds.zip
extracting: /root/creds/novarc
extracting: /root/creds/pk.pem
extracting: /root/creds/cert.pem
extracting: /root/creds/cacert.pem
Archive: /root/creds/novacreds.zip
extracting: /root/creds/novarc
extracting: /root/creds/pk.pem
extracting: /root/creds/cert.pem
extracting: /root/creds/cacert.pem
cat /root/creds/novarc >> ~/.bashrc
source ~/.bashrc
source /root/creds/novarc
source /root/creds/novarc
sudo reboot
Enabling Access to VMs on the Compute Node
euca-authorize -P icmp -t -1:-1 default----錯誤[Errno 111] Connection refused
-rw-r----- 1 root nova 461 2011-05-25 22:03 nova.conf (nova.conf 為root所有) ---改
-rw-r----- 1 nova nova 461 2011-05-25 22:03 nova.conf (nova.conf 為nova所有)
正確
euca-authorize -P icmp -t -1:-1 default
default None None icmp -1 -1 0.0.0.0/0
GROUP default
PERMISSION default ALLOWS icmp -1 -1 FROM CIDR 0.0.0.0/0
euca-authorize -P tcp -p 22 default
default None None tcp 22 22 0.0.0.0/0
GROUP default
PERMISSION default ALLOWS tcp 22 22 FROM CIDR 0.0.0.0/0
Configuring Multiple Compute Nodes
restart libvirt-bin; service nova-compute restart
libvirt-bin start/running, process 1703
nova-compute start/running, process 1725
libvirt-bin start/running, process 1703
nova-compute start/running, process 1725
chgrp kvm /dev/kvm
chmod g+rwx /dev/kvm
iptables -t nat -A PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.104.13:8773
mysql -uroot -pnova nova -e 'select * from services;'
2011年5月5日 星期四
Static IP & KVM
1.編輯
vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 172.18.11.191
netmask 255.255.255.0
gateway 172.18.11.254
egrep -c '(vmx|svm)' /proc/cpuinfo 檢查cpu是否支援虛擬化
如果算出來的數字大於 0 的話,就表示有支援了,不過還是記得要去 BIOS 裡確認是否有 Enable CPU Virtualization 的功能喔
2. 正式安裝相關套件
首先不多說,就是安裝 KVM 下去
因此來安裝一個比較視覺化的管理軟體,方便未來管理
3. 網路設定
接下來要來搞定網路這一塊,首先我們要弄出一張虛擬網卡讓它可以橋接原本的 eth0 出去,到時裡面的 VM 網路才會通
首先網路卡給停掉 ( 這裡的 vim 是我另外裝的,預設是沒有的 )
# invoke-rc.d networking stop
# vim /etc/network/interfaces
如果你的網路環境是手動設定 IP 的話,請參考這個設定
auto lo
iface lo inet loopback
auth eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.0.105
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
如果你的網路環境是 DHCP 的話,請參考這個設定
auto lo
iface lo inet loopback
auth eth0
iface eth0 inet manual
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 172.18.11.191
netmask 255.255.255.0
gateway 172.18.11.254
egrep -c '(vmx|svm)' /proc/cpuinfo 檢查cpu是否支援虛擬化
如果算出來的數字大於 0 的話,就表示有支援了,不過還是記得要去 BIOS 裡確認是否有 Enable CPU Virtualization 的功能喔
2. 正式安裝相關套件
首先不多說,就是安裝 KVM 下去
# apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder
好了之後可以檢查 KVM 是否有啟動了,還有它所載入的 Module 為何# lsmod | grep kvm
kvm_intel 56851 0
kvm 367707 1 kvm_intel
檢查 KVM 有載入哪些 Modulekvm 367707 1 kvm_intel
# modprobe -l | grep kvm
kernel/arch/x86/kvm/kvm.ko
kernel/arch/x86/kvm/kvm-intel.ko
kernel/arch/x86/kvm/kvm-amd.ko
檢查我們的硬體規格kernel/arch/x86/kvm/kvm.ko
kernel/arch/x86/kvm/kvm-intel.ko
kernel/arch/x86/kvm/kvm-amd.ko
# virsh nodeinfo
處理器類型: x86_64
處理器數目: 2
處理器的頻率: 800 MHz
處理器的插槽: 1
每個插槽的核心: 2
每個核心的執行續: 1
NUMA cell: 1
記憶體大小: 4058760 kB
因為我裝的版本是 ubuntu desktop 64 位元版,所以用圖形化的介面來操作處理器類型: x86_64
處理器數目: 2
處理器的頻率: 800 MHz
處理器的插槽: 1
每個插槽的核心: 2
每個核心的執行續: 1
NUMA cell: 1
記憶體大小: 4058760 kB
因此來安裝一個比較視覺化的管理軟體,方便未來管理
# apt-get install virt-manager
裝好之後應該會在「應用程式」->「系統工具」看到一個「虛擬機器管理員」3. 網路設定
接下來要來搞定網路這一塊,首先我們要弄出一張虛擬網卡讓它可以橋接原本的 eth0 出去,到時裡面的 VM 網路才會通
首先網路卡給停掉 ( 這裡的 vim 是我另外裝的,預設是沒有的 )
# invoke-rc.d networking stop
# vim /etc/network/interfaces
如果你的網路環境是手動設定 IP 的話,請參考這個設定
auto lo
iface lo inet loopback
auth eth0
iface eth0 inet manual
auto br0
iface br0 inet static
address 192.168.0.105
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
如果你的網路環境是 DHCP 的話,請參考這個設定
auto lo
iface lo inet loopback
auth eth0
iface eth0 inet manual
auto br0
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
2011年4月29日 星期五
Manual Installing Nova Cloud Controller Ver for Cactus
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:nova-core/trunk
sudo apt-get update
sudo add-apt-repository ppa:nova-core/trunk
sudo apt-get update
sudo apt-get install -y rabbitmq-server
sudo apt-get install -y python-greenlet python-mysqldb
sudo apt-get install -y nova-common nova-doc python-nova nova-apisudo apt-get install -y nova-network nova-objectstore nova-scheduler nova-compute
sudo apt-get install -y euca2ools unzip
vi /etc/nova/nova.conf
bash
MYSQL_PASS=nova
NOVA_PASS=notnova
cat << MYSQL_PRESEED | debconf-set-sselections
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
mysql-server-5.1 mysql-server/start_on_boot boolean true
MYSQL_PRESEED
sudo apt-get install -y mysql-server
sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
sudo service mysql restart
mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;"
mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'root'@'%' =PASSWORD('$MYSQL_PASS');"
sudo addgroup nova
chown -R root:nova /etc/nova
chmod 640 /etc/nova/nova.conf
/usr/bin/nova-manage db sync
/usr/bin/nova-manage user admin dub
/usr/bin/nova-manage project create dubproject dub
/usr/bin/nova-manage network create 192.168.104.0/24 1 255 /usr/bin/nova-manage project create dubproject dub
mkdir –p /root/creds
/usr/bin/python /usr/bin/nova-manage project zipfile dubproject dub /root/creds/novacreds.zip
unzip /root/creds/novacreds.zip -d /root/creds/
unzip /root/creds/novacreds.zip -d /root/creds/
cat /root/creds/novarc >> ~/.bashrc
source ~/.bashrc
euca-authorize -P icmp -t -1:-1 defaulteuca-authorize -P tcp -p 22 default
killall dnsmasq service
nova-network restart
nova-network restart
/etc/init.d/networking restart
restart libvirt-bin; restart nova-network; restart nova-compute;
restart nova-api; restart nova-objectstore; restart nova-scheduler
chmod g+rwx /dev/kvm
tcp --dport 80 -j DNAT --to-destination $NOVA_API_IP:8773
services;'
2.Configuring Multiple Compute Nodes
ubuntu 更換網卡 鎖住原ip eth0 不見
1. cat /proc/net/dev "抓到的網路卡是eth1"
eht1: 70634 820 0 0 0 0 0 0 4401 36 0 0 0 0 0 2.sudo 2.rm -f /etc/udev/rules.d/70-persistent-net.rules
3.sudo reboot
eht1: 70634 820 0 0 0 0 0 0 4401 36 0 0 0 0 0 2.sudo 2.rm -f /etc/udev/rules.d/70-persistent-net.rules
3.sudo reboot
2011年4月27日 星期三
Script Nova 安裝
cloud controller--------------------------------------------------------------------------------------------------------------------------
1.前置動作
A.查看cpu有無支援權虛擬化
egrep -c '(vmx|svm)' /proc/cpuinfo 檢查cpu是否支援虛擬化
如果算出來的數字大於 0 的話,就表示有支援了,不過還是記得要去 BIOS 裡確認是否有 Enable CPU Virtualization
如果算出來的數字大於 0 的話,就表示有支援了,不過還是記得要去 BIOS 裡確認是否有 Enable CPU Virtualization
鳥哥 http://linux.vbird.org/linux_enterprise/xen.php--說明
B.如果設定網路IP等...確認./etc/init.d/networking restart 執行會不會fall"
C.sudo apt-get update
設定 固定ip
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.104.30
netmask 255.255.255.0
broadcast 192.168.104.255
gateway 192.168.104.1
dns-nameservers 61.64.172.2
2. 下載 Script
wget --no-check-certificate https://github.com/elasticdog/
OpenStack-NOVA-Installer-Script/raw/master/nova-install
3.變更權限 sudo chmod 755 nova-install
4. 執行
sudo bash nova-install -t cloud
提問
################################################################
Nova Services Configuration
################################################################
This section includes setting the host IP addresses for the Nova Cloud
Controller, S3, RabbitMQ, and MySQL services...these are typically hosted on
the same machine.
Cloud Controller host IP address [192.168.104.15]:"enter"
S3 host IP address [192.168.104.15]:"enter"
RabbitMQ host IP address [192.168.104.15]:"enter"
MySQL host IP address [192.168.104.15]:"enter"
Database credentials
####################
Desired MySQL root password:"輸入mysql密碼"
################################################################
Nova Services Configuration
################################################################
This section includes setting the host IP addresses for the Nova Cloud
Controller, S3, RabbitMQ, and MySQL services...these are typically hosted on
the same machine.
Cloud Controller host IP address [192.168.104.15]:"enter"
S3 host IP address [192.168.104.15]:"enter"
RabbitMQ host IP address [192.168.104.15]:"enter"
MySQL host IP address [192.168.104.15]:"enter"
Database credentials
####################
Desired MySQL root password:"輸入mysql密碼"
Verify MySQL root password:"輸入mysql密碼"
:###############################################################
################################################################Local Network Settings
################################################################
In order to set up the network bridge, we'll need some information on your
local network interface configuration. The settings will default to the first
known device as listed by 'ifconfig'.
Enter this machine's IP address [192.168.104.15]: 192.168.104.15
Enter this machine's broadcast address [192.168.104.255]:
Enter this machine's netmask [255.255.255.0]:
Enter this machine's gateway [192.168.104.1]: 192.168.104.254
Enter this machine's DNS nameserver address [61.64.172.2]
Local Network Settings
################################################################
In order to set up the network bridge, we'll need some information on your
local network interface configuration. The settings will default to the first
known device as listed by 'ifconfig'.
Enter this machine's IP address [192.168.104.15]: "enter"
Enter this machine's broadcast address [192.168.104.255]:"enter"
Enter this machine's netmask [255.255.255.0]:"enter"
Enter this machine's gateway [192.168.104.1]: 192.168.104.254
Enter this machine's DNS nameserver address [61.64.172.2]:"enter"
################################################################
Project Network Configuration
################################################################
Here you will set the network range that ALL of your projects will reside in,
and the number of IP addresses in that block that should be available for use.
After that, you'll create a project administrator and a new project.
Network range for ALL projects (normally x.x.x.x/12): 10.0.0.0/12
Total amount of usable IPs for ALL projects: 8
New project creation
####################
User name for the project administrator: dub
Name for the project: dubproject
Desired network range for the 'dubproject' project (normally x.x.x.x/24): 192.168.0.0/24
How many networks for the 'dubproject' project: 1
How many available IPs per 'dubproject' project network: 255
########
########
One last thing...there is currently no way to background/preeseed the
RabbitMQ package's installation splash screen, so we'll need you to
manually go through it.
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-os-mon erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools
libsctp1 lksctp-tools
Suggested packages:
erlang-tools erlang erlang-manpages erlang-doc-html
The following NEW packages will be installed:
erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-os-mon erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools
libsctp1 lksctp-tools rabbitmq-server
0 upgraded, 13 newly installed, 0 to remove and 30 not upgraded.
Need to get 4,337 kB/7,198 kB of archives.
After this operation, 14.2 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main erlang-base amd64 1:13.b.3-dfsg-2ubuntu3 [4,337 kB]
Fetched 4,337 kB in 18s (235 kB/s)
Selecting previously deselected package erlang-base.
(Reading database ... 47590 files and directories currently installed.)
Unpacking erlang-base (from .../erlang-base_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-crypto.
Unpacking erlang-crypto (from .../erlang-crypto_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-mnesia.
Unpacking erlang-mnesia (from .../erlang-mnesia_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-runtime-tools.
Unpacking erlang-runtime-tools (from .../erlang-runtime-tools_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-public-key.
Unpacking erlang-public-key (from .../erlang-public-key_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-ssl.
Unpacking erlang-ssl (from .../erlang-ssl_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-inets.
Unpacking erlang-inets (from .../erlang-inets_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-snmp.
Unpacking erlang-snmp (from .../erlang-snmp_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-os-mon.
Unpacking erlang-os-mon (from .../erlang-os-mon_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-syntax-tools.
Unpacking erlang-syntax-tools (from .../erlang-syntax-tools_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package libsctp1.
Unpacking libsctp1 (from .../libsctp1_1.0.11+dfsg-1_amd64.deb) ...
Selecting previously deselected package lksctp-tools.
Unpacking lksctp-tools (from .../lksctp-tools_1.0.11+dfsg-1_amd64.deb) ...
Selecting previously deselected package rabbitmq-server.
Unpacking rabbitmq-server (from .../rabbitmq-server_2.3.1-1ubuntu1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up erlang-base (1:13.b.3-dfsg-2ubuntu3) ...
Searching for services which depend on erlang and should be started...none found.
Setting up erlang-crypto (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-mnesia (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-runtime-tools (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-public-key (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-ssl (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-inets (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-snmp (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-os-mon (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-syntax-tools (1:13.b.3-dfsg-2ubuntu3) ...
Setting up libsctp1 (1.0.11+dfsg-1) ...
Setting up lksctp-tools (1.0.11+dfsg-1) ...
Setting up rabbitmq-server (2.3.1-1ubuntu1) ...
Adding group `rabbitmq' (GID 112) ...
Done.
Adding system user `rabbitmq' (UID 104) ...
Adding new user `rabbitmq' (UID 104) with group `rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'.
Starting rabbitmq-server: SUCCESS
rabbitmq-server.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
################################################################
ENTERING AUTO-PILOT MODE
################################################################
At this point, you've entered all the information needed to finish the
installation of this Nova component. Feel free to get some coffee, you have
earned it!
Installing packages
###################
Installing package 'python-software-properties' ... done
Adding 'ppa:nova-core/release' repository ... done
Installing package 'euca2ools' ... done
Installing package 'mysql-server' ... done
Installing package 'nova-api' ... done
Installing package 'nova-compute' ... done
Installing package 'nova-network' ... done
Installing package 'nova-objectstore' ... done
Installing package 'nova-scheduler' ... done
Installing package 'unzip' ... done
Setting up the Nova configuration file
######################################
Generating nova.conf ... done
Setting proper permissions for nova.conf ... done
Finalizing MySQL setup
######################
Adjusting MySQL network configuration ... done
Creating database ... done
Initializing database ... done
Generate Nova user credentials
##############################
Generating and extracting novacreds.zip ... done
Appending novarc environment settings to your ~/.bashrc ... done
Updating network interfaces
###########################
Adding bridge device ... done
Restarting networking service ... done
Bringing your Nova node online
##############################
Restarting Nova services ... done
Ensure all five Nova services are running:
UID PID PPID C STIME TTY STAT TIME CMD
nova 6671 6667 19 15:55 ? S 0:00 nova-api
nova 6660 6657 37 15:55 ? S 0:01 nova-compute
nova 6647 6645 18 15:55 ? S 0:00 nova-network
root 6683 6675 5 15:55 ? S 0:00 nova-objectstor
nova 6692 6690 16 15:55 ? S 0:00 nova-scheduler
Allowing ICMP and SSH access to all VMs ... done
########################################################################
# You /MUST/ re-source your 'novarc' to use the API commands since the #
# script cannot pass the source information out of its own process... #
# the variables have been appended to your ~/.bashrc file for sourcing #
########################################################################
For reference, the generated credentials can be found in /root/creds/
The next thing you are going to want to do it get a VM to test with.
You can find a test VM how-to and read about custom image creation here:
http://nova.openstack.org/adminguide/multi.node.install.html
http://wiki.openstack.org/GettingImages
Enjoy your new private cloud!
################################################################
In order to set up the network bridge, we'll need some information on your
local network interface configuration. The settings will default to the first
known device as listed by 'ifconfig'.
Enter this machine's IP address [192.168.104.15]: "enter"
Enter this machine's broadcast address [192.168.104.255]:"enter"
Enter this machine's netmask [255.255.255.0]:"enter"
Enter this machine's gateway [192.168.104.1]: 192.168.104.254
Enter this machine's DNS nameserver address [61.64.172.2]:"enter"
################################################################
Project Network Configuration
################################################################
Here you will set the network range that ALL of your projects will reside in,
and the number of IP addresses in that block that should be available for use.
After that, you'll create a project administrator and a new project.
Network range for ALL projects (normally x.x.x.x/12): 10.0.0.0/12
Total amount of usable IPs for ALL projects: 8
New project creation
####################
User name for the project administrator: dub
Name for the project: dubproject
Desired network range for the 'dubproject' project (normally x.x.x.x/24): 192.168.0.0/24
How many networks for the 'dubproject' project: 1
How many available IPs per 'dubproject' project network: 255
########
########
One last thing...there is currently no way to background/preeseed the
RabbitMQ package's installation splash screen, so we'll need you to
manually go through it.
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-os-mon erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools
libsctp1 lksctp-tools
Suggested packages:
erlang-tools erlang erlang-manpages erlang-doc-html
The following NEW packages will be installed:
erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-os-mon erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools
libsctp1 lksctp-tools rabbitmq-server
0 upgraded, 13 newly installed, 0 to remove and 30 not upgraded.
Need to get 4,337 kB/7,198 kB of archives.
After this operation, 14.2 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main erlang-base amd64 1:13.b.3-dfsg-2ubuntu3 [4,337 kB]
Fetched 4,337 kB in 18s (235 kB/s)
Selecting previously deselected package erlang-base.
(Reading database ... 47590 files and directories currently installed.)
Unpacking erlang-base (from .../erlang-base_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-crypto.
Unpacking erlang-crypto (from .../erlang-crypto_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-mnesia.
Unpacking erlang-mnesia (from .../erlang-mnesia_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-runtime-tools.
Unpacking erlang-runtime-tools (from .../erlang-runtime-tools_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-public-key.
Unpacking erlang-public-key (from .../erlang-public-key_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-ssl.
Unpacking erlang-ssl (from .../erlang-ssl_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-inets.
Unpacking erlang-inets (from .../erlang-inets_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-snmp.
Unpacking erlang-snmp (from .../erlang-snmp_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-os-mon.
Unpacking erlang-os-mon (from .../erlang-os-mon_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-syntax-tools.
Unpacking erlang-syntax-tools (from .../erlang-syntax-tools_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package libsctp1.
Unpacking libsctp1 (from .../libsctp1_1.0.11+dfsg-1_amd64.deb) ...
Selecting previously deselected package lksctp-tools.
Unpacking lksctp-tools (from .../lksctp-tools_1.0.11+dfsg-1_amd64.deb) ...
Selecting previously deselected package rabbitmq-server.
Unpacking rabbitmq-server (from .../rabbitmq-server_2.3.1-1ubuntu1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up erlang-base (1:13.b.3-dfsg-2ubuntu3) ...
Searching for services which depend on erlang and should be started...none found.
Setting up erlang-crypto (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-mnesia (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-runtime-tools (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-public-key (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-ssl (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-inets (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-snmp (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-os-mon (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-syntax-tools (1:13.b.3-dfsg-2ubuntu3) ...
Setting up libsctp1 (1.0.11+dfsg-1) ...
Setting up lksctp-tools (1.0.11+dfsg-1) ...
Setting up rabbitmq-server (2.3.1-1ubuntu1) ...
Adding group `rabbitmq' (GID 112) ...
Done.
Adding system user `rabbitmq' (UID 104) ...
Adding new user `rabbitmq' (UID 104) with group `rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'.
Starting rabbitmq-server: SUCCESS
rabbitmq-server.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
################################################################
ENTERING AUTO-PILOT MODE
################################################################
At this point, you've entered all the information needed to finish the
installation of this Nova component. Feel free to get some coffee, you have
earned it!
Installing packages
###################
Installing package 'python-software-properties' ... done
Adding 'ppa:nova-core/release' repository ... done
Installing package 'euca2ools' ... done
Installing package 'mysql-server' ... done
Installing package 'nova-api' ... done
Installing package 'nova-compute' ... done
Installing package 'nova-network' ... done
Installing package 'nova-objectstore' ... done
Installing package 'nova-scheduler' ... done
Installing package 'unzip' ... done
Setting up the Nova configuration file
######################################
Generating nova.conf ... done
Setting proper permissions for nova.conf ... done
Finalizing MySQL setup
######################
Adjusting MySQL network configuration ... done
Creating database ... done
Initializing database ... done
Generate Nova user credentials
##############################
Generating and extracting novacreds.zip ... done
Appending novarc environment settings to your ~/.bashrc ... done
Updating network interfaces
###########################
Adding bridge device ... done
Restarting networking service ... done
Bringing your Nova node online
##############################
Restarting Nova services ... done
Ensure all five Nova services are running:
UID PID PPID C STIME TTY STAT TIME CMD
nova 6671 6667 19 15:55 ? S 0:00 nova-api
nova 6660 6657 37 15:55 ? S 0:01 nova-compute
nova 6647 6645 18 15:55 ? S 0:00 nova-network
root 6683 6675 5 15:55 ? S 0:00 nova-objectstor
nova 6692 6690 16 15:55 ? S 0:00 nova-scheduler
Allowing ICMP and SSH access to all VMs ... done
########################################################################
# You /MUST/ re-source your 'novarc' to use the API commands since the #
# script cannot pass the source information out of its own process... #
# the variables have been appended to your ~/.bashrc file for sourcing #
########################################################################
For reference, the generated credentials can be found in /root/creds/
The next thing you are going to want to do it get a VM to test with.
You can find a test VM how-to and read about custom image creation here:
http://nova.openstack.org/adminguide/multi.node.install.html
http://wiki.openstack.org/GettingImages
Enjoy your new private cloud!
reboot
source /root/creds/novarc
5.檢查
執行 euca-describe-instances 測試api server 是否運作正常
情況
A.正常 不會出現 訊息
B.EC2_ACCESS_KEY environment variable must be set. #EC2_ACCESS_KEY沒設好
重設
/usr/bin/python /usr/bin/nova-manage project zipfile nova nova /root/creds/novacreds.zip
unzip /root/creds/novacreds.zip -d /root/creds/
cat /root/creds/novarc >> ~/.bashrc
source ~/.bashrc
source /root/creds/novarc
euca-describe-instances 測試確定
--------------------------------------------------------------------------------------------------------------------------
cloud node---------------------------------------------------------------------------------------------------------
wget --no-check-certificate https://github.com/elasticdog
/OpenStack-NOVA-Installer-Script/raw/master/nova-install
1.變更權限 sudo chmod 755 nova-install
nova-install -t compute .....省略
2.What is the IP address of your NOVA CONTROLLER? 輸入相關資訊
-------------------------------------------------------------------------------------------------------------------------------
controller--------------------------------------------------------------------------------------------------------------------------
1.mysql -uroot -pnova nova -e 'select * from services;'
可以看到node 加入
+---------------------+---------------------+------------+---------+----+---------+----------------+---------- -+--------------+----------+-------------------+
| created_at | updated_at | deleted_at | deleted | id | host | binary | topic | report_count | disabled | availability_zone |
+---------------------+---------------------+------------+---------+----+---------+----------------+---------- -+--------------+----------+-------------------+
| 2011-05-05 13:37:50 | 2011-05-05 15:49:56 | NULL | 0 | 1 | nova-cc | nova-network | network | 786 | 0 | nova |
| 2011-05-05 13:37:55 | 2011-05-05 15:49:59 | NULL | 0 | 2 | nova-cc | nova-compute | compute | 787 | 0 | nova |
| 2011-05-05 13:38:00 | 2011-05-05 15:50:01 | NULL | 0 | 3 | nova-cc | nova-scheduler | scheduler | 785 | 0 | nova |
| 2011-05-05 15:47:50 | 2011-05-05 15:50:00 | NULL | 0 | 4 | 64node1 | nova-compute | compute | 13 | 0 | nova |
+---------------------+---------------------+------------+---------+----+---------+----------------+----------
2.image="ubuntu1010-UEC-localuser-image.tar.gz"3.wget http://c0179148.cdn1.cloudfiles.rackspacecloud.com/ubuntu1010-UEC-localuser-image.tar.gz4.uec-publish-tarball ubuntu1010-UEC-localuser-image.tar.gz dub-bucket x86_64
euca-describe-images
euca-add-keypair test > test.pem
chmod 600 test.pem
euca-run-instances -k test -t m1.tiny "ami-key" 5.test images
查 image ipaddress
euca-describe-instances ssh ubuntu@$ipaddress
sudo -i
2011年4月26日 星期二
Open Stack Nova Compute node configuration steps
1.wget --no-check-certificate https://github.com/dubsquared/OpenStack-NOVA-Installer-Script/raw/master/nova-NODE-installer.sh
2. sudo chmod 755 nova-NODE-installer.sh
3.sudo ./nova-NODE-installer.sh
What is the IP address of your NOVA CONTROLLER?
......
並將 控制台端 etc/nova/nova.conf copy 到Node 的同一個位置
4.到控制器主機 打 mysql -u帳號 -p密碼 nova -e 'select * from services;' 查看
2. sudo chmod 755 nova-NODE-installer.sh
3.sudo ./nova-NODE-installer.sh
What is the IP address of your NOVA CONTROLLER?
......
並將 控制台端 etc/nova/nova.conf copy 到Node 的同一個位置
4.到控制器主機 打 mysql -u帳號 -p密碼 nova -e 'select * from services;' 查看
2011年4月6日 星期三
ubuntu NFS 安裝 與 autofs 自動掛載
1. 192.168.104.253 Server端 Install
$ sudo apt-get install nfs-common
$ sudo apt-get install nfs-kernel-server
2. 設定 /etc/exports (For example: 將/shareData 給192.168.104.5 rw使用)
$ sudo vi /etc/exports
/shareData 10.2.3.78(rw)
3. 啟動 nfs server
$ sudo /etc/init.d/nfs-kernel-server start
4. 檢查 $ showmount -e localhost
1.client端要先安裝autofs
以ubuntu為例
sudo apt-get install autofs
2.client端 vi /etc/auto.master
例希望/NFSData第下的資料夾來作autofs
所以加上這行
/NFSData /etc/auto.nfs
3.client端修改/etc/auto.nfs 檔案要先create
我要去mount 192.168.10.9上面的/NFSData第在本機的/mnt/nfs上面
#sudo nano etc/auto.nfs
加上這行
253-share -rw,bg,soft,rsize=32768,wsize=32768 192.168.104.253:/shareData
$ sudo apt-get install nfs-common
$ sudo apt-get install nfs-kernel-server
2. 設定 /etc/exports (For example: 將/shareData 給192.168.104.5 rw使用)
$ sudo vi /etc/exports
/shareData 10.2.3.78(rw)
3. 啟動 nfs server
$ sudo /etc/init.d/nfs-kernel-server start
4. 檢查 $ showmount -e localhost
1.client端要先安裝autofs
以ubuntu為例
sudo apt-get install autofs
2.client端 vi /etc/auto.master
例希望/NFSData第下的資料夾來作autofs
所以加上這行
/NFSData /etc/auto.nfs
3.client端修改/etc/auto.nfs 檔案要先create
我要去mount 192.168.10.9上面的/NFSData第在本機的/mnt/nfs上面
#sudo nano etc/auto.nfs
加上這行
253-share -rw,bg,soft,rsize=32768,wsize=32768 192.168.104.253:/shareData
4./etc/init.d/autofs restart
ubuntu10 ssh keygen – 登入不用密碼 終於不用輸入了
1.ssh-keygen -t rsa ###前面記得不要加sudo不然會做出 root 這使用者的金鑰
2.詢問你要將金鑰放在哪邊基本上按下 Enter
3. Enter passphrase 這是要保護金鑰的密碼直接按下 Enter不然到最後還是要密碼
4.公鑰跟私鑰都有了之後 把公鑰丟到client
scp ~/.ssh/*.pub client IP:~/.ssh/ 這時候scp指令要密碼
5.到client端輸入 cat .ssh/id_rsa.pub >> .ssh/authorized_keys
6. ssh server 已經可以不用輸入密碼就登入主機 YA
2011年4月4日 星期一
Open Stack Nova Single Machine Installation
System :Ubuntu 10.04 64Bit Desktop IP:192.168.104.3
你會看到消息開始用“Reading package lists... Done”,你必須鍵入 y確認要繼續。
------------------------------
--daemonize=1
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--loggdir=/var/log/nova
--state_path=/var/lib/nova
--verbose
--sql_connection=mysql://root:nova@192.168.104.3/nova ###SQL數據庫的位置
--s3_host=192.168.104.3 ###這是Nova承載 objectstore服務,其中將包含VM images and buckets
--rabbit_host=192.168.104.3 ###這是rabbit 的AMQP messaging service
--ec2_host=192.168.104.3 ###這是nova-api service lives
--verbose ###Optional but very helpful during initial setup
--ec2_url=http://192.168.104.3:8773/services/Cloud ###nova-api 主機URL位址
--network_manager=nova.network.manager.VlanManager ### 控制型態分類如下
This is how your controller will communicate with additional Nova nodes and VMs: nova.network.manager.FlatManager # Simple, no-vlan networking type nova.network.manager. FlatDHCPManager # Flat networking with DHCP nova.network.manager.VlanManager # Vlan networking with DHCP –/DEFAULT/ if no network manager is defined in nova.conf
--fixed_range=192.168.104.0/24 ###這將是IPrange項目,未來將駐留在虛擬機的guest IP範圍。
--network_size=128 ### IP Addres 總數量使用虛擬機guests
-------------------------------
注意請依照自己環境設定
創造一個 “nova” group, 並set 權限:
Step 3 - 安裝 SQL DB (MySQL for this setup)
1-繞過all setup提示加快速度
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf ###sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf表示全面用127.0.0.1取代0.0.0.0
Step 1:安裝所需的先決條件 & Nova packages available in Maverick Meerkat
Nova需要RabbitMQ的消息傳遞因此我們將先安裝。確保您的主機名指向你的IP地址在/etc/ hosts中,否則 RabbitMQ的服務器將無法啟動沒有任何錯誤信息。sudo apt-get install rabbitmq-serve
你會看到消息開始用“Reading package lists... Done”,你必須鍵入 y確認要繼續。
sudo apt-get install python-software-properties sudo add-apt-repository ppa:nova-core/trunk
注意:如果sudo add-apt-repository ppa:nova-core/trunk不行,更換sudo add-apt-repository ppa:nova-core/release
sudo apt-get update然後安裝 Nova和相關依賴關係包
sudo apt-get install python-nova sudo apt-get install nova-common nova-doc nova-api nova-network nova-objectstore nova-scheduler nova-compute euca2ools unzip
你會看到消息開始用“Reading package lists... Done”,你必須鍵入 y確認要繼續。此操作可能需要一段時間因為許多相關的軟件包將被安裝。
Step 2: Set up configuration file (installed in /etc/nova)sudo gedit /etc/nova/nova.conf
内容如下:------------------------------
--daemonize=1
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--loggdir=/var/log/nova
--state_path=/var/lib/nova
--verbose
--sql_connection=mysql://root:nova@192.168.104.3/nova ###SQL數據庫的位置
--s3_host=192.168.104.3 ###這是Nova承載 objectstore服務,其中將包含VM images and buckets
--rabbit_host=192.168.104.3 ###這是rabbit 的AMQP messaging service
--ec2_host=192.168.104.3 ###這是nova-api service lives
--verbose ###Optional but very helpful during initial setup
--ec2_url=http://192.168.104.3:8773/services/Cloud ###nova-api 主機URL位址
--network_manager=nova.network.manager.VlanManager ### 控制型態分類如下
This is how your controller will communicate with additional Nova nodes and VMs: nova.network.manager.FlatManager # Simple, no-vlan networking type nova.network.manager. FlatDHCPManager # Flat networking with DHCP nova.network.manager.VlanManager # Vlan networking with DHCP –/DEFAULT/ if no network manager is defined in nova.conf
--fixed_range=192.168.104.0/24 ###這將是IPrange項目,未來將駐留在虛擬機的guest IP範圍。
--network_size=128 ### IP Addres 總數量使用虛擬機guests
-------------------------------
注意請依照自己環境設定
創造一個 “nova” group, 並set 權限:
sudo addgroup nova
sudo chown -R root:nova /etc/novasudo chmod 644 /etc/nova/nova.conf
Step 3 - 安裝 SQL DB (MySQL for this setup)
1-繞過all setup提示加快速度
sudo bash
MYSQL_PASS=nova
cat <
mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
mysql-server-5.1 mysql-server/start_on_boot boolean true
MYSQL_PRESEED
2-安装mysqlMYSQL_PASS=nova
cat <
mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
mysql-server-5.1 mysql-server/start_on_boot boolean true
MYSQL_PRESEED
sudo apt-get install -y mysql-server
3- 編輯/etc/mysql/my.cnf,bind-addresssed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf ###sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf表示全面用127.0.0.1取代0.0.0.0
service mysql restart
4-mysql配置mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;' mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;" 设置root用户密码 mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'root'@'%' = PASSWORD('$MYSQL_PASS');" ###mysql的root用户初始password是空的設置時,最好設定一組Password給$MYSQL_PASS
----Compute Node Installation---
重複Step 1和Step2,然後配置你的網絡計算實例的計算節點,複製 nova.conf文件從雲控制器節點到該節點中。
----Compute Node Installation---
Step 4 Network Configuration
如果您使用FlatManager作為網絡管理器(而不是VlanManager即顯示在nova.conf上面的例子),有一些額外的網絡改變你就得 做,以確保您的節點和虛擬機之間的連通性。如果您選擇 VlanManager或FlatDHCP,可以跳過這一節,因為它會自動為您設置。< begin /etc/network/interfaces > ---VlanManager或FlatDHCP 設定 # The loopback network interface auto lo iface lo inet loopback # Networking for NOVA auto br100 iface br100 inet dhcp bridge_ports eth0 bridge_stp off bridge_maxwait 0 bridge_fd 0 < end /etc/network/interfaces >
sudo /etc/init.d/networking restart
< begin /etc/network/interfaces >
auto lo iface lo inet loopback # Networking for NOVA auto br100 iface br100 inet static address 192.168.104.3 netmask 255.255.255.0 network 192.168.104.0 broadcast 0.0.0.255 gateway 192.168.104.1 bridge_ports eth0 bridge_stp off bridge_maxwait 0 bridge_fd 0 dns-nameservers "DNS IP"< end /etc/network/interfaces >
sudo /etc/init.d/networking restart
2011年4月3日 星期日
ubuntu 10 64.bit 安裝 flashplayer
1.下載頁面
http://labs.adobe.com/downloads/flashplayer10.html
2. 解壓縮 tar -xzvf flashplayer10_2_p3_64bit_linux_111710.tar.gz
3.移動檔案 到 sudo mv libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so
http://labs.adobe.com/downloads/flashplayer10.html
2. 解壓縮 tar -xzvf flashplayer10_2_p3_64bit_linux_111710.tar.gz
3.移動檔案 到 sudo mv libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so
2011年3月31日 星期四
Cisco、Canonical 宣佈支持開放源碼雲端平台 OpenStack
由 NASA 和管理服務供應商 Rackspace Hosting 共同開發的開放源碼雲端架構平台 OpenStack,日前獲得來自 Cisco Systems、Canonical 在內等新成員的支持。OpenStack 更宣佈代碼 Bexar 的第二次公開釋出版本,其中包含了對其計算 (Compute) 與物件儲存 (Object Storage) 平台的更新,並首度納入新的虛擬機器映像登錄與遞送服務 Glance。
OpenStack 是一套免費的開放源碼平台,可供服務供應商用以提供基礎架構,類似於 Amazon Web Services 的 EC2 和 S3。該平台主要分為 2 個部份,Nova 是最初由 NASA 所開發的電腦處理服務,Swift 則是 Rackspace 開發的儲存服務元件。
新釋出的 Compute 元件部份增加了對 IPv6、微軟 Hyper-V、iSCSI、Citrix XenAPI、XenServer 快照的支援,並且納入了代號 Glance 的映像找尋和遞送子專案,可達成工作負載在 OpenStack 雲端間的可移性。Bexar 釋出將 Object Storage 的物件由 5GB 擴充至不限大小。
OpenStack 專案此次公佈了 4 個新成員,其中包括 Cisco、Ubuntu Linux 商業贊助者 Canonical、Extreme Networks、Grid Dynamics。隨著新成員的加入,OpenStack 聯盟已達 50 個成員,其中包含了 AMD、Citrix、Dell、Intel。
同時也是 VMware 緊密合作夥伴的 Cisco,其雲端運算部門技術長 Lew Tucker 表示,Cisco 樂於宣佈該公司加入 OpenStack 社群的貢獻成員之列。他認為,網路供應與網路為基礎的服務是雲端運算中的基礎元件,他們期盼與社群一同確保此一開放源碼專案的成功。Rackspace 業務開發副總裁 Mark Collier 指出,Cisco 預期會為該專案貢獻程式碼,以便讓用戶更容易在 OpenStack 環境中設定 Cisco 的交換器。
儘管並非 OpenStack 會員之一,微軟表示其 Hyper-V 虛擬化軟體將可運用於 OpenStack。事實上這次釋出的 Bexar 版本中,就包含了對微軟 Hyper-V hypervisor 的支援,此一貢獻是由 Cloud.com 在微軟協助下所完成。OpenStack 過去已可支援紅帽的 KVM 和 Citrix Systems 的 XenServer。
Collier 表示,OpenStack的設計原本就與 hypervisor 相互獨立。他透露,列表上缺少的 VMware 的 ESX Server,將於今年稍後加入支援。OpenStack 貢獻者已經投入開發工作,其中包括了來自 Citrix Systems 的開發者。儘管 VMware 擁有自己的雲端建構軟體,vCloud,Collier 表示歡迎 VMware 隨時加入 OpenStack 聯盟。
OpenStack 的競爭對手包括 Amazon Web Services 的 EC2、相容於 Amazon Web Services 的開放源碼平台 Eucalyptus、VMware 私有的 vCloud、Nimbula Systems 的開放源碼 Director 雲端作業系統。不久前 Internap 成為 Rackspace 和 NASA 之外,第一家以 OpenStack 為基礎提供服務的公司。其 XIPCloud Storage 服務目前處於 beta 階段。
去年 10 月才推出第一個釋出版「Austin」的 OpenStack,其實還算是個初創的專案。因此 Rackspace 希望來自 Cisco 這類大公司的支持,可以讓企業對於該軟體更具信心。Collier 指出,有關雲端平台的決定影響重大,假如用戶想要採納一套雲端平台,特別是開放源碼平台,支持該平台的公司越可靠,對於該平台的存續用戶越能夠感到放心。
Canonical 主席 Mark Shuttleworth 表示,Canonical 會在預計 4 月推出的 Ubuntu 11.04 中,同時納入以 OpenStack 和 Eucalyptus 為基礎的雲端選項。Rackspace 技術長 Jim Curry 表示,Canonical 正在設法大幅簡化 OpenStack 的環境建置。過去 Canonical 一直是 Eucalyptus 的支持者,並以該平台作為 Ubuntu Enterprise Cloud 的基礎。Shuttleworth 指出,真正重要的是我們開始在雲端的基礎架構層次上,看到些許標準化的影子。Eucalyptus 和 OpenStack 都位於此一過程中的中心。
和 NASA 合作運行其雲端環境的 Anso Labs 共同創辦人 Jesse Andrews 表示,OpenStack 代號 Cactus 的下一釋出版本開發工作已經在進行中,其主要目標之一是為電信與服務供應商的大規模部署,提供足夠的穩定性,
相關網址:
1.Cisco 支持 OpenStack 雲端平台
http://news.yahoo.com/s/pcworld/20110203/tc_pcworld/ciscobacksopenstackcloudplatform
2.Canonical 與 Cisco 歡迎 OpenStack 的 Bexar 釋出
http://www.eweekeurope.co.uk/news/canonical-and-cisco-welcome-openstacks-bexar-releases-20057
3.OpenStack 釋出 Bexar 更新
http://www.v3.co.uk/v3/news/2274593/openstack-bexar-cloud-computing
4.OpenStack 的 Bexar 雲端作業系統增添 VM 映像登錄服務
http://www.sdtimes.com/link/35243
5.OpenStack 'Bexar' 釋出加入跨 Hypervisor 支援
http://www.informationweek.com/news/cloud-computing/infrastructure/showArticle.jhtml?articleID=229200430&subSection=News
6.Canonical 將 Ubuntu 帶向 OpenStack 雲端
http://www.zdnet.com/blog/open-source/canonical-brings-ubuntu-to-the-openstack-cloud/8204
7.OpenStack:只會有一種 Ubuntu 雲端平台
http://www.theregister.co.uk/2011/02/03/openstack_on_ubuntu_partnership/
8.Canonical 加入 OpenStack 社群
http://www.theinquirer.net/inquirer/news/2024215/canonical-joins-openstack-community
9.OpenStack 雲端平台新增 Bexar 釋出和支持者
http://www.zdnet.co.uk/news/cloud/2011/02/04/openstack-cloud-gets-bexar-release-and-backers-40091682/
10.OpenStack 雲端作業系統專案宣佈 Bexar 釋出和新夥伴
http://ostatic.com/blog/canonical-spreads-its-open-cloud-wings-with-openstack
OpenStack 是一套免費的開放源碼平台,可供服務供應商用以提供基礎架構,類似於 Amazon Web Services 的 EC2 和 S3。該平台主要分為 2 個部份,Nova 是最初由 NASA 所開發的電腦處理服務,Swift 則是 Rackspace 開發的儲存服務元件。
新釋出的 Compute 元件部份增加了對 IPv6、微軟 Hyper-V、iSCSI、Citrix XenAPI、XenServer 快照的支援,並且納入了代號 Glance 的映像找尋和遞送子專案,可達成工作負載在 OpenStack 雲端間的可移性。Bexar 釋出將 Object Storage 的物件由 5GB 擴充至不限大小。
OpenStack 專案此次公佈了 4 個新成員,其中包括 Cisco、Ubuntu Linux 商業贊助者 Canonical、Extreme Networks、Grid Dynamics。隨著新成員的加入,OpenStack 聯盟已達 50 個成員,其中包含了 AMD、Citrix、Dell、Intel。
同時也是 VMware 緊密合作夥伴的 Cisco,其雲端運算部門技術長 Lew Tucker 表示,Cisco 樂於宣佈該公司加入 OpenStack 社群的貢獻成員之列。他認為,網路供應與網路為基礎的服務是雲端運算中的基礎元件,他們期盼與社群一同確保此一開放源碼專案的成功。Rackspace 業務開發副總裁 Mark Collier 指出,Cisco 預期會為該專案貢獻程式碼,以便讓用戶更容易在 OpenStack 環境中設定 Cisco 的交換器。
儘管並非 OpenStack 會員之一,微軟表示其 Hyper-V 虛擬化軟體將可運用於 OpenStack。事實上這次釋出的 Bexar 版本中,就包含了對微軟 Hyper-V hypervisor 的支援,此一貢獻是由 Cloud.com 在微軟協助下所完成。OpenStack 過去已可支援紅帽的 KVM 和 Citrix Systems 的 XenServer。
Collier 表示,OpenStack的設計原本就與 hypervisor 相互獨立。他透露,列表上缺少的 VMware 的 ESX Server,將於今年稍後加入支援。OpenStack 貢獻者已經投入開發工作,其中包括了來自 Citrix Systems 的開發者。儘管 VMware 擁有自己的雲端建構軟體,vCloud,Collier 表示歡迎 VMware 隨時加入 OpenStack 聯盟。
OpenStack 的競爭對手包括 Amazon Web Services 的 EC2、相容於 Amazon Web Services 的開放源碼平台 Eucalyptus、VMware 私有的 vCloud、Nimbula Systems 的開放源碼 Director 雲端作業系統。不久前 Internap 成為 Rackspace 和 NASA 之外,第一家以 OpenStack 為基礎提供服務的公司。其 XIPCloud Storage 服務目前處於 beta 階段。
去年 10 月才推出第一個釋出版「Austin」的 OpenStack,其實還算是個初創的專案。因此 Rackspace 希望來自 Cisco 這類大公司的支持,可以讓企業對於該軟體更具信心。Collier 指出,有關雲端平台的決定影響重大,假如用戶想要採納一套雲端平台,特別是開放源碼平台,支持該平台的公司越可靠,對於該平台的存續用戶越能夠感到放心。
Canonical 主席 Mark Shuttleworth 表示,Canonical 會在預計 4 月推出的 Ubuntu 11.04 中,同時納入以 OpenStack 和 Eucalyptus 為基礎的雲端選項。Rackspace 技術長 Jim Curry 表示,Canonical 正在設法大幅簡化 OpenStack 的環境建置。過去 Canonical 一直是 Eucalyptus 的支持者,並以該平台作為 Ubuntu Enterprise Cloud 的基礎。Shuttleworth 指出,真正重要的是我們開始在雲端的基礎架構層次上,看到些許標準化的影子。Eucalyptus 和 OpenStack 都位於此一過程中的中心。
和 NASA 合作運行其雲端環境的 Anso Labs 共同創辦人 Jesse Andrews 表示,OpenStack 代號 Cactus 的下一釋出版本開發工作已經在進行中,其主要目標之一是為電信與服務供應商的大規模部署,提供足夠的穩定性,
相關網址:
1.Cisco 支持 OpenStack 雲端平台
http://news.yahoo.com/s/pcworld/20110203/tc_pcworld/ciscobacksopenstackcloudplatform
2.Canonical 與 Cisco 歡迎 OpenStack 的 Bexar 釋出
http://www.eweekeurope.co.uk/news/canonical-and-cisco-welcome-openstacks-bexar-releases-20057
3.OpenStack 釋出 Bexar 更新
http://www.v3.co.uk/v3/news/2274593/openstack-bexar-cloud-computing
4.OpenStack 的 Bexar 雲端作業系統增添 VM 映像登錄服務
http://www.sdtimes.com/link/35243
5.OpenStack 'Bexar' 釋出加入跨 Hypervisor 支援
http://www.informationweek.com/news/cloud-computing/infrastructure/showArticle.jhtml?articleID=229200430&subSection=News
6.Canonical 將 Ubuntu 帶向 OpenStack 雲端
http://www.zdnet.com/blog/open-source/canonical-brings-ubuntu-to-the-openstack-cloud/8204
7.OpenStack:只會有一種 Ubuntu 雲端平台
http://www.theregister.co.uk/2011/02/03/openstack_on_ubuntu_partnership/
8.Canonical 加入 OpenStack 社群
http://www.theinquirer.net/inquirer/news/2024215/canonical-joins-openstack-community
9.OpenStack 雲端平台新增 Bexar 釋出和支持者
http://www.zdnet.co.uk/news/cloud/2011/02/04/openstack-cloud-gets-bexar-release-and-backers-40091682/
10.OpenStack 雲端作業系統專案宣佈 Bexar 釋出和新夥伴
http://ostatic.com/blog/canonical-spreads-its-open-cloud-wings-with-openstack
2011年3月26日 星期六
CDN (Content delivery network)
CDN (Content delivery network) 被稱為「內容傳遞網路」是一種內容快取機制,能提供高效能 (包括使用者以及內容提供者)、高可靠度、低成本的內容傳遞架構。不過,這幾個優點並不一定同時會發生。以對使用者高效能這點,通常指的是「就近取得檔案」,內容提供者事先將檔案推到全球的 CDN 節點,在台灣的下載者儘量從台灣取得檔案,在日本或香港的下載者也儘量從當地的伺服器取得檔案。由於在全球有多個節點,所以當某個節點不通時,可以導到次近的節點以達到高可靠度。對 內容提供者高效能的部份,是因為內容提供者不需要在一個 data center 上建立非常粗的水管。舉例來說,如果傳遞需要 100Gbps 的流量,利用 CDN 架構,每個 data center 也許只需要 5Gbps 的流量。由於十個 10Gbps 網路與 100Gbps 網路的成熟度不同,成本也會不相同。
要挑什麼 CDN 是依照需求而決定,我會談的是台灣的情況。
在台灣有「用戶」的 ISP 中,HiNet 與 TANet 的出國線路狀態是最差的,其他 ISP 的情況會好很多,所以測試的重點要放在這兩個 ISP。
以 影音來說,由於傳輸時間普遍會大於一秒,重點在於 bandwidth 而非 latency。所以到台灣抓與香港、日本,甚至到美國抓其實都 okay,只要 thoughtput 夠高就可以。以 1M 高畫質的影片換算,有穩定 150KB/sec 的速度其實就很順,如果是 600K 或是更低,有穩定的 100KB/sec 以上就 okay。
如果是 css/javascript,因為檔案很小,latency 就變得很重要。可以從台灣本地提供檔案通常是最好的 (<10ms),或是從日本、香港 (~20ms 到 30ms) 提供,如果 CDN 業者可以幫忙 gzip 會更好 (因為他們會處理 IE6 的一卡車問題)。
如果檔案是屬於下載性質,速度其實不是重點,重點在於成本的話,有些 CDN 業者有提供「經濟型網路」,通常是用北美較便宜的點提供下載。有一定的 commit 時會比 Amazon S3 的 USD$0.17/GB 便宜。
轉貼http://freemannote.blogspot.com/2009/03/content-delivery-network-cdn.html
這是 CDN 的一些粗略的概念。
用 CDN 最常見的兩個理由:
* 速度:下載者可以就近取得檔案。這對於小檔案 (css/javascript) 會有很大的幫助。(也許要解釋瀏覽器 HTTP 的運作,並抓一張 Firebug 的畫面分析?)
* 效率:因為下載者透過 CDN 下載,可以減少原始 server 的負荷。
另外還有其他的理由:
* 成本
* 安全:以分散架構對抗 DDoS 攻擊。
要決定使用者應該要到哪組 server 通常有這些方法:
* GeoDNS
* Anycast
* HTTP Redirect (會比較差)
這幾種不衝突,常見的是前兩者搭配著用。將 DNS server IP anycast,當下載者要抓某個 domain 時,近的 server 就會知道大致的區域。再配合 GeoDNS 判斷使用者的 IP address 適合到哪個 node。
不過這些問題對 HiNet 就很麻煩。(留到現場講)
再來就是 reverse proxy cache 所產生的問題,這個部份再想看看要怎麼寫。
前三大 CDN 服務提供者:
* Akamai
* Limelight Networks
* CDNetworks
其中 PIXNET 用的 Panther Express 前陣子被 CDNetworks 收購。
另外,很熱門的:
* Amazon CloudFront
Amazon CloudFront 有公開的價錢,Akamai 與 Limelight 也有可以參考的價錢:(只是參考用)
* Distributed Cloud (Akamai)
* Mosso Cloud Files (Limelight Networks)
其中 Akamai 國內有代理商 (併力科技)。
另外還有一些可以參考 Wikipedia 上的表。
要挑什麼 CDN 是依照需求而決定,我會談的是台灣的情況。
在台灣有「用戶」的 ISP 中,HiNet 與 TANet 的出國線路狀態是最差的,其他 ISP 的情況會好很多,所以測試的重點要放在這兩個 ISP。
以 影音來說,由於傳輸時間普遍會大於一秒,重點在於 bandwidth 而非 latency。所以到台灣抓與香港、日本,甚至到美國抓其實都 okay,只要 thoughtput 夠高就可以。以 1M 高畫質的影片換算,有穩定 150KB/sec 的速度其實就很順,如果是 600K 或是更低,有穩定的 100KB/sec 以上就 okay。
如果是 css/javascript,因為檔案很小,latency 就變得很重要。可以從台灣本地提供檔案通常是最好的 (<10ms),或是從日本、香港 (~20ms 到 30ms) 提供,如果 CDN 業者可以幫忙 gzip 會更好 (因為他們會處理 IE6 的一卡車問題)。
如果檔案是屬於下載性質,速度其實不是重點,重點在於成本的話,有些 CDN 業者有提供「經濟型網路」,通常是用北美較便宜的點提供下載。有一定的 commit 時會比 Amazon S3 的 USD$0.17/GB 便宜。
轉貼http://freemannote.blogspot.com/2009/03/content-delivery-network-cdn.html
2011年3月23日 星期三
Share nothing架構 分散式運算
Shared nothing架構(shared nothing architecture)是一 種分佈式計算架構。這種架構中的每一個節點( node)都是獨立、自給的,而且整個系統中沒有單點競爭。有些系統需要集中保存大量的狀態信息——數據庫、應用服務器或是其他類似的單點競爭系統。
Shared Nothing在Web 應用開發中尤其受到歡迎,究其原因是這種方案提供的scalability。Google在這個方面做了很好的示範。 在一個純Shared Nothing系統中,通過簡單地增加一些廉價的計算機做為系統的節點卻可以獲取幾乎無限的擴展。正是由於Shared Nothing架構中不存在單一瓶頸而降低系統運行速度。Google 稱之為sharding。 Shared nothing系統通常需要將他的數據分佈在多個節點的不同數據庫中(不同的計算機處理不同的用戶和查詢)或者要求每個節點通過使用某些協調協議來保留它自己的應用程序數據備份 ,這通常被成為數據庫Sharding。
現在對一個有著多個獨立的web節點卻存在一個惟一的共享數據庫這樣的架構是否能被稱之為 Shared nothing架構還是有很多爭論的。一個狀態型的應用(通常將狀態保存到一個集中化的數據庫中)要獲得shared nothing架構就需要通過數據網格和分佈式Cache。 但即便是這種架構,數據庫依然是故障單點。
Shared Nothing在Web 應用開發中尤其受到歡迎,究其原因是這種方案提供的scalability。Google在這個方面做了很好的示範。 在一個純Shared Nothing系統中,通過簡單地增加一些廉價的計算機做為系統的節點卻可以獲取幾乎無限的擴展。正是由於Shared Nothing架構中不存在單一瓶頸而降低系統運行速度。Google 稱之為sharding。 Shared nothing系統通常需要將他的數據分佈在多個節點的不同數據庫中(不同的計算機處理不同的用戶和查詢)或者要求每個節點通過使用某些協調協議來保留它自己的應用程序數據備份 ,這通常被成為數據庫Sharding。
現在對一個有著多個獨立的web節點卻存在一個惟一的共享數據庫這樣的架構是否能被稱之為 Shared nothing架構還是有很多爭論的。一個狀態型的應用(通常將狀態保存到一個集中化的數據庫中)要獲得shared nothing架構就需要通過數據網格和分佈式Cache。 但即便是這種架構,數據庫依然是故障單點。
訂閱:
文章 (Atom)

