




已閱讀5頁,還剩76頁未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
資料收集于網(wǎng)絡(luò) 如有侵權(quán)請聯(lián)系網(wǎng)站 刪除 謝謝 ECstore企業(yè)版集群部署文檔2011.03目錄1 文檔歷史32 目的33 系統(tǒng)架構(gòu)圖43.1. 架構(gòu)圖43.2. 應(yīng)用部署圖53.3. 部署說明54 硬件65 網(wǎng)絡(luò)66 軟件76.1. 底層環(huán)境76.1.1. 時(shí)間同步76.1.2. web服務(wù)器組. 安裝nginx. php-fpm. 同步腳本. 遠(yuǎn)程命令236.1.3. KV數(shù)據(jù)庫服務(wù)器組. flare節(jié)點(diǎn)286.1.4. mysql數(shù)據(jù)庫服務(wù)器296.1.5. 圖片服務(wù)器40. nginx40. NFS4. 文件同步4. 自啟動(dòng)466.1.6. 搜索服務(wù)器466.2. 應(yīng)用部署496.2.1. 安裝496.2.2. 代碼更新506.2.3. 系統(tǒng)配置501 文檔歷史DateVersionDescriptionAuthor2011-030.5初始版本shopex2011-030.7結(jié)構(gòu)完善shopex2011-030.8mysql配置完善shopex2011-031.0補(bǔ)充完善shopex2011-031.1補(bǔ)充完善shopex2 目的此文檔為ECstore企業(yè)版服務(wù)器應(yīng)用部署方案。 完成底層環(huán)境架構(gòu) 搭建ECstore系統(tǒng)部署將為矩陣服務(wù)提供高可用服務(wù)器架構(gòu)。3 系統(tǒng)架構(gòu)圖3.1. 架構(gòu)圖3.2. 應(yīng)用部署圖3.3. 部署說明將應(yīng)用部署可以切分為以下幾個(gè)部分: web服務(wù)器組 varnish反向代理服務(wù)器組 MySQL數(shù)據(jù)庫服務(wù)器組 KV數(shù)據(jù)庫服務(wù)器組 Memcached服務(wù)器組 圖片服務(wù)器組 反向代理服務(wù)器 Sphinx搜索服務(wù)器組 備份服務(wù)器組下面就以上幾組應(yīng)用進(jìn)行相應(yīng)的說明: web服務(wù)器組 web服務(wù)器組為應(yīng)用提供web服務(wù),web服務(wù)器存放的是提供服務(wù)的源代碼。 web服務(wù)器通過A10負(fù)載均衡器分發(fā)調(diào)度相應(yīng)的應(yīng)用。 web服務(wù)器通過連接數(shù)據(jù)庫提供web服務(wù)。 每臺(tái)web服務(wù)器都存放的是服務(wù)代碼的副本,且保證部署文件一致性,又code push服務(wù)器提供分發(fā)和部署。 varnish反向代理服務(wù)器組 高效動(dòng)態(tài)頁緩存系統(tǒng)(未使用) MySQL數(shù)據(jù)庫服務(wù)器組 數(shù)據(jù)庫服務(wù)器組為MYSQL一主雙從模式,為用戶提供數(shù)據(jù)持久層服務(wù)。 KV數(shù)據(jù)庫服務(wù)器組 為ecstore提供key-value存儲(chǔ)服務(wù),采用Flare+Tokyo Cabinet Memcached服務(wù)器組 通過緩存mysql數(shù)據(jù)持久層數(shù)據(jù),減輕mysql的壓力,存儲(chǔ)mysql的數(shù)據(jù)。 圖片服務(wù)器組 圖片存儲(chǔ)服務(wù)器組為存儲(chǔ)為商品圖片,采用NFS+sersync方案 反向代理服務(wù)器 使用squid為圖片提供靜態(tài)文件緩存服務(wù)。 Sphinx搜索服務(wù)器組 為前臺(tái)搜索提供索引服務(wù) 備份服務(wù)器組 備份用戶數(shù)據(jù),數(shù)據(jù)包括mysql的切片備份,web應(yīng)用的服務(wù)器和Flare的冷備數(shù)據(jù)。4 硬件總共12臺(tái)服務(wù)器,詳情見下表:品牌型號(hào)規(guī)格數(shù)量DELL未知硬盤134G cpu 8核 內(nèi)存8G10DELL未知硬盤1T cpu 16核 內(nèi)存24G25 網(wǎng)絡(luò)ip列表內(nèi)網(wǎng)ip外網(wǎng)IP應(yīng)用說明OS主機(jī)名root帳號(hào)VIP5web服務(wù)器預(yù)留as5(64位)w018015.isvadminweb服務(wù)器as5(64位)w018002.isvadminweb服務(wù)器as5(64位)w018002.isvadminweb服務(wù)器as5(64位)w018003.isvadminweb服務(wù)器as5(64位)w018004.isvadmin圖片服務(wù)器as5(64位)w018005.isvadmin圖片服務(wù)器as5(64位)w018006.isvadminflare主as5(64位)w018007.isvadminflare從as5(64位)w018008.isvadmin備份服務(wù)器as5(64位)w018009.isvadmin0mysql從服務(wù)器as5(64位)w018010.isvadmin1mysql主服務(wù)器as5(64位)w018011.isvadmin2mysql從服務(wù)器as5(64位)w018012.isvadmin6 軟件6.1. 底層環(huán)境6.1.1. 時(shí)間同步加入crontabcront -e*/5 * * * * ntpdate /dev/null6.1.2. web服務(wù)器組機(jī)器ip: . 安裝nginx./configure -user=admin -group=admin -prefix=/home/admin/apps/nginx -with-http_stub_status_module -with-http_ssl_module -with-http_gzip_static_modulemake -j8主配置文件:/home/admin/apps/nginx/conf/nginx.confuser admin admin;worker_processes 4;error_log logs/nginx_error.log crit;worker_rlimit_nofile 65535;events use epoll; worker_connections 65535;http include mime.types; default_type application/octet-stream; server_names_hash_bucket_size 128; client_header_buffer_size 32k; large_client_header_buffers 4 32k; client_max_body_size 8m; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 0; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; fastcgi_buffer_size 64k; fastcgi_buffers 4 64k; fastcgi_busy_buffers_size 128k; fastcgi_temp_file_write_size 128k; gzip on; gzip_min_length 1k; gzip_buffers 4 8k; gzip_http_version 1.1; gzip_types text/plain application/x-javascript text/css application/xml; gzip_disable MSIE 1-6.; log_format access $remote_addr - $remote_user $time_local $request $status $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for; include site/*.conf;php fast cgi為了減少tcp連接,采用unix socket模式提供服務(wù),配置文件:/home/admin/apps/nginx/conf/php_fcgi.conf#fastcgi_pass :9000;fastcgi_pass unix:/tmp/php_fcgi.sock;fastcgi_param GATEWAY_INTERFACE CGI/1.1;fastcgi_param SERVER_SOFTWARE nginx;fastcgi_param QUERY_STRING $query_string;fastcgi_param REQUEST_METHOD $request_method;fastcgi_param CONTENT_TYPE $content_type;fastcgi_param CONTENT_LENGTH $content_length;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;fastcgi_param SCRIPT_NAME $fastcgi_script_name;fastcgi_param REQUEST_URI $request_uri;fastcgi_param DOCUMENT_URI $document_uri;fastcgi_param DOCUMENT_ROOT $document_root;fastcgi_param SERVER_PROTOCOL $server_protocol;fastcgi_param REMOTE_ADDR $remote_addr;fastcgi_param REMOTE_PORT $remote_port;fastcgi_param SERVER_ADDR $server_addr;fastcgi_param SERVER_PORT $server_port;fastcgi_param SERVER_NAME $server_name;# PHP only, required if PHP was built with -enable-force-cgi-redirectfastcgi_param REDIRECT_STATUS 200;pathinfo修正文件:/home/admin/apps/nginx/conf/pathinfo.confset $real_script_name $fastcgi_script_name;if ($fastcgi_script_name (.+?.php)(/.*) set $real_script_name $1;set $path_info $2;fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;fastcgi_param SCRIPT_NAME $real_script_name;fastcgi_param PATH_INFO $path_info;站點(diǎn)配置文件server listen 8080 default; server_name _ ; index index.html index.htm index.php; root /home/admin/; #rewrite #location / # if (!-e $request_filename) # rewrite /(.+.(html|htm|xml|shopadmin)$ /index.php/$1 last; # # error_page 403 /themes/tmall/403.html; error_page 404 /themes/tmall/404.html; error_page 500 /themes/tmall/500.html; error_page 502 /themes/tmall/502.html; error_page 503 /themes/tmall/503.html; location .*.php/? include php_fcgi.conf; include pathinfo.conf; location .*.(gif|jpg|jpeg|png|bmp|swf) expires 30d; location .*.(js|css) expires 1h; access_log /home/admin/apps/nginx/logs/chaoshi_tmall_com_access.log;. php-fpm預(yù)安裝包yum 安裝包yum install libiconv libmcrypt nmhash mcrypt freetype freetype-devel libjpeg-devel libtool-ltdl libtool-ltdl-devel libjpeg-devel libpng-devel libmcrypt libmcrypt-devel -y加密庫yum install libmcrypt編譯tar zxvf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8/./configuremakemake install/sbin/ldconfigcd libltdl/./configure -enable-ltdl-installmakemake installcd ././ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.laln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.soln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8hash函數(shù)庫yumyum install mhash編譯tar zxvf mhash-.tar.gz cd mhash-./configure makemake installln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.aln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.laln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.soln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1cd .加密程序yumyum mcrypt編譯tar zxvf mcrypt-2.6.8.tar.gzcd mcrypt-2.6.8/sbin/ldconfig./configuremakemake installcd ./異步事件庫yumyum install libevent.x86_64 libevent-devel.x86_64編譯MySQL庫yumyum install mysql.x86_64 mysql-devel.x86_64給mysqlclient庫建立一個(gè)符號(hào)鏈接ln -sv /usr/lib64/mysql/libmysqlclient.so /usr/lib/libmysqlclient.so編譯安裝phptar xzvf php-5.2.13.tar.gzgzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.10 -p1cd php-5.2.13./configure -prefix=/home/admin/apps/php -with-config-file-path=/home/admin/apps/php -with-gd -enable-gd-native-ttf -with-mysql=/home/mysql -with-iconv-dir -with-freetype-dir -with-png-dir -with-zlib -with-libxml-dir -enable-xml -disable-debug -disable-rpath -enable-discard-path -enable-safe-mode -enable-bcmath -enable-shmop -enable-sysvsem -enable-inline-optimization -with-curl -with-curlwrappers -enable-mbregex -enable-fastcgi -enable-fpm -with-iconv=/usr/local -enable-force-cgi-redirect -enable-mbstring make ZEND_EXTRA_LIBS=-liconvmake installcp php.ini-dist /etc/php.ini編譯安裝PHP5擴(kuò)展模塊1)memcache客戶端tar zxvf memcache-2.2.5.tgzcd memcache-2.2.5/home/admin/php/bin/phpize./configure -with-php-config=/home/admin/php/bin/php-configmakemake installcd ./2)加速器eacceleratortar jxvf eaccelerator-.tar.bz2cd eaccelerator-/usr/local/webserver/php/bin/phpize./configure -enable-eaccelerator=shared -with-php-config=/usr/local/php/bin/php-configmakemake installcd ./3) PDOtar zxvf PDO_MYSQL-1.0.2.tgzcd PDO_MYSQL-1.0.2/usr/local/webserver/php/bin/phpize./configure -with-php-config=/usr/local/php/bin/php-config -with-pdo-mysql=/usr/local/mysqlmakemake installcd ./4) ImageMagicktar zxvf ImageMagick.tar.gzcd ImageMagick-6.5.1-2/./configuremakemake installcd ./tar zxvf imagick-2.2.2.tgzcd imagick-2.2.2/usr/local/php/bin/phpize./configure -with-php-config=/usr/local/php/bin/php-configmakemake installcd ./5) sphinxwget /downloads/sphinx-0.9.9.tar.gz安裝libsphinxclient: 提取sphinx源碼包api目錄中的libsphinxclientvim sphinxclient.cset nu找到1216行 static void sock_close ( int sock )改為void sock_close ( int sock )./configure -prefix=/usr/local/libsphinxclientmake & make install/home/admin/apps/php/bin/pecl install sphinxphp.ini添加:sphinxextension=sphinx.so6) scwswget /scws/down/scws-1.1.3.tar.bz2wget /scws/down/scws-dict-chs-utf8.tar.bz2tar xjvf scws-1.1.3.tar.bz2cd scws-1.1.3./configure -prefix=/home/admin/apps/scwsmakemake installtar xjvf scws-dict-chs-utf8.tar.bz2 -C /home/admin/apps/scws/etccd /opt/shopex/scws-1.1.3/phpext/home/admin/apps/php/bin/phpize./configure -with-scws=/home/admin/apps/scws -with-php-config=/home/admin/apps/php/bin/php-configmakemake install添加php.iniscwsextension=scws.soscws.default.charset = utf-8scws.default.fpath = /home/admin/apps/scws/etcphp-fpm配置文件#vim /home/admin/apps/php/etc/php-fpm.conf All relative paths in this config are relative to phps install prefix Pid file /home/admin/apps/php/logs/php-fpm.pid Error log file /home/admin/apps/php/logs/php-fpm.log Log level error When this amount of php processes exited with SIGSEGV or SIGBUS . 30 . in a less than this interval of time, a graceful restart will be initiated. Useful to work around accidental curruptions in accelerators shared memory. 1m Time limit on waiting childs reaction on signals from master 10s Set to no to debug fpm yes Name of pool. Used in logs and stats. default Address to accept fastcgi requests on. Valid syntax is ip.ad.re.ss:port or just port or /path/to/unix/socket !- :9000 /- /tmp/php_fcgi.sock Set listen(2) backlog -1 Set permissions for unix socket, if one used. In Linux read/write permissions must be set in order to allow connections from web server. Many BSD-derrived systems allow connections regardless of permissions. 0666 Additional php.ini defines, specific to this pool of workers. !- /usr/sbin/sendmail -t -i - 1 Unix user of processes !- admin- Unix group of processes !- admin - Process manager settings Sets style of controling worker process count. Valid values are static and apache-like static Sets the limit on the number of simultaneous requests that will be served. Equivalent to Apache MaxClients directive. Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi Used with any pm_style. 300 Settings group for apache-like pm style Sets the number of server processes created on startup. Used only when apache-like pm_style is selected 20 Sets the desired minimum number of idle server processes. Used only when apache-like pm_style is selected 5 Sets the desired maximum number of idle server processes. Used only when apache-like pm_style is selected 35 The timeout (in seconds) for serving a single request after which the worker process will be terminated Should be used when max_execution_time ini option does not stop script execution for some reason 0s means off 300s The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file 0s means off 5s The log file for slow requests /home/admin/apps/php/logs/php-slow.log Set open file desc rlimit 65532 Set max core size rlimit 0 Chroot to this directory at the start, absolute path Chdir to this directory at the start, absolute path Redirect workers stdout and stderr into main error log. If not set, they will be redirected to /dev/null, according to FastCGI specs yes How much requests each process should execute before respawn. Useful to work around memory leaks in 3rd party libraries. For endless request processing please specify 0 Equivalent to PHP_FCGI_MAX_REQUESTS 1024 Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. Equivalent to FCGI_WEB_SERVER_ADDRS env
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024-2025學(xué)年泉州紡織服裝職業(yè)學(xué)院單招《英語》試題預(yù)測試卷及完整答案詳解【有一套】
- 五年大專兒科護(hù)理緒論
- 關(guān)務(wù)與外貿(mào)服務(wù)專業(yè)教學(xué)標(biāo)準(zhǔn)(高等職業(yè)教育??疲?025修訂
- 化妝培訓(xùn)課件素材
- 煤礦變電工培訓(xùn)課件
- 胃陰虧虛用藥護(hù)理
- 品質(zhì)課程培訓(xùn)課件下載
- 胃癌內(nèi)科護(hù)理查房
- 中班幼兒剩餐問題健康解決方案
- 腫瘤患者的康復(fù)與營養(yǎng)
- 基于MATLAB的控制系統(tǒng)仿真及應(yīng)用-第5章-基于MATLABSimulink的控制系統(tǒng)建模與仿真課件
- 一二次深度融合成套柱上斷路器匯報(bào)課件
- 解凍記錄表(標(biāo)準(zhǔn)模版)
- 初中數(shù)學(xué)北師大八年級(jí)下冊(2023年修訂) 因式分解岷陽王冬雪提公因式法教學(xué)設(shè)計(jì)
- 金屬非金屬礦山安全規(guī)程
- 生活飲用水游離余氯方法驗(yàn)證報(bào)告
- DB32∕T 186-2015 建筑消防設(shè)施檢測技術(shù)規(guī)程
- C-TPAT反恐知識(shí)培訓(xùn)ppt課件
- 巡檢培訓(xùn)課件.ppt
- 二代征信系統(tǒng)數(shù)據(jù)采集規(guī)范釋義
- 軸承基礎(chǔ)知識(shí)PPT通用課件
評論
0/150
提交評論