亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 有獎(jiǎng)專家座談——自動(dòng)化運(yùn)維案例分享討論之一(特邀某大型網(wǎng)游運(yùn)維總監(jiān)“king_819”) [打印本頁]

作者: king_819    時(shí)間: 2011-11-16 10:44
標(biāo)題: 有獎(jiǎng)專家座談——自動(dòng)化運(yùn)維案例分享討論之一(特邀某大型網(wǎng)游運(yùn)維總監(jiān)“king_819”)

獲獎(jiǎng)名單已公布,詳情請看:http://72891.cn/thread-3626469-1-1.html

隨著互聯(lián)網(wǎng)的不斷發(fā)展,互聯(lián)網(wǎng)企業(yè)的IT架構(gòu)不斷擴(kuò)展,服務(wù)器數(shù)量也是越來越多,這樣對運(yùn)維人員的要求也是越來越高了,不可能再通過手動(dòng)一臺(tái)一臺(tái)的安裝配置服務(wù)器了,我們要從“零售商”變成“批發(fā)商”了,特別是網(wǎng)絡(luò)游戲行業(yè),從事網(wǎng)絡(luò)游戲運(yùn)維的兄弟們應(yīng)該深有感觸,往往在開新服的時(shí)候需要大批量的布署新的服務(wù)器,時(shí)間緊迫而且量大,裝系統(tǒng)、初始化、游戲服務(wù)端配置,枯燥而又乏味,有時(shí)還容易出錯(cuò),為了解放我們的雙手,讓我們的工作輕松又不容易出錯(cuò),所以要實(shí)現(xiàn)自動(dòng)化,今天我們就一起來討論下自動(dòng)化運(yùn)維的相關(guān)話題,第一期為初始化相關(guān)的討論,第二期為自動(dòng)化及后期腳本分享。
本期討論話題:

1、批量安裝
2、批量優(yōu)化
3、批量布署

活動(dòng)要求:

針對以上話題討論并分享經(jīng)驗(yàn)和實(shí)際運(yùn)行中的案例及解決方案。

活動(dòng)時(shí)間:
2011年11月16日——2011年11月30日

活動(dòng)有獎(jiǎng):閃迪CZ40 8GB U盤(3個(gè))
活動(dòng)結(jié)束后會(huì)從回帖中選出最具價(jià)值的三名網(wǎng)友,將獲得U盤一個(gè)。


作者: king_819    時(shí)間: 2011-11-16 10:50
希望大家分享一些自己在運(yùn)維自動(dòng)化方面的經(jīng)驗(yàn),共同討論,互相學(xué)習(xí)
作者: ning_lianjie    時(shí)間: 2011-11-16 10:58
1,批量安裝容易搞定
2,批量優(yōu)化和部署,很是頭疼,修改一個(gè)服務(wù)的配置文件,需要挨個(gè)修改,如果部署一個(gè)定時(shí)任務(wù),腳本需要一個(gè)一個(gè)的傳上去,求解決辦法...
作者: jqjyy    時(shí)間: 2011-11-16 10:58
恩。這個(gè)帖子好。如果獎(jiǎng)勵(lì)換成個(gè)IPHONE、IPAD之類的就更好了。
作者: ideabyte    時(shí)間: 2011-11-16 11:01
本帖最后由 ideabyte 于 2011-11-16 11:05 編輯

聽聞?dòng)袃煞N方案:
(1) 無盤,有游戲公司(如完美時(shí)空、武神)這樣做,僅僅處于聽聞階段
(2) PXE,RHEL系列通過kickstart來做,Debian系的不了解,不過目前準(zhǔn)備在Kickstart結(jié)束后按照服務(wù)器的角色通過Puppet來做后續(xù)的處理
作者: 無風(fēng)之谷    時(shí)間: 2011-11-16 11:02
恩。這個(gè)帖子好。如果獎(jiǎng)勵(lì)換成個(gè)IPHONE、IPAD之類的就更好了。
jqjyy 發(fā)表于 2011-11-16 10:58

要不老大你給贊助點(diǎn)
作者: yanyangtian4502    時(shí)間: 2011-11-16 11:05
被人搶先了啊
作者: Shell_HAT    時(shí)間: 2011-11-16 11:06
回復(fù) 3# ning_lianjie


方案1:expect
方案2:ssh certification
作者: chenyx    時(shí)間: 2011-11-16 11:06
支持下
作者: xtdddd2000    時(shí)間: 2011-11-16 11:07
這個(gè)ks和bash,perl用好就比較好了。。很方便。。。

ks可以進(jìn)行大量化部署。。要什么有什么,結(jié)合post可以實(shí)現(xiàn)很多繁瑣的工作。

同時(shí)呢,bash和perl等腳步語言的質(zhì)量一定要高。。。盡可能的多用變量。。。如果可以單獨(dú)寫一個(gè)定義變量的腳本,豈不是更好。


以后我們只需要改這個(gè)文件就可以了。。



但是與此同時(shí),這個(gè)要求的SA又少了很多,但是對SA的技術(shù)要求過于高。  培養(yǎng)下一個(gè)SA可能還要花費(fèi)大量的財(cái)力等。。。。說不準(zhǔn)還找不到合適的人,這個(gè)就悲劇了。。
作者: chenyx    時(shí)間: 2011-11-16 11:08
1、批量安裝
使用PXE+dhcp+tftp+ks.cfg實(shí)現(xiàn)linux系統(tǒng)批量安裝,需要安裝系統(tǒng)的機(jī)器只要支持pxe啟動(dòng),系統(tǒng)安裝自動(dòng)化完成,相當(dāng)方便
2、批量優(yōu)化
暫時(shí)還沒有案例
作者: xtdddd2000    時(shí)間: 2011-11-16 11:10
噢。一個(gè)重要的問題又來了。。。云計(jì)算,不得否認(rèn)這是一個(gè)好東西,給我們帶來了很多的便利。

但與此同時(shí),  我們原來的200多個(gè)SA裁剪到幾個(gè)或是10幾個(gè)。   很多人失業(yè)啊,很多人心寒啊。。    還會(huì)有更多的人做這個(gè)嗎??

以后呢?    問題總是一個(gè)接著一個(gè)。。
作者: king_819    時(shí)間: 2011-11-16 11:14
1,批量安裝容易搞定
2,批量優(yōu)化和部署,很是頭疼,修改一個(gè)服務(wù)的配置文件,需要挨個(gè)修改,如果部署一個(gè)定時(shí)任 ...
ning_lianjie 發(fā)表于 2011-11-16 10:58


1、批量優(yōu)化在安裝的過程中可以執(zhí)行優(yōu)化腳本
2、在部署的時(shí)候各服務(wù)器與管理建立信任關(guān)系,通scp 復(fù)制腳本,批量執(zhí)行
作者: king_819    時(shí)間: 2011-11-16 11:16
噢。一個(gè)重要的問題又來了。。。云計(jì)算,不得否認(rèn)這是一個(gè)好東西,給我們帶來了很多的便利。

但與此同時(shí) ...
xtdddd2000 發(fā)表于 2011-11-16 11:10



  現(xiàn)在的互聯(lián)網(wǎng)行業(yè)不再適用90年代廣東的那種工廠模式了,自動(dòng)化是趨勢了,成本是企業(yè)不得不考慮的問題
作者: shellyxz    時(shí)間: 2011-11-16 11:17
本帖最后由 shellyxz 于 2011-11-16 11:52 編輯

1. 批量安裝有很多軟件可以用,如Cobbler 等;
2. 批量優(yōu)化可以使用puppet;
3. 批量部署就是上面兩個(gè)內(nèi)容的集合吧;

最近也在思考運(yùn)維自動(dòng)化的問題,希望這些東西都能通過web進(jìn)行管理,不再使用一個(gè)ssh client登錄到服務(wù)器上進(jìn)行操作,當(dāng)然緊急情況下當(dāng)然需要。大家對webmin一定很熟悉,它就可以通過web對linux、unix進(jìn)行很大程度上管理,當(dāng)然目前好像只支持單機(jī)操作。我的想法是,可以對webmin進(jìn)行加工,可以同時(shí)對多臺(tái)機(jī)器通過web進(jìn)行管理。webmin 只需要安裝在一臺(tái)服務(wù)器,然后可以通過web訪問這臺(tái)機(jī)器對多臺(tái)服務(wù)器進(jìn)行配置優(yōu)化,類似于puppet的形式。集成身份驗(yàn)證、操作審計(jì)、sso、堡壘機(jī)功能,把這些基礎(chǔ)設(shè)施都集中到一起管理,這樣運(yùn)維人員可以把時(shí)間集中到解決業(yè)務(wù)層面的事情了。 不過這是不是過于理想化了?
作者: king_819    時(shí)間: 2011-11-16 11:18
1、批量安裝
使用PXE+dhcp+tftp+ks.cfg實(shí)現(xiàn)linux系統(tǒng)批量安裝,需要安裝系統(tǒng)的機(jī)器只要支持pxe啟動(dòng),系統(tǒng)安裝 ...
chenyx 發(fā)表于 2011-11-16 11:08



批量安裝Cobbler(補(bǔ)鞋匠)已經(jīng)相當(dāng)方便了,可以定義好初始化的優(yōu)化腳本,在安裝完成后執(zhí)行優(yōu)化
作者: king_819    時(shí)間: 2011-11-16 11:20
1. 批量安裝有很多軟件可以用,如Cobbler 等;
2. 批量優(yōu)化可以使用puppet;
3. 批量部署就是上面兩個(gè)內(nèi)容 ...
shellyxz 發(fā)表于 2011-11-16 11:17



   這個(gè)就需要自己開發(fā)運(yùn)維工具了,盛大有一套很強(qiáng)大的工具
作者: chenyx    時(shí)間: 2011-11-16 11:22
回復(fù) 16# king_819

聽說過,還沒有測試呢,哪天測試下,pxe已經(jīng)相當(dāng)令人滿意了
作者: king_819    時(shí)間: 2011-11-16 11:23
這個(gè)ks和bash,perl用好就比較好了。。很方便。。。

ks可以進(jìn)行大量化部署。。要什么有什么,結(jié)合post可 ...
xtdddd2000 發(fā)表于 2011-11-16 11:07



    post后面可以定義自己想要初始化的內(nèi)容,非常方便
作者: king_819    時(shí)間: 2011-11-16 11:24
回復(fù)  king_819

聽說過,還沒有測試呢,哪天測試下,pxe已經(jīng)相當(dāng)令人滿意了
chenyx 發(fā)表于 2011-11-16 11:22



  非常的方便,后面我發(fā)上一篇  Cobbler(補(bǔ)鞋匠)的文章
作者: yuhongchun    時(shí)間: 2011-11-16 11:25
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽
作者: king_819    時(shí)間: 2011-11-16 11:26
恩。這個(gè)帖子好。如果獎(jiǎng)勵(lì)換成個(gè)IPHONE、IPAD之類的就更好了。
jqjyy 發(fā)表于 2011-11-16 10:58


多分享、分討論,就能如你所愿!
作者: Shell_HAT    時(shí)間: 2011-11-16 11:28
expect + scp 遠(yuǎn)程復(fù)制文件
  1. #!/usr/local/bin/expect -f

  2. set ip 192.168.175.5
  3. set pwd ChinaUnix

  4. spawn scp ssh.exp root@$ip:/tmp

  5. expect {
  6.     "(yes/no)?" {send "yes\r";exp_continue}
  7.     "password:" {send  "$pwd\r"}
  8. }
  9. expect eof
復(fù)制代碼

作者: king_819    時(shí)間: 2011-11-16 11:28
回復(fù)  chenyx

支持下活動(dòng),PXE我們用得也比較多,實(shí)用就行,不需要去趕時(shí)mao~

下階段準(zhǔn)備在公司試用P ...
yuhongchun 發(fā)表于 2011-11-16 11:25



   Puppet 是比較的強(qiáng)大了,希望大家能分享一些puppet定義的腳本
作者: mching    時(shí)間: 2011-11-16 11:28
我也來說說吧,我也是剛加入運(yùn)維行列不久,也經(jīng)歷過公司大規(guī)模機(jī)器上線的情況,說說我的經(jīng)歷吧,跟大家交流分享下!

1、批量的安裝:
我們的機(jī)器基本上都是系統(tǒng)都是被初始化好了,用的是某開放平臺(tái)的機(jī)器,所以這個(gè)我們暫時(shí)不用太操心。主要是我們的業(yè)務(wù)需要依賴一些庫和一些基礎(chǔ)服務(wù),比如memcache,redis等,這樣在別人裝好的系統(tǒng)上去做這些事情基本步驟就是先加ssh信任,然后用rsync將lib等文件夾拷過去就可以直接用了,這樣就需要安裝的時(shí)候有一定的規(guī)范。(第一臺(tái)機(jī)器用源代碼手動(dòng)編譯,后面的機(jī)器基本與第一臺(tái)的架構(gòu)一致)

2、批量的優(yōu)化:
優(yōu)化主要是針對連接數(shù),mysql的配置文件,log放置的位置等信息做優(yōu)化,一般寫好一臺(tái)的腳本,批量執(zhí)行就沒問題了,前提是需要做好嚴(yán)格的測試。

3、批量部署:
這個(gè)就需要開發(fā)的協(xié)助了,我們一般會(huì)跟開發(fā)交流需要起哪些服務(wù),有什么要求,把代碼放到服務(wù)器上以后,一鍵拉起所有的服務(wù)就沒問題了。
總體來說,部署還是開發(fā)和運(yùn)維協(xié)作完成才能達(dá)到很好的效果。


這里所說的自動(dòng)化,我感覺大部分在腳本上,腳本好壞直接關(guān)系到自動(dòng)化的程度,當(dāng)然,這里的腳本不僅限于shell,只要能用好手里的工具,就能最大限度的提高效率,發(fā)揮他們的能力!
作者: king_819    時(shí)間: 2011-11-16 11:29
expect + scp 遠(yuǎn)程復(fù)制文件
Shell_HAT 發(fā)表于 2011-11-16 11:28


如果量大了,還是得上puppet
作者: Shell_HAT    時(shí)間: 2011-11-16 11:31
expect + ftp 下載FTP文件
  1. #!/usr/local/bin/expect -f
  2. set ipaddress 192.168.175.5
  3. set user root
  4. set pass ChinaUnix

  5. spawn ftp $ipaddress
  6. expect "*Name*"
  7. send "$user\n"
  8. expect "*Password:*"
  9. send "$pass\n"
  10. expect "*ok*ftp>*"
  11. send "get teste\n"
  12. expect "*ftp>*"
  13. send "quit\n"
  14. expect eof
復(fù)制代碼

作者: king_819    時(shí)間: 2011-11-16 11:34
expect + ftp 下載FTP文件
Shell_HAT 發(fā)表于 2011-11-16 11:31



支持清野分享更多的自動(dòng)化腳本!
作者: 2005wind    時(shí)間: 2011-11-16 11:36
上次 一篇文章上介紹
Kickstart
Fully Automatic Installation
Cobbler
Spacewalk
OpenQRM

但是那個(gè)OpenQRM 好像很強(qiáng)大 有熟悉的嗎?
作者: king_819    時(shí)間: 2011-11-16 11:37
批量修改遠(yuǎn)程linux服務(wù)器密碼

一、建立信任關(guān)系

192.168.9.203 為管理機(jī)

192.168.9.201 192.168.9.202 為遠(yuǎn)程linux服務(wù)器

1、在管理機(jī)生成證書、
  1. [root@manage ~]# ssh-keygen -t rsa
復(fù)制代碼
Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa.   (私鑰)

Your public key has been saved in /root/.ssh/id_rsa.pub. (公鑰)

The key fingerprint is:

36:ec:fc:db:b0:7f:81:7e:d0:1d:36:5e:29:dd:5b:a0



2、將管理機(jī)上的公鑰傳送到各遠(yuǎn)程服務(wù)器

如遠(yuǎn)程服務(wù)器更改了默認(rèn)的ssh端口號(hào),就使用scp -P 17173,17173為端口號(hào)
  1. [root@manage .ssh]# scp id_rsa.pub 192.168.9.201:/root/.ssh/authorized_keys

  2. [root@manage .ssh]# scp id_rsa.pub 192.168.9.202:/root/.ssh/authorized_keys
復(fù)制代碼
管理機(jī)與遠(yuǎn)程主機(jī)信任關(guān)系建立完畢



二、通過shell腳本批量修改遠(yuǎn)程服務(wù)器密碼

如果要調(diào)用mkpasswd就得安裝expect,使用mkpasswd可以隨機(jī)產(chǎn)生密碼

usage: mkpasswd [args] [user]

where arguments are:

    -l #      (length of password, default = 10)

    -d #      (min # of digits, default = 2)

    -c #      (min # of lowercase chars, default = 2)

    -C #      (min # of uppercase chars, default = 2)

    -s #      (min # of special chars, default = 1)

    -v        (verbose, show passwd interaction)

    -p prog   (program to set password, default = passwd)

比如說你要指定一個(gè)長度為8,而且至少有三個(gè)大寫字母的密碼,那么可以這樣輸入:

mkpasswd -l 8 - C 3,好了,密碼就會(huì)按你的要求隨機(jī)產(chǎn)生了
  1. yum -y install expect
復(fù)制代碼
ip_list.txt為遠(yuǎn)程服務(wù)器IP列表
  1. [root@manage .ssh]# cat ip_list.txt
復(fù)制代碼
192.168.9.201

192.168.9.202

如果遠(yuǎn)程服務(wù)器修改了默認(rèn)ssh的端口號(hào),就使用ssh -p 17173,17173為端口號(hào)
  1. #!/bin/bash

  2. #============== Though ssh remote server ,auto modify ROOT passwd =============#

  3. for IP in `cat /root/ip_list.txt` #導(dǎo)入遠(yuǎn)程要修改主機(jī)的IP

  4. do

  5. #========================= 創(chuàng)建遠(yuǎn)程主機(jī)密碼 ==========================#

  6. TMP_PWD=`mkpasswd -l 8 -C 3`

  7. R_PWD=`echo ${IP}_${TMP_PWD}`

  8. echo "${IP}_${TMP_PWD}" > R_PWD.txt



  9. #=========================== 修改遠(yuǎn)程主機(jī)密碼 ========================#


  10. if [ $? = 0 ] ; then

  11.    ssh $IP passwd root --stdin < R_PWD.txt

  12.    echo -e "$(date "+%Y-%m-%d %H:%M:%S")\t${IP}\t${R_PWD}\t" >> R_Server.log

  13. else

  14.    echo -e "$(date "+%Y-%m-%d %H:%M:%S")\t${IP} R_PWD.txt is create fail\tplease check!\t" >> M_pass.log

  15. fi

  16. if [ $? = 0 ] ; then

  17.    echo -e "$(date "+%Y-%m-%d %H:%M:%S")\tThe ${IP} passwd is modify OK\t" >> M_pass.log

  18. else

  19.    echo -e "$(date "+%Y-%m-%d %H:%M:%S")\tThe ${IP} passwd is modify fail\tplease check!\t" >> M_pass.log

  20. fi

  21. done
復(fù)制代碼

作者: king_819    時(shí)間: 2011-11-16 11:47
初始優(yōu)化腳本,加載到ks.cfg的post中去,通Cobbler批量安裝的同時(shí)直接進(jìn)行優(yōu)化
  1. #!/bin/bash
  2. # BY kerryhu
  3. # MAIL:king_819@163.com
  4. # BLOG:http://kerry.blog.51cto.com

  5. #welcome
  6. cat << EOF
  7. +--------------------------------------------------------------+
  8. |         === Welcome to Centos System init ===                |
  9. +--------------------------------------------------------------+
  10. +--------------------------by kerry----------------------------+
  11. EOF
  12. #update yum
  13. cd /etc/yum.repos.d
  14. mv CentOS-Base.repo  CentOS-Base.repo.bak
  15. wget http://centos.ustc.edu.cn/CentOS-Base.repo.5
  16. mv CentOS-Base.repo.5 CentOS-Base.repo

  17. #update system
  18. yum clean all
  19. yum -y update glibc\*
  20. yum -y update yum\* rpm\* python\*
  21. yum clean all
  22. yum -y update

  23. #set ntp
  24. yum -y install ntp
  25. echo "* 3 * * * /usr/sbin/ntpdate 210.72.145.44 > /dev/null 2>&1" >> /etc/crontab
  26. service crond restart

  27. #set ulimit
  28. echo "ulimit -SHn 102400" >> /etc/rc.local

  29. cat >> /etc/security/limits.conf << EOF
  30. *           soft   nofile       65535
  31. *           hard   nofile       65535
  32. EOF
  33.   

  34. #set locale
  35. #true > /etc/sysconfig/i18n
  36. #cat >>/etc/sysconfig/i18n<<EOF
  37. #LANG="zh_CN.GB18030"
  38. #SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
  39. #SYSFONT="latarcyrheb-sun16"
  40. #EOF

  41. #set sysctl
  42. true > /etc/sysctl.conf
  43. cat >> /etc/sysctl.conf << EOF
  44. net.ipv4.ip_forward = 0
  45. net.ipv4.conf.default.rp_filter = 1
  46. net.ipv4.conf.default.accept_source_route = 0
  47. kernel.sysrq = 0
  48. kernel.core_uses_pid = 1
  49. net.ipv4.tcp_syncookies = 1
  50. kernel.msgmnb = 65536
  51. kernel.msgmax = 65536
  52. kernel.shmmax = 68719476736
  53. kernel.shmall = 4294967296
  54. net.ipv4.tcp_max_tw_buckets = 6000
  55. net.ipv4.tcp_sack = 1
  56. net.ipv4.tcp_window_scaling = 1
  57. net.ipv4.tcp_rmem = 4096 87380 4194304
  58. net.ipv4.tcp_wmem = 4096 16384 4194304
  59. net.core.wmem_default = 8388608
  60. net.core.rmem_default = 8388608
  61. net.core.rmem_max = 16777216
  62. net.core.wmem_max = 16777216
  63. net.core.netdev_max_backlog = 262144
  64. net.core.somaxconn = 262144
  65. net.ipv4.tcp_max_orphans = 3276800
  66. net.ipv4.tcp_max_syn_backlog = 262144
  67. net.ipv4.tcp_timestamps = 0
  68. net.ipv4.tcp_synack_retries = 1
  69. net.ipv4.tcp_syn_retries = 1
  70. net.ipv4.tcp_tw_recycle = 1
  71. net.ipv4.tcp_tw_reuse = 1
  72. net.ipv4.tcp_mem = 94500000 915000000 927000000
  73. net.ipv4.tcp_fin_timeout = 1
  74. net.ipv4.tcp_keepalive_time = 1200
  75. net.ipv4.ip_local_port_range = 1024 65535
  76. EOF

  77. /sbin/sysctl -p
  78. echo "sysctl set OK!!"

  79. #close ctrl+alt+del
  80. sed -i "s/ca::ctrlaltdel:\/sbin\/shutdown -t3 -r now/#ca::ctrlaltdel:\/sbin\/shutdown -t3 -r now/" /etc/inittab

  81. #set purview
  82. chmod 600 /etc/passwd
  83. chmod 600 /etc/shadow
  84. chmod 600 /etc/group
  85. chmod 600 /etc/gshadow

  86. #disable ipv6
  87. cat << EOF
  88. +--------------------------------------------------------------+
  89. |         === Welcome to Disable IPV6 ===                      |
  90. +--------------------------------------------------------------+
  91. EOF
  92. echo "alias net-pf-10 off" >> /etc/modprobe.conf
  93. echo "alias ipv6 off" >> /etc/modprobe.conf
  94. /sbin/chkconfig --level 35 ip6tables off
  95. echo "ipv6 is disabled!"
  96. #disable selinux
  97. sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
  98. echo "selinux is disabled,you must reboot!"
  99. #vim
  100. sed -i "8 s/^/alias vi='vim'/" /root/.bashrc
  101. echo 'syntax on' > /root/.vimrc
  102. #zh_cn
  103. sed -i -e 's/^LANG=.*/LANG="en"/'   /etc/sysconfig/i18n
  104. #init_ssh
  105. ssh_cf="/etc/ssh/sshd_config"
  106. sed -i -e '74 s/^/#/' -i -e '76 s/^/#/' $ssh_cf
  107. sed -i "s/#Port 22/Port 65535/" $ssh_cf
  108. sed -i "s/#UseDNS yes/UseDNS no/" $ssh_cf
  109. #client
  110. sed -i -e '44 s/^/#/' -i -e '48 s/^/#/' $ssh_cf
  111. service sshd restart
  112. echo "ssh is init is ok.............."
  113. #chkser
  114. #tunoff services
  115. #--------------------------------------------------------------------------------
  116. cat << EOF
  117. +--------------------------------------------------------------+
  118. |         === Welcome to Tunoff services ===                   |
  119. +--------------------------------------------------------------+
  120. EOF
  121. #---------------------------------------------------------------------------------
  122. for i in `ls /etc/rc3.d/S*`
  123. do
  124.                CURSRV=`echo $i|cut -c 15-`
  125. echo $CURSRV
  126. case $CURSRV in
  127.            crond | irqbalance | microcode_ctl | lvm2-monitor | network | random | sshd | syslog  )
  128.        echo "Base services, Skip!"
  129.        ;;
  130.        *)
  131.            echo "change $CURSRV to off"
  132.            chkconfig --level 235 $CURSRV off
  133.            service $CURSRV stop
  134.        ;;
  135. esac
  136. done

  137. echo "service is init is ok.............."
復(fù)制代碼

作者: kns1024wh    時(shí)間: 2011-11-16 12:20
回復(fù) 1# king_819


1、批量安裝
這個(gè)就不用怎么多少了,如果搞linux行當(dāng)?shù)氖潜仨殨?huì)的
獨(dú)辟蹊徑網(wǎng)絡(luò)安裝系列后續(xù)--深入使用PXE網(wǎng)絡(luò)環(huán)境   [第十四期]
http://72891.cn/viewthread.php?tid=1946041
獨(dú)辟蹊徑系列本地網(wǎng)絡(luò)PXE安裝Ubuntu   [第十五期]
http://72891.cn/viewthread.php?tid=1945989
獨(dú)辟蹊徑網(wǎng)絡(luò)安裝系列之Redhat衍生版重構(gòu)初探[09年3月刊]
http://72891.cn/viewthread.php?tid=1989126
當(dāng)然還有clonezilla 等工具可以選擇
批量應(yīng)用的 ghost母盤方式也是一個(gè)技術(shù)

2、批量優(yōu)化
這個(gè)是相對某個(gè)業(yè)務(wù)流程中的架構(gòu)組建,如mysql的my.cnf 以及nginx apahce 等配置文件 php.ini等參數(shù)。這些可以建立一個(gè)版本庫通過獲取版本方式來更新配置。或者通過附加條件判斷,負(fù)載不同配置文件加載不同的配置,實(shí)時(shí)性的優(yōu)化。


3、批量布署
linux的特性跨平臺(tái),傻瓜方式 ,在優(yōu)化主機(jī)上將應(yīng)用編譯到一個(gè)目錄下,然后在全部的linux主機(jī)使用批量安裝相同配置參數(shù)的os的前提下,可以tar好編譯的目錄直接到每個(gè)主機(jī)上,通過分布式的shell定時(shí)器可以批量 下載。
或者在批量安裝的%post的腳本執(zhí)行部署操作。

批量安裝 要包含批量部署,批量優(yōu)化是根據(jù)業(yè)務(wù)動(dòng)態(tài)調(diào)整的。

作者: kns1024wh    時(shí)間: 2011-11-16 12:24
回復(fù) 1# king_819


    準(zhǔn)備一臺(tái)安裝服務(wù)器,開啟pxe 配置好自動(dòng)安裝,在每一個(gè)安裝后的主機(jī)上部署好 分布式shell 或者全部建立ssh密鑰通道,可以在安裝服務(wù)器上具體 push任何腳本



   定制到光盤中,在系統(tǒng)安裝后 應(yīng)用也就有了
  
  viop的很多os都是基于centos的定制的


http://72891.cn/forum-237-1.html
定制版
作者: woshiwei201    時(shí)間: 2011-11-16 13:02
目前就我工作的環(huán)境,我們是這樣做的。
批量安裝
1.vsphere克隆(系統(tǒng)虛擬化)
2.ks
3.存儲(chǔ)lun拷貝

批量優(yōu)化
shell,perl腳本
第三方工具
作者: Shell_HAT    時(shí)間: 2011-11-16 13:41
expect + ssh 登錄遠(yuǎn)程主機(jī)并修改login profile
  1. #!/usr/local/bin/expect -f
  2. set ip 192.168.175.5
  3. set user root
  4. set pass ChinaUnix
  5. set rps rhel6

  6. spawn ssh $user@$ip
  7. expect "password:"
  8. send "$pass\n"
  9. expect "$rps"
  10. send "echo 'PATH=\$PATH:\$HOME/bin' >> .bash_profile\n"
  11. expect "$rps"
  12. send "echo 'export PATH' >> .bash_profile\n"
  13. expect "$rps"
  14. send "exit\n"
  15. expect eof
復(fù)制代碼

作者: Shell_HAT    時(shí)間: 2011-11-16 13:57
回復(fù) 30# king_819


改造成不依賴于mkpasswd的:
  1. #!/bin/bash
  2. function pwdgen {
  3.     strUp="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  4.     strLow="abcdefghijklmnopqrstuvwxyz"
  5.     strNum="0123456789"
  6.     passLen="8"
  7.     while [ "${#pass}" -le "$passLen" ]
  8.     do
  9.         passUp="${strUp:$(($RANDOM%${#strUp})):1}"
  10.         passLow="${strLow:$(($RANDOM%${#strLow})):1}"
  11.         passNum="${strNum:$(($RANDOM%${#strNum})):1}"
  12.         pass="$pass$passUp$passLow$passNum"
  13.     done
  14.     echo ${pass:0:$passLen}
  15. }

  16. #============== Though ssh remote server ,auto modify ROOT passwd =============#
  17. for IP in `cat /root/ip_list.txt`; do #導(dǎo)入遠(yuǎn)程要修改主機(jī)的IP
  18.     #========================= 創(chuàng)建遠(yuǎn)程主機(jī)密碼 ==========================#
  19.     TMP_PWD=`pwdgen`
  20.     R_PWD=`echo ${IP}_${TMP_PWD}`
  21.     echo "${IP}_${TMP_PWD}" > R_PWD.txt
  22.     #=========================== 修改遠(yuǎn)程主機(jī)密碼 ========================#
  23.     if [ $? = 0 ] ; then
  24.         ssh $IP passwd root --stdin < R_PWD.txt
  25.         echo -e "$(date "+%Y-%m-%d %H:%M:%S")\t${IP}\t${R_PWD}\t" >> R_Server.log
  26.     else
  27.         echo -e "$(date "+%Y-%m-%d %H:%M:%S")\t${IP} R_PWD.txt is create fail\tplease check!\t" >> M_pass.log
  28.     fi
  29.     if [ $? = 0 ] ; then
  30.         echo -e "$(date "+%Y-%m-%d %H:%M:%S")\tThe ${IP} passwd is modify OK\t" >> M_pass.log
  31.     else
  32.         echo -e "$(date "+%Y-%m-%d %H:%M:%S")\tThe ${IP} passwd is modify fail\tplease check!\t" >> M_pass.log
  33.     fi
  34. done
復(fù)制代碼

作者: yifangyou    時(shí)間: 2011-11-16 14:10
1、批量安裝
答:我們公司使用的都是虛擬機(jī),專門有一套系統(tǒng)通過web操作,生成虛擬機(jī),基本上個(gè)5分鐘就能夠生成一個(gè)linux系統(tǒng)的服務(wù)器非常方便,不用到現(xiàn)場安裝。
2、批量優(yōu)化
答:目前我們公司在開發(fā)一套配置管理系統(tǒng),專門管理所有服務(wù)器上配置文件,可以同時(shí)操作上千個(gè)配置文件,并執(zhí)行命令。
3、批量布署
答:對于批量安裝apache或者執(zhí)行一些系統(tǒng)命令的話
若是只有3-10臺(tái),可以直接使用xmanage的批量執(zhí)行命令工具,
若是超過10臺(tái)的話,我們這邊主要使用expect來進(jìn)行自動(dòng)化批量執(zhí)行。
1)首先從一臺(tái)控制機(jī)器上把要更新或者安裝的文件批量上傳到服務(wù)器上
見我的博客<scp批量上傳文件到多臺(tái)機(jī)器上(升級(jí)版)>
2)然后在一臺(tái)控制機(jī)器上執(zhí)行安裝命令,見<批量在遠(yuǎn)程執(zhí)行命令>


作者: king_819    時(shí)間: 2011-11-16 14:10
回復(fù)  king_819


1、批量安裝

2、批量優(yōu)化


3、批量布署
kns1024wh 發(fā)表于 2011-11-16 12:20



  ghost母盤這種方式在網(wǎng)吧、企業(yè)內(nèi)部開發(fā)應(yīng)用環(huán)境才會(huì)用到吧,真正的外網(wǎng)生產(chǎn)環(huán)境還是不建議這種方式的!
作者: king_819    時(shí)間: 2011-11-16 14:12
回復(fù)  king_819


改造成不依賴于mkpasswd的:
Shell_HAT 發(fā)表于 2011-11-16 13:57



    不錯(cuò)的方法!
作者: king_819    時(shí)間: 2011-11-16 14:13
回復(fù)  king_819


    準(zhǔn)備一臺(tái)安裝服務(wù)器,開啟pxe 配置好自動(dòng)安裝,在每一個(gè)安裝后的主機(jī)上部署好 分 ...
kns1024wh 發(fā)表于 2011-11-16 12:24


centos可以很方便的自己定制、裁剪、添加應(yīng)用,然后再批量安裝
作者: king_819    時(shí)間: 2011-11-16 14:18
1、批量安裝
答:我們公司使用的都是虛擬機(jī),專門有一套系統(tǒng)通過web操作,生成虛擬機(jī),基本上個(gè)5分鐘就能夠 ...
yifangyou 發(fā)表于 2011-11-16 14:10



1、通過虛擬化技術(shù)來復(fù)制虛擬機(jī)是比較快捷的一種方式,所以現(xiàn)在虛擬化技術(shù)應(yīng)用也越來越廣泛了
2、 自己開發(fā)自動(dòng)化運(yùn)維工具確實(shí)挺方便的
3、如果批理管理的服務(wù)器量不大,可以采用expect的方式來進(jìn)行管理,如果量大,puppet是一個(gè)不錯(cuò)的選擇
作者: king_819    時(shí)間: 2011-11-16 14:20
現(xiàn)在大家分享和討論更多的是linux下批量管理的方法,有windows批量管理經(jīng)驗(yàn)的兄弟們也可以分享下經(jīng)驗(yàn),在一般的網(wǎng)游公司中,windows服務(wù)器還是挺多的
作者: chenyx    時(shí)間: 2011-11-16 14:28
回復(fù) 21# yuhongchun


    嗯,有時(shí)間在研究,你的那個(gè)要是成功的話,一并發(fā)個(gè)文檔,我也試驗(yàn)下
作者: chenyx    時(shí)間: 2011-11-16 14:30
回復(fù) 16# king_819


    Cobbler我自聽說過,據(jù)說比pxe安全.不過還沒有進(jìn)行試驗(yàn).哪天你發(fā)個(gè)文檔吧
作者: chenyx    時(shí)間: 2011-11-16 14:31
對了,Cobbler對windows支持怎么樣,如果支持,都支持些什么windows版本?
作者: chenyx    時(shí)間: 2011-11-16 14:54
回復(fù) 42# king_819


    windows服務(wù)器通過pxe安裝還沒試驗(yàn)成功過,期待有文檔.
    看過網(wǎng)上的文檔有2003的pxe安裝,但是沒試驗(yàn)成功,據(jù)說vista/win7以及高版本需要windows環(huán)境才行.
作者: chenyx    時(shí)間: 2011-11-16 14:56
回復(fù) 41# king_819


    看網(wǎng)上的文檔,在虛擬化情況下,服務(wù)器克隆要比批量安裝省事多了.
作者: kns1024wh    時(shí)間: 2011-11-16 15:11
ghost母盤這種方式在網(wǎng)吧、企業(yè)內(nèi)部開發(fā)應(yīng)用環(huán)境才會(huì)用到吧,真正的外網(wǎng)生產(chǎn)環(huán)境還是不建議這種方式 ...
king_819 發(fā)表于 2011-11-16 14:10



    clonezilla 如果不會(huì)用就可以選擇
   clonezilla 也可以通過pxe進(jìn)行引導(dǎo)
  具體就是看 每種方式是否可以屏蔽硬件對os的影響 當(dāng)然systemimage也是可以選擇的方式
作者: kns1024wh    時(shí)間: 2011-11-16 15:12
ghost母盤這種方式在網(wǎng)吧、企業(yè)內(nèi)部開發(fā)應(yīng)用環(huán)境才會(huì)用到吧,真正的外網(wǎng)生產(chǎn)環(huán)境還是不建議這種方式 ...
king_819 發(fā)表于 2011-11-16 14:10



    任何一種方式只要能靈活應(yīng)用都是有價(jià)值的 技術(shù)并不是用來談?wù)摰?而是要來解決實(shí)際問題的
作者: kns1024wh    時(shí)間: 2011-11-16 15:13
回復(fù)  king_819


    windows服務(wù)器通過pxe安裝還沒試驗(yàn)成功過,期待有文檔.
    看過網(wǎng)上的文檔有200 ...
chenyx 發(fā)表于 2011-11-16 14:54



    PXE是一個(gè)環(huán)境的概念,誰說一定要是 linux環(huán)境的 弱智
作者: kns1024wh    時(shí)間: 2011-11-16 15:14
回復(fù)  king_819


    看網(wǎng)上的文檔,在虛擬化情況下,服務(wù)器克隆要比批量安裝省事多了.
chenyx 發(fā)表于 2011-11-16 14:56



    這個(gè)概念說大一點(diǎn) 就扯到云了  

   云 端部署
   云 主機(jī)一步配置到位
  

  可以眾說紛紜
作者: chenyx    時(shí)間: 2011-11-16 15:15
回復(fù) 50# kns1024wh


    我是想一個(gè)環(huán)境下linux和windows同時(shí)支持.呵呵
作者: 蟲蟲貓    時(shí)間: 2011-11-16 15:17
本帖最后由 蟲蟲貓 于 2011-11-16 15:18 編輯

1,批量安裝還有一種方法是使用臺(tái)灣同胞開發(fā)的企鵝龍,其實(shí)也就是linux下的ghost,支持組播,比pxe效率要快。
2.批量管理最近在研究cfengine3 ,感覺還是比較強(qiáng)大的,有標(biāo)準(zhǔn)的庫,puppet是在cfengine2的基礎(chǔ)上開發(fā)的,cfengine3代碼基本又全部重寫了,看過評(píng)測比puppet的效率要高,可惜語法比較晦澀,學(xué)習(xí)研究成本較高。

等俺研究的差不多了再共享吧。{:3_201:}
作者: chenyx    時(shí)間: 2011-11-16 15:17
回復(fù) 51# kns1024wh


    云現(xiàn)在用的人不多,現(xiàn)在一般就是在vmware esx或者redhat 的kvm下實(shí)施的多吧
作者: kns1024wh    時(shí)間: 2011-11-16 15:18
回復(fù)  kns1024wh


    我是想一個(gè)環(huán)境下linux和windows同時(shí)支持.呵呵
chenyx 發(fā)表于 2011-11-16 15:15



    這個(gè)是可以的
    那就是要兼容下windows 這個(gè)簡化方案就是  AD+pxe + linux 的安裝引導(dǎo)和安裝的源 windows環(huán)境就是 可以win安裝 linux安裝
  
    如果采用linux 就建議 使用clonzilla + windows 的syspre 結(jié)合在一起,linux采用pxe安裝方式 linux環(huán)境就是win 克隆 linux安裝

   說的比較簡略 需要一定的理解能力亞
作者: kns1024wh    時(shí)間: 2011-11-16 15:19
回復(fù)  kns1024wh


    云現(xiàn)在用的人不多,現(xiàn)在一般就是在vmware esx或者redhat 的kvm下實(shí)施的多吧
chenyx 發(fā)表于 2011-11-16 15:17



    是的
    不過關(guān)注下 虛擬化的模板是很有價(jià)值的
作者: chenyx    時(shí)間: 2011-11-16 15:21
回復(fù) 56# kns1024wh


    同意,虛擬機(jī)模版部署虛擬機(jī)肯定是最好的解決方案
作者: chenyx    時(shí)間: 2011-11-16 15:22
回復(fù) 55# kns1024wh


    確實(shí)夠復(fù)雜,百湖有文檔之類的嗎,分享下
作者: king_819    時(shí)間: 2011-11-16 16:01
回復(fù)  king_819


    Cobbler我自聽說過,據(jù)說比pxe安全.不過還沒有進(jìn)行試驗(yàn).哪天你發(fā)個(gè)文檔吧
chenyx 發(fā)表于 2011-11-16 14:30



    好的,后面我就發(fā)一篇關(guān)于cobbler批量安裝的文檔
作者: king_819    時(shí)間: 2011-11-16 16:04
回復(fù)  kns1024wh


    我是想一個(gè)環(huán)境下linux和windows同時(shí)支持.呵呵
chenyx 發(fā)表于 2011-11-16 15:15



關(guān)于cobbler批量安裝winodws我沒試過,不過可以在安裝cobbler的機(jī)器上再安裝ris-linux,以支持windows的批量安裝
作者: kns1024wh    時(shí)間: 2011-11-16 16:13
回復(fù)  kns1024wh


    確實(shí)夠復(fù)雜,百湖有文檔之類的嗎,分享下
chenyx 發(fā)表于 2011-11-16 15:22



    微軟的ris 也是一pxe為基礎(chǔ)的 linux 和windows的 就是 pxe的基礎(chǔ)文件有區(qū)別的 而windows 采用ris是 安裝方式非ghost方式 而linux采用pxe也是安裝方式
作者: king_819    時(shí)間: 2011-11-16 16:16
從事網(wǎng)游運(yùn)維的兄弟們應(yīng)該深有感觸,往往在開新服的時(shí)候需要大批量的布署新的服務(wù)器,Red Hat 最新發(fā)布了網(wǎng)絡(luò)安裝服務(wù)器套件 Cobbler(補(bǔ)鞋匠)集成了PXE、DHCP、DNS、Kickstart服務(wù)管理和yum倉庫管理工具,相對之前的 Kickstart 更加快捷、方便的批量布署red hat、centos類系統(tǒng)
1、安裝rpmforce源
CentOS 5.5默認(rèn)的Repository里找不到Cobbler,先安裝rpmforce這個(gè)Repository
  1. cd /opt
  2. wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
  3. rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
復(fù)制代碼
2、安裝相關(guān)軟件
  1. yum -y install cobbler dhcp httpd xinetd tftp-server
復(fù)制代碼
3、檢查cobbler配置
  1. cobbler check
復(fù)制代碼
根椐提示修改配置文件
/var/lib/cobbler/settings 中的 server 和 next_server 對應(yīng)的127.0.0.1修改為本服務(wù)器的 IP 地址,
manage_dhcp 設(shè)為 1,以便管理 DHCP

將 /etc/xinetd.d/tftp 中 disable = no

4、導(dǎo)入精簡后的ISO
  1. mkdir -p /mnt/iso
  2. mount -o loop /data/KerryOS-1.0-i386.iso /mnt/iso
  3. cobbler import --mirror=/mnt/iso --name=kerryOS-1.0-i386
復(fù)制代碼
查看導(dǎo)入結(jié)果
  1. cobbler distro list
復(fù)制代碼
5、修改 DHCP 和 Kickstart 配置模板
#修改DHCP配置模板
  1. vi /etc/dhcpd.conf
  2. vi /etc/cobbler/dhcp.template

  3. ddns-update-style interim;

  4. allow booting;
  5. allow bootp;

  6. ignore client-updates;
  7. set vendorclass = option vendor-class-identifier;

  8. subnet 192.168.9.0 netmask 255.255.255.0 {
  9.      option routers          192.168.9.1;   #路由器地址
  10.      option subnet-mask      255.255.255.0;  #子網(wǎng)掩碼選項(xiàng)
  11.      option domain-name-servers  192.168.9.1;  #DNS地址
  12.      range dynamic-bootp     192.168.9.200 192.168.9.254;  #動(dòng)態(tài)IP范圍
  13.      filename                "/pxelinux.0";
  14.      default-lease-time      21600;     #缺省租約時(shí)間
  15.      max-lease-time          43200;        #最大租約時(shí)間
  16.      next-server             192.168.9.230;  #指定引導(dǎo)服務(wù)器
  17. }
復(fù)制代碼
#修改 Kickstart 配置模板
  1. mv /var/www/cobbler/kickstarts/kerryOS-1.0-i386/ks.cfg /var/www/cobbler/kickstarts/kerryOS-1.0-i386/ks.cfg.bak
  2. mv /var/www/cobbler/kickstarts/kerryOS-1.0-xen-i386/ks.cfg /var/www/cobbler/kickstarts/kerryOS-1.0-xen-i386/ks.cfg.bak
  3. vi /etc/cobbler/default.ks
  4. vi /var/www/cobbler/kickstarts/kerryOS-1.0-i386/ks.cfg
  5. vi /var/www/cobbler/kickstarts/kerryOS-1.0-xen-i386/ks.cfg


  6. # Kickstart file automatically generated by anaconda.
  7. #Install OS instead of upgrade
  8. install
  9. #Use text mode install
  10. text
  11. #Use CDROM installation media
  12. cdrom
  13. lang en_US.UTF-8
  14. keyboard us

  15. #Skip the X Configuration
  16. skipx
  17. #Use network installation
  18. url --url=http://192.168.9.230/cobbler/ks_mirror/kerryOS-1.0-i386
  19. #Network information
  20. #network --device eth0 --bootproto static --ip 192.168.9.226 --netmask 255.255.255.0 --gateway 192.168.9.1 --nameserver 192.168.9.1 --noipv6 --onboot=yes --hostname kerry-web-001
  21. network --device eth0 --bootproto dhcp --noipv6 --hostname kerry-web-001
  22. #root -- 1q2w3e
  23. rootpw --iscrypted $1$n07CbCot$GP.VBeICPHj.QkJb5Y2C2.
  24. firewall --disabled
  25. #System authorization information
  26. authconfig --enableshadow --enablemd5
  27. selinux --disabled
  28. timezone --utc Asia/Shanghai
  29. #System bootloader configuration
  30. bootloader --location=mbr
  31. #Clear the Master Boot Record
  32. zerombr yes

  33. # Set the Mouse
  34. mouse generic3ps/2

  35. # The following is the partition information you requested
  36. # Note that any partitions you deleted are not expressed
  37. # here so unless you clear all partitions first, this is
  38. # not guaranteed to work

  39. #Partition clearing information
  40. clearpart --all --initlabel
  41. part /boot --fstype ext3 --size=200 --asprimary
  42. part / --fstype ext3 --size=10000
  43. part swap --size=2048
  44. part /data --fstype ext3 --size=1 --grow

  45. #--- Reboot the host after installation is done
  46. reboot

  47. %packages
  48. %packages
  49. @base
  50. @core
  51. @development-libs
  52. @development-tools
  53. @editors
  54. @text-internet
  55. keyutils
  56. trousers
  57. fipscheck
  58. device-mapper-multipath
  59. imake

  60. %post --nochroot
  61. # Mount CDROM
  62. mkdir -p /mnt/cdrom
  63. mount -r -t iso9660 /tmp/cdrom /mnt/cdrom
  64. cp /mnt/cdrom/ipmod /mnt/sysimage/root/ipmod > /dev/null

  65. umount /mnt/cdrom

  66. %post
  67. #vim syntax on
  68. sed -i "8 s/^/alias vi='vim'/" /root/.bashrc 2>/dev/null
  69. echo 'syntax on' > /root/.vimrc 2>/dev/null

  70. #init_ssh
  71. ssh_cf="/etc/ssh/sshd_config"
  72. sed -i -e '74 s/^/#/' -i -e '76 s/^/#/' $ssh_cf
  73. sed -i "s/#UseDNS yes/UseDNS no/" $ssh_cf

  74. #client
  75. sed -i -e '44 s/^/#/' -i -e '48 s/^/#/' $ssh_cf

  76. # Remove the ISO File translation files
  77. find / -name TRANS.TBL -exec rm {} \; /dev/null 2>/dev/null

  78. # Remove some unneeded services
  79. #--------------------------------------------------------------------------------
  80. cat << EOF
  81. +--------------------------------------------------------------+
  82. | === Welcome to Tunoff services === |
  83. +--------------------------------------------------------------+
  84. EOF
  85. #---------------------------------------------------------------------------------
  86. for i in `ls /etc/rc3.d/S*`
  87. do
  88.         CURSRV=`echo $i|cut -c 15-`
  89. echo $CURSRV
  90. case $CURSRV in
  91.                 crond | irqbalance | microcode_ctl | network | random | sshd | syslog | local )
  92.         echo "Base services, Skip!"
  93.         ;;
  94.         *)
  95.                 echo "change $CURSRV to off"
  96.                 chkconfig --level 235 $CURSRV off
  97.                 service $CURSRV stop
  98.         ;;
  99. esac
  100. done

  101. # file descriptors
  102. ulimit -HSn 65535

  103. echo -ne "
  104. * soft nofile 65536
  105. * hard nofile 65536
  106. " >>/etc/security/limits.conf

  107. #set sysctl
  108. true > /etc/sysctl.conf
  109. cat >> /etc/sysctl.conf << EOF
  110. net.ipv4.ip_forward = 0
  111. net.ipv4.conf.default.rp_filter = 1
  112. net.ipv4.conf.default.accept_source_route = 0
  113. kernel.sysrq = 0
  114. kernel.core_uses_pid = 1
  115. net.ipv4.tcp_syncookies = 1
  116. kernel.msgmnb = 65536
  117. kernel.msgmax = 65536
  118. kernel.shmmax = 68719476736
  119. kernel.shmall = 4294967296
  120. net.ipv4.tcp_max_tw_buckets = 6000
  121. net.ipv4.tcp_sack = 1
  122. net.ipv4.tcp_window_scaling = 1
  123. net.ipv4.tcp_rmem = 4096 87380 4194304
  124. net.ipv4.tcp_wmem = 4096 16384 4194304
  125. net.core.wmem_default = 8388608
  126. net.core.rmem_default = 8388608
  127. net.core.rmem_max = 16777216
  128. net.core.wmem_max = 16777216
  129. net.core.netdev_max_backlog = 262144
  130. net.core.somaxconn = 262144
  131. net.ipv4.tcp_max_orphans = 3276800
  132. net.ipv4.tcp_max_syn_backlog = 262144
  133. net.ipv4.tcp_timestamps = 0
  134. net.ipv4.tcp_synack_retries = 1
  135. net.ipv4.tcp_syn_retries = 1
  136. net.ipv4.tcp_tw_recycle = 1
  137. net.ipv4.tcp_tw_reuse = 1
  138. net.ipv4.tcp_mem = 94500000 915000000 927000000
  139. net.ipv4.tcp_fin_timeout = 1
  140. net.ipv4.tcp_keepalive_time = 1200
  141. net.ipv4.ip_local_port_range = 1024 65535
  142. EOF

  143. /sbin/sysctl -p

  144. #close ctrl+alt+del
  145. sed -i "s/ca::ctrlaltdel:\/sbin\/shutdown -t3 -r now/#ca::ctrlaltdel:\/sbin\/shutdown -t3 -r now/" /etc/inittab

  146. #set purview
  147. chmod 600 /etc/passwd
  148. chmod 600 /etc/shadow
  149. chmod 600 /etc/group
  150. chmod 600 /etc/gshadow
復(fù)制代碼
6、生成并同步所有配置
  1. cobbler sync
復(fù)制代碼
7、啟動(dòng)相關(guān)的服務(wù)
  1. /etc/init.d/httpd start
  2. /etc/init.d/xinetd start
  3. /etc/init.d/dhcpd start
  4. /etc/init.d/cobblerd start
復(fù)制代碼
  1. chkconfig --level 35 httpd on
  2. chkconfig --level 35 xinetd on
  3. chkconfig --level 35 dhcpd on
  4. chkconfig --level 35 cobblerd on
復(fù)制代碼
#記得關(guān)閉防火墻
  1. /etc/init.d/iptables stop
  2. chkconfig --level 35 iptables off
復(fù)制代碼
8、相關(guān)配置文件及目錄
  1. cobbler相關(guān)配置文件: /etc/cobbler
  2. cobbler數(shù)據(jù)存儲(chǔ)目錄: /var/www/cobbler
  3. dhcp配置文件: /etc/dhcpd.conf
  4. dhcp租期緩存文件: /var/lib/dhcpd/dhcpd.leases
  5. pxe配置文件: /tftpboot/pxelinux.cfg/default
  6. ks模板文件: /var/lib/cobbler/kickstarts_*.ks
復(fù)制代碼
9、客戶端通過PXE安裝系統(tǒng)
啟動(dòng)另一臺(tái)新服務(wù)器,通過 PXE 啟動(dòng)進(jìn)入,提示"boot:"時(shí)輸入"menu"即可進(jìn)入藍(lán)色的 Cobbler 安裝界面,選擇安裝項(xiàng),自動(dòng)完成系統(tǒng)安裝。

10、重裝系統(tǒng)
CentOS 5.5默認(rèn)的Repository里找不到koan,先安裝rpmforce這個(gè)Repository
  1. cd /opt
  2. wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
  3. rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
復(fù)制代碼
#在要重裝的機(jī)器安裝koan
  1. yum -y install koan  
復(fù)制代碼
#查看cobbler服務(wù)器有哪些安裝盤
  1. koan --list-profiles --server=192.168.9.230
復(fù)制代碼
#選擇要重裝的系統(tǒng)并重啟
  1. koan --replace-self --server=192.168.9.230 --profile=kerryOS-1.0-i386
  2. reboot  
復(fù)制代碼
11、服務(wù)控制腳本
  1. vi /etc/init.d/cobbler_all

  2. #!/bin/sh

  3. case $1 in
  4.         start)
  5.                /etc/init.d/httpd start
  6.                /etc/init.d/xinetd start
  7.                /etc/init.d/dhcpd start
  8.                /etc/init.d/cobblerd start
  9.                 ;;
  10.         stop)
  11.                /etc/init.d/httpd stop
  12.                /etc/init.d/xinetd stop
  13.                /etc/init.d/dhcpd stop
  14.                /etc/init.d/cobblerd stop
  15.                 ;;
  16.         status)
  17.                 /etc/init.d/httpd status
  18.                 /etc/init.d/xinetd status
  19.                 /etc/init.d/dhcpd status
  20.                 /etc/init.d/cobblerd status
  21.                 ;;     
  22.          sync)
  23.                 cobbler sync
  24.                 ;;                          
  25.         *)
  26.                 echo "Input error,please in put 'start|stop|status|sync'!";
  27.                 exit 2>&1 >/dev/null &
  28.                 ;;
  29.         esac
復(fù)制代碼
  1. chmod +x /etc/init.d/cobbler_all
復(fù)制代碼

作者: king_819    時(shí)間: 2011-11-16 16:19
關(guān)于“搭建linux RIS服務(wù)器批量布署windows 2003系統(tǒng)”的文章請見
http://72891.cn/thread-3619039-1-1.html
作者: king_819    時(shí)間: 2011-11-16 16:24
微軟的ris 也是一pxe為基礎(chǔ)的 linux 和windows的 就是 pxe的基礎(chǔ)文件有區(qū)別的 而windows 采用ris ...
kns1024wh 發(fā)表于 2011-11-16 16:13


貼一段關(guān)于PXE的說明

PXE(preboot execute environment)是由Intel公司開發(fā)的最新技術(shù),工作于Client/Server的網(wǎng)絡(luò)模式,支持工作站通過網(wǎng)絡(luò)從遠(yuǎn)端服務(wù)器下載映像,并由此支持來自網(wǎng)絡(luò)的操作系統(tǒng)的啟動(dòng)過程,其啟動(dòng)過程中,終端要求服務(wù)器分配IP地址,再用TFTP(trivial file transfer protocol)或MTETP(multicast trivial file transfer protocol)協(xié)議下載一個(gè)啟動(dòng)軟件包到本機(jī)內(nèi)存中并執(zhí)行,由這個(gè)啟動(dòng)軟件包完成終端基本軟件設(shè)置,從而引導(dǎo)預(yù)先安裝在服務(wù)器中的終端操作系統(tǒng)
作者: kns1024wh    時(shí)間: 2011-11-16 16:35
本帖最后由 kns1024wh 于 2011-11-16 16:37 編輯
貼一段關(guān)于PXE的說明

PXE(preboot execute environment)是由Intel公司開發(fā)的最新技術(shù),工作于Client/ ...
king_819 發(fā)表于 2011-11-16 16:24


轉(zhuǎn)一個(gè)老外的文章
  1. RIS for Linux - Boot winpe from the net / Ris Windows Installation

  2. A new pdf guide written from scratch it's available on the main page

  3. This document describes how to setup an opensource (Linux based) alternative to windows ris
  4. You can also use this stuff to install windows from the net

  5. Required software:

  6.     A Linux box - I prefer debian but other distro are also ok
  7.     Python - I'm using version 2.3 but versions >= 2.1 should be ok
  8.     dchp server - Version 3 needed
  9.     atftpd or hpa tftp - a tftp server
  10.     samba - You need version 3, since version 2.x misses some stuff
  11.     PXELinux - Not strictly needed but useful to make a menu, it's a good tool to use most of pxe features.

  12. Required Stuff:

  13.     ris-linux-0.4.tar.gz - All of my stuff
  14.     startrom.n12, SETUPLDR.BIN, BOOTFONT.BIN (optional) and ntdetect.com from windows xp installation directory (you must uncompress _ files)
  15.     [optional] pxelinux 3.07, modified version to avoid vmware pxe bug

  16. ris-linux contains following files:

  17.     binlsrv.py - Binl server for linux, it also works on windows since it's written in python
  18.     decode.py - Decodes Binl packets
  19.     infparser.py - A python script to build drivers database for binlsrv.py, it analyzes the inf directory
  20.     fixloader.py - SETUPLDR.BIN to ntldr converter
  21.     modldr.py - A tool used for client files modifications
  22.     patches/atftpd-filecase.diff - A patch for aftpd to permit case insensitive file lookups
  23.     patches/tftp-hpa-filecase.diff - A patch for hpa-tftp to permit case insensitive file lookups
  24.     fixup-repository.sh - Shell script to fix case of some files needed by the client via tftp
  25.     winnt.sif - A base winnt.sif file to start windows pe from network
  26.     winnt-ris.sif - A base winnt.sif file if you want to install windows from network

  27. TFTP Server

  28. Download atftpd apply the patch, compile and install it, you can configure it using inetd, by adding the following line:

  29. tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

  30. If you are using hpa tftp server apply the respective patch and recompile it. The author suggested me to run hpa tftp server standalone without using inetd, because inetd support is broken and hpa tftp can directly handle tcpwrappers.

  31. Please note that filecase lookup doesn't work (at least for me) when having links in the path, I suppose this is a security measure, or maybe the linked path should be in the chroot. Anyway this is not related to my lookup patch, if you are using hpa ftpd you should known how it works :)
  32. DHCP: bootp

  33. Assuming the tftpd and dhcp/bootp directory is /tftpboot, we need to have following files:

  34.     pxelinux.0 (part of syslinux/pxelinux)
  35.     pxelinux.cfg/default pxelinux default configuration
  36.     startrom.0 - rename startrom.n12 in startrom.0
  37.     winnt.sif - use the one in my archive
  38.     SETUPLDR.BIN - rename it to ntldr and use fixloader.py ntldr
  39.     ntdetect.com from windows xp installation directory
  40.     BOOTFONT.BIN - OPTIONAL - some versions don't have it (I think it's related to locale fonts)

  41. All files should be in the root of tftpd directory.
  42. Take care of case since files must have exactly the case used in this document
  43. pxelinux.cfg/default is a standard syslinux file you can use this simple one:

  44. TIMEOUT 0
  45. PROMPT 1

  46. label xpe
  47.     kernel startrom.0

  48. DHCP Server configuration

  49. Edit dhcp server configuration, in my distro is /etc/dhcp3/dhcpd.conf
  50. Configure the server this way:

  51. subnet 192.168.129.0 netmask 255.255.255.0
  52. {
  53.   range dynamic-bootp 192.168.129.100 192.168.129.110;
  54.   default-lease-time 600;
  55.   max-lease-time 7200;
  56.   filename "pxelinux.0";
  57.   server-name "attila.of.war";
  58.   next-server attila.of.war;
  59. }

  60. Replace attila.of.war with your dhcp server name, also use startrom.0 instead of pxelinux.0 if you don't want to use pxelinux.
  61. Samba configuration

  62. Make your build without iso and copy the contents of pebldr directory in a suitable place, a good choice is to name the directory ris and rename pebldr folder to winpe.
  63. The directory structure should be ris/winpe/i386..., also you need to put a symbolic link in /tftpboot pointing to winpe directory. If your tftp server doesn't allow symbolic links you should put the directory on the top of your tftp server root.

  64. An example configuration for samba:

  65. [REMINST]
  66.      path = /mnt/disk/ris
  67.      browsable = true
  68.      read only = No
  69.      guest ok = Yes

  70. You must set null passwords = true in smb.conf.

  71. You also need to modify server name and path in SetupSourceDevice option of winnt.sif file.

  72. Edit the path in fixup-repository.sh and launch it to fix case of needed files.
  73. Note: you don't need to fix names if you are using my new atftpd patch.
  74. Binl Server

  75. First you need to build device driver cache using infparser.py, e.g. infparser.py /mnt/disk/ris/winpe/i386/inf, this will create devlist.cache file that must be in same directory of binlsrv.py.
  76. Now you can launch binlsrv.py, it will load the driver cache and will reply to client requests.

  77. ./binlsrv.py
  78. Succesfully loaded 662 devices
  79. Binlserver started...

  80. Then start the client and boot from network, at pxelinux prompt enter xpe, the client will start and if all is ok binlsrv.py should receive a driver request:

  81. Recv NCQ len = 48
  82. NCQ Driver request
  83. [R] Vid: 0x1022
  84. [R] Pid: 0x2000
  85. [R] rev_u1 = 0x2
  86. [R] rev_u2 = 0x0
  87. [R] rev_u3 = 0x0
  88. [R] rev    = 0x10
  89. [R] rev2   = 0x88
  90. [R] subsys = 0x20001022
  91. Checking PCI\VEN_1022&DEV_2000&SUB_20001022
  92. Checking PCI\VEN_1022&DEV_2000
  93. Found PCI\VEN_1022&DEV_2000 in netamd2.inf
  94. [S] Packet len = 0xc4 (196)
  95. [S] Result code: 0x0
  96. [S] type: 0x2
  97. [S] base offset = 0x24 (36)
  98. [S] drv_off = 0x50 (80)
  99. [S] srv_off: 0x6a (106) -> 98 from start
  100. [S] plen: 0x56 (86)
  101. [S] p_off: 0x76 (118) -> 110 from start
  102. [S] hid: PCI\VEN_1022&DEV_2000 - Len 0x15 (21)
  103. [S] drv: pcntpci5.sys - Len 0xc (12)
  104. [S] srv: PCnet - Len 0x5 (5)
  105. [S] Len data now -2 = 0x54 (84)
  106. [S] Description (REG_EXPAND_SZ [2]) = Scheda Ethernet PCI AMD PCNET Family
  107. [S] Characteristics (REG_SZ [1]) = 132
  108. [S] BusType (REG_SZ [1]) = 5
  109. [S] Total Params: 3

  110. Finally if xpe starts but tcpip network will not work, windows shares are ok, any solution?

  111. Windows RIS installation from the net
  112. If you want to use windows remote installation service you should use winnt-ris.sif and rename it to winnt.sif, you can setup both xpe from pxe and windows installation by renaming ntldr and winnt.sif and hex-editing the files, I'll add an howto soon for this. Also make sure you have files in the path specified in winnt.sif.

  113. Note: Right now windows installation from the net works only if bypassing all ris stuff, so you'll not able to use OSChooser.
  114. A detailed description about configuring this can be found here.

  115. Note: if your card doesn't support network boot you can use a floppy image made with Rom-O-Matic, part of Etherboot project. You need at least a version 5.3.8 image to support pxelinux, the etherboot-pci with all drivers doesn't compiles yet, you must wait some time. Select Floppy bootable ROM Image (.zdsk), default options are ok. Write it with RawriteWin from windows or using cat image.zdsk > /dev/fd0 from Linux.
  116. There is also a tool shipped with Windows Server named rbfg.exe that makes similar floppy images but it doesn't support all cards supported by etherboot.

  117. I've made a driver with support for most common nics, compiled drivers: 3c90x 3c595 eepro100 e1000 ns8390 rtl8139 tg3 tulip pcnet32 via-rhine forcedeth sis900 etherboot.zdsk
  118. Glossary

  119. Ris: Remote Installation System

  120. Binl: Boot Information Negotiation Layer

  121. PXE: Pre-Boot Execution Environment

  122. DHCP: Dynamic Host Configuration Protocol

  123. bootp: Bootstrap Protocol

  124. tftp: Trivial File Transfer Protocol
  125. ChangeLog

  126. binlsrv.py:
  127. 0.9 - Modified a bit the engine, now it supports amd64 entries but it can work differently
  128. 0.8 - Server options, more documentation, fixes on RQU packets
  129. 0.7 - Internal (not public)
  130. 0.6 - Added OFF packet
  131. 0.5 - Workaround for broken hosts file

  132. infparser.py:
  133. 0.8 - Display a warning instead of bombing for broken infs
  134. 0.7 - Fixed manifacturer.nt.5.1 problem
  135. 0.6 - Fixed problem with Altima inf
復(fù)制代碼

作者: king_819    時(shí)間: 2011-11-16 16:41
轉(zhuǎn)一個(gè)老外的文章
kns1024wh 發(fā)表于 2011-11-16 16:35



   直接用ris-autoinst,ris-autoinst是一個(gè)ris-linux的輔助工具包,執(zhí)行里面的安裝腳本,可以自動(dòng)安裝和配置pxelinux,dhcp,tftpd,samba,ris-linux服務(wù),一步到位,非常方便
作者: Shell_HAT    時(shí)間: 2011-11-16 16:52
如果需要在Windows上面管理Linux,機(jī)器不太多的情況下可以考慮SecureCRT,它可以錄制宏,也可以自己編寫VBS腳本:
  1. #$language = "VBScript"
  2. #$interface = "1.0"

  3. Sub main

  4.     Dim objFSO, objFile, objShell, strPath, strPwd, strPwdRoot
  5.     Set objFSO = CreateObject("Scripting.FileSystemObject")
  6.     Set objFile = objFSO.OpenTextFile("C:\SecureSRT\pwd.txt", 1)
  7.     strPwd = objFile.ReadLine
  8.     strPwdRoot = objFile.ReadLine

  9.     ' turn on synchronous mode so we don't miss any data
  10.     crt.Screen.Synchronous = True

  11.     crt.Screen.WaitForString "#"
  12.     crt.Screen.Send "ssh 192.168.175.5" & VbCr

  13.     crt.Screen.WaitForString "assword:"
  14.     crt.Screen.Send strPwd & VbCr

  15.     crt.Screen.WaitForString "$"
  16.     crt.Screen.Send "su - root" & VbCr

  17.     crt.Screen.WaitForString "assword:"
  18.     crt.Screen.Send strPwdRoot & VbCr

  19.     crt.Screen.WaitForString "#"
  20.     crt.Screen.Send "su - oracle" & VbCr & VbCr

  21.     crt.Screen.WaitForString ":>"
  22.     crt.Screen.Send "sqlplus testdb" & VbCr

  23.     crt.Screen.WaitForString "Enter password:"
  24.     crt.Screen.Send "testpass" & VbCr

  25.     ' turn off synchronous mode to restore normal input processing
  26.     crt.Screen.Synchronous = False

  27. End Sub
復(fù)制代碼

作者: king_819    時(shí)間: 2011-11-16 17:24
如果需要在Windows上面管理Linux,機(jī)器不太多的情況下可以考慮SecureCRT,它可以錄制宏,也可以自己編寫VBS ...
Shell_HAT 發(fā)表于 2011-11-16 16:52



    用SecureCRT管理linux是很方便了
作者: chenyx    時(shí)間: 2011-11-16 18:20
從事網(wǎng)游運(yùn)維的兄弟們應(yīng)該深有感觸,往往在開新服的時(shí)候需要大批量的布署新的服務(wù)器,Red Hat 最新發(fā)布了網(wǎng) ...
king_819 發(fā)表于 2011-11-16 16:16



    這個(gè)不錯(cuò),收藏之
作者: chenyx    時(shí)間: 2011-11-16 18:22
轉(zhuǎn)一個(gè)老外的文章
kns1024wh 發(fā)表于 2011-11-16 16:35



    這個(gè)文章我看過,試驗(yàn)沒成功,放棄了.可能是我的windows版本有問題吧
作者: chenyx    時(shí)間: 2011-11-16 18:23
如果需要在Windows上面管理Linux,機(jī)器不太多的情況下可以考慮SecureCRT,它可以錄制宏,也可以自己編寫VBS ...
Shell_HAT 發(fā)表于 2011-11-16 16:52



    SecureCrt用的不多,平常都是用putty+winscp管理linux,小巧方便.看來得研究下SCTR了.
作者: chenyx    時(shí)間: 2011-11-16 18:24
1,批量安裝容易搞定
2,批量優(yōu)化和部署,很是頭疼,修改一個(gè)服務(wù)的配置文件,需要挨個(gè)修改,如果部署一個(gè)定時(shí)任 ...
ning_lianjie 發(fā)表于 2011-11-16 10:58



    crontab任務(wù)可以寫文件,用crontab來加載的
作者: kns1024wh    時(shí)間: 2011-11-16 19:59
這個(gè)文章我看過,試驗(yàn)沒成功,放棄了.可能是我的windows版本有問題吧
chenyx 發(fā)表于 2011-11-16 18:22



    多折騰 有計(jì)劃 有目標(biāo) 做事情就可以的
作者: kns1024wh    時(shí)間: 2011-11-16 20:00
直接用ris-autoinst,ris-autoinst是一個(gè)ris-linux的輔助工具包,執(zhí)行里面的安裝腳本,可以自動(dòng)安 ...
king_819 發(fā)表于 2011-11-16 16:41



    這個(gè)是必須用到的
作者: chenyx    時(shí)間: 2011-11-16 21:03
回復(fù) 73# kns1024wh


    同意,linux就得多"折騰",熟悉了就習(xí)慣了
作者: king_819    時(shí)間: 2011-11-16 21:37
windows2003能過linux-ris 在批量安裝的時(shí)候,分區(qū)是比較糾結(jié)的,不知各位有沒有好的解決辦法!
作者: 賀蘭云天    時(shí)間: 2011-11-17 10:02
關(guān)于機(jī)器批量操作,我以前在CU搞了個(gè)cme_scanner,是用C封裝的多線程調(diào)用ssh的expect腳本,效率不錯(cuò)。3000臺(tái)機(jī)器執(zhí)行普通命令半分鐘結(jié)束。
今年上半年開發(fā)了一個(gè)cmtkit,基于ICE做的,包含客戶端和服務(wù)端,C++代碼開發(fā)的。
支持對單臺(tái)機(jī)器,批量機(jī)器執(zhí)行以下操作:執(zhí)行命令,上傳文件,下載文件。支持并發(fā)多線程。
感興趣的同學(xué)可以去架構(gòu)版看看相關(guān)帖子,下載鏈接,用法,都有。
這個(gè)工具在今年的架構(gòu)師大會(huì)上做了介紹,歡迎從事運(yùn)維的的同仁測試使用喔,目前已經(jīng)有一些運(yùn)維的朋友在使用了。

另外關(guān)于配置文件管理,機(jī)器狀態(tài)監(jiān)控,基于cmtkit之上也封裝了一套命令集合。
能夠?qū)崿F(xiàn)對主機(jī)群組的配置文件修改,完整性維護(hù),軟件安裝,crontab任務(wù)定制等等工作
作者: 賀蘭云天    時(shí)間: 2011-11-17 10:05
介紹文章在這里:

最新版cmtkit(cmtools)發(fā)布··歡迎使用測試【2011-11-05】
http://72891.cn/thread-3615404-1-1.html

系統(tǒng)管理工具[cmserver-cmclient]第一版--請測試
http://72891.cn/thread-1882257-1-2.html

cmtools測試版發(fā)布(加強(qiáng)版cmclient-cmserver)--RPM安裝包
http://72891.cn/thread-2328768-1-1.html

下載地址在這里
http://jigang.bv2.mianfeidns.com/download.php
包含了cme_scanner和cmtkit兩個(gè)工具
作者: king_819    時(shí)間: 2011-11-17 10:55
介紹文章在這里:

最新版cmtkit(cmtools)發(fā)布··歡迎使用測試【2011-11-05】


系統(tǒng)管理工具[cmserve ...
賀蘭云天 發(fā)表于 2011-11-17 10:05



不錯(cuò)的分享,下載試用下
作者: expert1    時(shí)間: 2011-11-17 11:19
windows 2003/2008
MS有自帶的ris,此外,你可以搞網(wǎng)絡(luò)克隆,安裝好一臺(tái)03然后ghost備份以后,服務(wù)器配置都一致的情況下。搜下ghost企業(yè)版.

linux
kickstart足矣。

批量配置:
這個(gè)比較麻煩,機(jī)器上cfg文件完全相同的還沒見過,只能找個(gè)cfg替換了,寫腳本來搞。但最近貌似puppet很火,我不懂它如何實(shí)現(xiàn)的以下功能的,比如我有一堆mysql slave,那么my.cnf里肯定
ip不同,不知道puppet如何把這個(gè)ip替換成服務(wù)器的IP的?
貌似解決方案很多,但一勞永逸的太少了,寫腳本,服務(wù)器要是克隆出來的就好了,只要目錄不同,甚至大小寫不同,就會(huì)導(dǎo)致腳本失敗,這個(gè)靠你起初的規(guī)劃了。
puppet貌似模板很重要,ruby需要了解,否則。。。
作者: king_819    時(shí)間: 2011-11-17 11:46
windows 2003/2008
MS有自帶的ris,此外,你可以搞網(wǎng)絡(luò)克隆,安裝好一臺(tái)03然后ghost備份以后,服務(wù)器配置 ...
expert1 發(fā)表于 2011-11-17 11:19



   網(wǎng)刻問題比較多了,系統(tǒng)總會(huì)莫明其妙的問題,還得修改SID
作者: kns1024wh    時(shí)間: 2011-11-17 12:53
網(wǎng)刻問題比較多了,系統(tǒng)總會(huì)莫明其妙的問題,還得修改SID
king_819 發(fā)表于 2011-11-17 11:46



    SID 就是微軟的不同之處 要解決就是syspre 或者是 完全安裝的方式
作者: kns1024wh    時(shí)間: 2011-11-17 12:56
windows 2003/2008
MS有自帶的ris,此外,你可以搞網(wǎng)絡(luò)克隆,安裝好一臺(tái)03然后ghost備份以后,服務(wù)器配置 ...
批量配置:
這個(gè)比較麻煩,機(jī)器上cfg文件完全相同的還沒見過,只能找個(gè)cfg替換了,寫腳本來搞。但最近貌似puppet很火,我不懂它如何實(shí)現(xiàn)的以下功能的,比如我有一堆mysql slave,那么my.cnf里肯定
ip不同,不知道puppet如何把這個(gè)ip替換成服務(wù)器的IP的?
貌似解決方案很多,但一勞永逸的太少了,寫腳本,服務(wù)器要是克隆出來的就好了,只要目錄不同,甚至大小寫不同,就會(huì)導(dǎo)致腳本失敗,這個(gè)靠你起初的規(guī)劃了。
puppet貌似模板很重要,ruby需要了解,否則。。。
expert1 發(fā)表于 2011-11-17 11:19



    這個(gè)只要從軟硬件合理規(guī)劃才可以運(yùn)用合理,任何事情不要盲從
作者: king_819    時(shí)間: 2011-11-17 14:55
SID 就是微軟的不同之處 要解決就是syspre 或者是 完全安裝的方式
kns1024wh 發(fā)表于 2011-11-17 12:53



   為了穩(wěn)定最好還是全新安裝!
作者: daizhongxian    時(shí)間: 2011-11-18 12:38
本帖最后由 daizhongxian 于 2011-11-18 16:18 編輯

很久沒有這么好的帖子了  大家繼續(xù)分享
我們目前使用的僅限于pxe、except+shell
作者: king_819    時(shí)間: 2011-11-18 15:10
很久沒有這么好的帖子了  大家繼續(xù)分享
我們目前使用的僅限于pxe、execpt+shell
daizhongxian 發(fā)表于 2011-11-18 12:38



   隨著服務(wù)器數(shù)量的不斷增長,自動(dòng)化運(yùn)維將是不得不考慮的問題!
作者: kns1024wh    時(shí)間: 2011-11-18 15:28
隨著服務(wù)器數(shù)量的不斷增長,自動(dòng)化運(yùn)維將是不得不考慮的問題!
king_819 發(fā)表于 2011-11-18 15:10



    自動(dòng)化運(yùn)維是未來的一個(gè)發(fā)展的方向,google就是好榜樣 。

    說下具體點(diǎn)的自動(dòng)化運(yùn)維的話題。
  1.     假設(shè)一個(gè)環(huán)境:
  2.     1000臺(tái)的服務(wù)器,分布在全球的 20個(gè)機(jī)房(假定均勻分布),需要部署基于Hadoop二次開放的架構(gòu)應(yīng)用,采用的是Nsql。
復(fù)制代碼
上面是假定的一個(gè)環(huán)境,這樣的環(huán)境中 。來說說 批量安裝,批量部署,批量優(yōu)化等自動(dòng)化運(yùn)維的實(shí)現(xiàn)方式。



   針對上面的假定環(huán)境的運(yùn)維話題歡迎大家來討論提出有可以操作性的過程。

作者: kns1024wh    時(shí)間: 2011-11-18 15:31
回復(fù) 87# king_819


    自動(dòng)化運(yùn)維架構(gòu)尤其是管理架構(gòu) 采用什么方式管理各類腳本,那種語言適合實(shí)現(xiàn)何種腳本 都是很有實(shí)際的討論
作者: king_819    時(shí)間: 2011-11-18 16:21
自動(dòng)化運(yùn)維是未來的一個(gè)發(fā)展的方向,google就是好榜樣 。

    說下具體點(diǎn)的自動(dòng)化運(yùn)維的話題。 ...
kns1024wh 發(fā)表于 2011-11-18 15:28



   這個(gè)話題就有些大了,我想沒有多少人能有實(shí)際的經(jīng)驗(yàn),百湖兄分享下你的經(jīng)驗(yàn)。
作者: chenyx    時(shí)間: 2011-11-18 22:10
    假設(shè)一個(gè)環(huán)境:
    1000臺(tái)的服務(wù)器,分布在全球的 20個(gè)機(jī)房(假定均勻分布),需要部署基于Hadoop二次開放的架構(gòu)應(yīng)用,采用的是Nsql。

這個(gè)就太復(fù)雜了,還沒有接觸過.
不過,想谷歌這樣的,數(shù)據(jù)中心據(jù)說是集裝箱,一個(gè)集裝箱就是一個(gè)小型的"機(jī)房".
維護(hù)這么多的機(jī)器,通過互聯(lián)網(wǎng)實(shí)施遠(yuǎn)程運(yùn)維應(yīng)該是不現(xiàn)實(shí)的吧
作者: bbjmmj    時(shí)間: 2011-11-20 10:48
方法到是有,但是環(huán)境不一樣,具體的實(shí)施就會(huì)有很大的差別。
如果幾個(gè)人管理上千臺(tái)服務(wù)器,就不用考慮服務(wù)器上安裝硬盤的問題了。
用存儲(chǔ)陣列生成LUN,分給不同的服務(wù)器用,LUN拷貝用于生成每臺(tái)服務(wù)器的硬盤初始內(nèi)容,把一個(gè)做好系統(tǒng)的服務(wù)器關(guān)機(jī),然后復(fù)制它的LUN到其它LUN上。
對于網(wǎng)游一類的應(yīng)用,對硬盤存儲(chǔ)容量的要求會(huì)比較低,每個(gè)服務(wù)器上使用單獨(dú)的RAID顯然是不劃算的,集中的公共存儲(chǔ)是不二的選擇。
如果需要海量存儲(chǔ),就要考慮在服務(wù)器上裝硬盤了,裝好硬盤后要手工對硬盤進(jìn)行初始化的操作,如分區(qū)、建LVM等等,然后通過存儲(chǔ)陣列啟動(dòng)服務(wù)器,掛載服務(wù)器上的存儲(chǔ)。這個(gè)工作雖然不能完全自動(dòng)化,但是可以減少很多工作量。
使用公共存儲(chǔ)的好處是可以隨時(shí)更換服務(wù)器,如果業(yè)務(wù)量不增加的話,按照摩爾定律,每18個(gè)月可以減少一半的服務(wù)器,相應(yīng)的能耗、人工都可以按摩爾定律減少,運(yùn)營成本可以迅速壓縮。
建議存儲(chǔ)陣列從一開始就選擇固態(tài)盤,RAID和LUN的規(guī)劃一定要仔細(xì)仔細(xì)再仔細(xì),力求充分滿足未來的升級(jí)要求。

如果是幾十臺(tái)、上百臺(tái)的相對小規(guī)模的維護(hù),還是用移動(dòng)硬盤吧,ESATA的,USB的太慢了。
作者: bbjmmj    時(shí)間: 2011-11-20 10:52
系統(tǒng)規(guī)劃是個(gè)很仔細(xì)的工作,散熱、能耗、成本核算、未來成本變化模型、風(fēng)險(xiǎn)效益比、效益費(fèi)用比等等,各種因素都要充分考慮,算計(jì)到絞盡腦汁徹夜難眠都不算過分,因?yàn)檫@個(gè)初期的工作,直接關(guān)系到很多的金錢和勞動(dòng)。
作者: 961422690    時(shí)間: 2011-11-21 13:53
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽
作者: ning_lianjie    時(shí)間: 2011-11-21 18:12
回復(fù) 72# chenyx

能說的詳細(xì)一點(diǎn)嗎?沒看懂...
作者: chenyx    時(shí)間: 2011-11-21 18:16
回復(fù) 96# ning_lianjie


    我在cactiez的安裝光盤里面的ks.cfg見過寫一個(gè)文件,然后通過crontab來加到系統(tǒng)的crontab任務(wù)里面去.現(xiàn)在沒有環(huán)境,明天給你他的內(nèi)容
作者: ning_lianjie    時(shí)間: 2011-11-21 18:29
回復(fù) 97# chenyx


    好的,十分感謝
作者: king_819    時(shí)間: 2011-11-21 19:30
系統(tǒng)規(guī)劃是個(gè)很仔細(xì)的工作,散熱、能耗、成本核算、未來成本變化模型、風(fēng)險(xiǎn)效益比、效益費(fèi)用比等等,各種因 ...
bbjmmj 發(fā)表于 2011-11-20 10:52



一個(gè)架構(gòu)設(shè)計(jì)的是否成功,前期的規(guī)劃非常重要,性能、成本、安全、擴(kuò)展性、可管理性等等都是需要慎重考量的!
作者: king_819    時(shí)間: 2011-11-21 19:34
回復(fù)  ning_lianjie


    我在cactiez的安裝光盤里面的ks.cfg見過寫一個(gè)文件,然后通過crontab來加到系 ...
chenyx 發(fā)表于 2011-11-21 18:16



    ks.cfg可以加載很多內(nèi)容
作者: king_819    時(shí)間: 2011-11-21 19:40
一般來說在正規(guī)大型企業(yè)占據(jù)主要的地位的Unix主機(jī)服務(wù)器是IT基礎(chǔ)設(shè)施中最重要的核心部件。在日常運(yùn)維工作中 ...
motorocke6 發(fā)表于 2011-11-20 22:20



    基本的、重復(fù)性強(qiáng)的工作,還是交由自動(dòng)化工具來進(jìn)行,對于高風(fēng)險(xiǎn)的操作還是要慎重,盡可能的手動(dòng)操作,認(rèn)真核對
作者: king_819    時(shí)間: 2011-11-21 19:44
方法到是有,但是環(huán)境不一樣,具體的實(shí)施就會(huì)有很大的差別。
如果幾個(gè)人管理上千臺(tái)服務(wù)器,就不用考慮服務(wù) ...
bbjmmj 發(fā)表于 2011-11-20 10:48



    根據(jù)服務(wù)器的用途來選擇存儲(chǔ)方式,合理的規(guī)劃不僅對性能有顯著的提升還能降低成本




歡迎光臨 Chinaunix (http://72891.cn/) Powered by Discuz! X3.2