<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
永中檔案線上轉換預覽服務 是永中軟體股份有限公司基於十多年核心技術積累、面向移動互聯領域推出的 一款檔案處理軟體。永中採用自主可控核心技術,具備快速技術和服務響應能力,把檔案原樣輸出為 HTML,圖片等,即點即得、無需下載、保護檔案隱私,快速高效,輕鬆實現檔案線上安全閱讀。
主機 | ip | 作業系統 | 軟體 | 埠 | vip |
---|---|---|---|---|---|
nginx01 | 192.168.56.101 | Centos7.6 | nginx keepalived | 80 | 192.168.56.200 |
nginx02 | 192.168.56.106 | Centos7.6 | nginx keepalived | 80 | 192.168.56.201 |
fcs01 | 192.168.56.101 | Centos7.6 | tomcat | 8080 | |
fcs02 | 192.168.56.106 | Centos7.6 | tomcat | 8080 | |
共用儲存 | 192.168.56.108 | Centos7.6 | nfs | ||
快取 | 192.168.56.108 | Centos7.6 | redis | 6379 | |
內部DNS | 192.168.56.108 | Centos7.6 | bind | 53 |
部署伺服器:192.168.56.108
/etc/redis.conf
# 監聽地址 bind 0.0.0.0 # 認證密碼 requirepass yozosoft
systemctl enable redis --now && systemctl status redis
192.168.56.108(伺服器端)
# 建立儲存目錄 mkdir -p /opt/yozo/data # 修改許可權 chown -R nfsnobody.nfsnobody /opt/yozo/data # 修改組態檔 vim /etc/exports /opt/yozo/data 192.168.56.0/24(rw,sync,all_squash)
192.168.56.101/192.168.56.106(使用者端)
# 建立掛載點 mkdir -p /opt/yozo/data # 掛載nfs共用目錄 mount -t nfs 192.168.56.108:/opt/yozo/data /opt/yozo/data
systemctl enable rpcbind nfs --now && systemctl status rpcbind nfs
部署伺服器:
192.168.56.101(fcsserver01)
192.168.56.106(fcsserver02)
以tomcat為中介軟體,本次實驗fcs安裝目錄
/opt/yozo/fcsserver/webapps/fcsserver,/opt/yozo/fcsserver為解壓後的tomcat
部署專案包
mkdir opt/yozo/fcsserver/webapps/fcsserver -p unzip fcscloud.war -d opt/yozo/fcsserver/webapps/fcsserver
修改fcsserver組態檔
# /opt/yozo/fcsserver/webapps/fcsserver/WEB-INF/classes/config.properties inputDir=/opt/yozo/data/fcsdata/input # 必須指定掛載共用儲存目錄的 outputDir=/opt/yozo/data/fcsdata/output # 如果不提供域名,就只能設定其中一個vip;如果設定為域名,則快取後,通過vip和fcsserver的ip將不能存取轉換的快取檔案 viewDomain=http://www.fcsserver.com/fcsserver/
# /opt/yozo/fcsserver/webapps/fcsserver/WEB-INF/classes/application.yml cache: #採用哪種快取資料方式 type: redis #local,redis,mysql(local模式只適用於單機,叢集部署不支援) redis: enable: true #redis開關(預覽設定許可權時需要使用redis,並行和非同步waitting機制使用redis,必開) redis: database: 1 # Redis資料庫索引(預設為0) timeout: 10000 #設定使用者端超時時間,單位是毫秒,預設為2000 password: yozosoft #密碼 #單機版 host: 192.168.56.108 port: 6379
# /opt/yozo/fcsserver/webapps/fcsserver/WEB-INF/classes/ <property name="LOG_HOME">../logs</property>
設定fcsserver.service
# cat /usr/lib/systemd/system/fcsserver.service [Unit] Description=fcsserver Service. After=network.target [Service] Type=forking Environment="PATH=/opt/yozo/jdk-8u251-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin" WorkingDirectory=/opt/yozo/fcsserver/bin ExecStart=/opt/yozo/fcsserver/bin/startup.sh Restart=always PrivateTmp=true # 可以指定相關使用者啟動fcsserver # User=yozo # Group=yozo LimitNOFILE=65536 [Install] WantedBy=multi-user.target
如果以普通使用者啟動,需要將tomcat目錄屬主屬組設定成相應賬戶
# 此次實驗以yozo使用者啟動 chown -R yozo. /opt/yozo/fcsserver
systemctl enable fcsserver --now && systemctl status fcsserver
部署伺服器:
192.168.56.101(nginx01)
192.168.56.106(nginx02)
/etc/nginx/conf.d/fcsserver.conf設定
server { .... location ~ /fcsserver { add_header Cache-Control private,no-store,max-age=0,no-cache,must-revalidate,post-check=0,pre-check=0; proxy_redirect off; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded_Proto "http"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_request_buffering off; proxy_read_timeout 7200; proxy_send_timeout 7200; proxy_pass http://fcsserver; } .... } upstream fcsserver { server 192.168.56.101:8080 fail_timeout=60s; server 192.168.56.106:8080 fail_timeout=60s; keepalive 256; }
systemctl enable nginx --now && systemctl status nginx
部署伺服器:
192.168.56.101(nginx01)
192.168.56.106(nginx02)
7.1.1 nginx01設定
/etc/keepalived/keepalived.conf
! Configuration File for keepalived global_defs { router_id proxy1 } vrrp_script chk_nginx { script "/etc/keepalived/check_nginx.sh" interval 2 weight 20 fall 3 rise 2 } vrrp_instance VI_1 { state MASTER interface enp0s3 virtual_router_id 51 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.56.200 } track_script { chk_nginx } } vrrp_instance VI_2 { state BACKUP interface enp0s3 virtual_router_id 52 priority 90 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.56.201 } track_script { chk_nginx } }
7.1.2 nginx02設定
# 備份keepalived.conf mv /etc/keepalived/keepalived.conf /etc/keepalived/keepalived.confbak
/etc/keepalived/keepalived.conf
! Configuration File for keepalived global_defs { router_id proxy2 } vrrp_script chk_nginx { script "/etc/keepalived/check_nginx.sh" interval 2 weight 20 fall 3 rise 2 } vrrp_instance VI_1 { state BACKUP interface enp0s8 virtual_router_id 51 priority 90 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.56.200 } track_script { chk_nginx } } vrrp_instance VI_2 { state MASTER interface enp0s8 virtual_router_id 52 priority 100 advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.56.201 } track_script { chk_nginx } }
雙機/etc/keepalived/check_nginx.sh
#!/bin/bash #時間變數,用於記錄紀錄檔 d=`date --date today +%Y%m%d_%H:%M:%S` #計算nginx程序數量 n=`ps -C nginx --no-heading|wc -l` #如果程序為0,則啟動nginx,並且再次檢測nginx程序數量, #如果還為0,說明nginx無法啟動,此時需要關閉keepalived if [ $n -eq "0" ]; then /etc/init.d/nginx start n2=`ps -C nginx --no-heading|wc -l` if [ $n2 -eq "0" ]; then echo "$d nginx down,keepalived will stop" >> /var/log/check_ng.log systemctl stop keepalived fi fi
systemctl enable keepalived --now && systemctl status keepalived
nginx01
nginx02
7.3.1 nginx01手動關閉nginx
nginx故障後,keepalived會自動啟動nginx
7.3.2 nginx01手動關閉keepalived
nginx01的vip將會繫結到nginx02上面,nginx02將會出現2個vip,2個vip均可以存取fcsserver
用於模擬公網DNS輪詢解析,實際使用中是在域名提供商處設定指向對映外網ip
/etc/named.conf
zone "fcsserver.com" IN { type master; file "fcsserver.com.zone"; }; zone "56.168.192.in-addr.arpa" IN { type master; file "192.168.56.zone"; };
/var/named/fcsserver.com.zone
$TTL 86400 @ IN SOA tom jerry ( ; tom & jerry 這兩個引數本應是主機名和郵件地址,這裡隨便填寫,沒有問題 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS ns.fcsserver.com. ; notice : don't forget the dot in the end IN MX 10 mail.fcsserver.com. www IN A 192.168.56.200 www IN A 192.168.56.201 ns IN A 192.168.56.108 mail IN A 192.168.56.108
/var/named/192.168.56.zone
$TTL 86400 @ IN SOA ns.fcsserver.com. root ( 1997022700 ; Serial 28800 ; Refresh 14400 ; Retry 3600000 ; Expire 86400 ) ; Minimum IN NS ns.fcsserver.com. 200 IN PTR www.fcsserver.com. 201 IN PTR www.fcsserver.com. 108 IN PTR mail.fcsserver.com. 108 IN PTR ns.fcsserver.com.
修改許可權
chown named. /var/named/ -R
systemctl enable named --now && systemctl status named
目標:本次實驗有2個vip 192.168.56.200 和 192.168.56.201,需要驗證www.fcsserver.com分別解析到2個vip上,並確認每個vip後端服務正常可用
測試期間,禁用其他網路卡,只留虛擬機器器網路卡
新增DNS
測試之前需要確認此次DNS解析是否指向所需測試的VIP,如果不是請重新整理DNS快取
需要測試www.fcsserver.com --> 192.168.56.200和www.fcsserver.com --> 192.168.56.201
檔案轉換測試
轉換檔案存取測試
注:fcsserver的組態檔中viewDomain設定為域名,故轉換檔案預覽連線只能通過www.fcsserver.com可以正常存取,通過vip、nginx ip、fcsserver ip均不可以存取
以上就是永中檔案線上轉換預覽雙活基於nginx的實現方案的詳細內容,更多關於nginx永中檔案線上轉換預覽的資料請關注it145.com其它相關文章!
相關文章
<em>Mac</em>Book项目 2009年学校开始实施<em>Mac</em>Book项目,所有师生配备一本<em>Mac</em>Book,并同步更新了校园无线网络。学校每周进行电脑技术更新,每月发送技术支持资料,极大改变了教学及学习方式。因此2011
2021-06-01 09:32:01
综合看Anker超能充系列的性价比很高,并且与不仅和iPhone12/苹果<em>Mac</em>Book很配,而且适合多设备充电需求的日常使用或差旅场景,不管是安卓还是Switch同样也能用得上它,希望这次分享能给准备购入充电器的小伙伴们有所
2021-06-01 09:31:42
除了L4WUDU与吴亦凡已经多次共事,成为了明面上的厂牌成员,吴亦凡还曾带领20XXCLUB全队参加2020年的一场音乐节,这也是20XXCLUB首次全员合照,王嗣尧Turbo、陈彦希Regi、<em>Mac</em> Ova Seas、林渝植等人全部出场。然而让
2021-06-01 09:31:34
目前应用IPFS的机构:1 谷歌<em>浏览器</em>支持IPFS分布式协议 2 万维网 (历史档案博物馆)数据库 3 火狐<em>浏览器</em>支持 IPFS分布式协议 4 EOS 等数字货币数据存储 5 美国国会图书馆,历史资料永久保存在 IPFS 6 加
2021-06-01 09:31:24
开拓者的车机是兼容苹果和<em>安卓</em>,虽然我不怎么用,但确实兼顾了我家人的很多需求:副驾的门板还配有解锁开关,有的时候老婆开车,下车的时候偶尔会忘记解锁,我在副驾驶可以自己开门:第二排设计很好,不仅配置了一个很大的
2021-06-01 09:30:48
不仅是<em>安卓</em>手机,苹果手机的降价力度也是前所未有了,iPhone12也“跳水价”了,发布价是6799元,如今已经跌至5308元,降价幅度超过1400元,最新定价确认了。iPhone12是苹果首款5G手机,同时也是全球首款5nm芯片的智能机,它
2021-06-01 09:30:45