分布式桌面多媒体共享平台
项目需要依赖的平台
Zookeeper,MemCache,Mysql(默认,可选择其他的),Tomcat(默认,可以选择其他的),Maven
Nginx配置
1、注意静态资源的地址(必须要和部署脚本的路径一致)
2、注意多媒体文件的地址(必须要和部署脚本的路径一致)
3、多台服务器进行负载,可以直接加入到upstream中,并且对服务器的权重进行修改
upstream wmsStudio {
server 127.0.0.1:8080;
server 10.0.0.1:8080;
server 10.0.0.2:80;
}
server {
listen 80;
server_name www.wms.studio;
charset utf-8;
location ~* ^/resources/ {
root /home/tools/MultimediaDesktop-Client-STATICS/;
access_log on;
expires 24h;
}
location ~* ^/files/{
root /home/data/;
access_log on;
expires 24h;
}
location / {
proxy_pass http://wmsStudio/;
index /;
}
}
Nginx.conf下的http配置
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
client_max_body_size 1024m;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
gzip_min_length 4k;
gzip_vary on;
gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
服务端发布脚本配置
JAVA_HOME=/home/tools/jdk1.8.0_25
MAVEN_HOME=/home/tools/maven
PATH=.:${JAVA_HOME}/bin:$MAVEN_HOME/bin:$PATH
#LANG=zh_CN.gbk
export JAVA_HOME MAVEN_HOME PATH
#项目源码地址
PROJECT_DIR=/home/project/trunk
#项目部署地址
DEPLOY_DIR=/home/tools/deploy/
#获取指定网卡的IP
HOST_IPADDRESS=`ifconfig eth2 | grep 'inet 地址:' | cut -d: -f2 | awk '{ print $1}'`
#日志目录地址
LOG_DIR=/home/data/log/Server/${HOST_IPADDRESS}
SVNUP_log=${LOG_DIR}/svnup.log
RSYNC_log=${LOG_DIR}/rsync.log
DEPLOY_LOG=${LOG_DIR}/deploy.log
MAVEN_LOG=${LOG_DIR}/maven.log
FILE_EXCLUDE="--exclude .svn"
SERVER_DIR=${PROJECT_DIR}/Server/target/MultimediaDesktop-Server/
消费端发布脚本配置
JAVA_HOME=/home/tools/jdk1.8.0_25
MAVEN_HOME=/home/tools/maven
PATH=.:${JAVA_HOME}/bin:$MAVEN_HOME/bin:$PATH
#LANG=zh_CN.gbk
export JAVA_HOME MAVEN_HOME PATH
PROJECT_DIR=/home/project/trunk
DEPLOY_DIR=/home/tools/tomcat/
DEPLOY_PROJECT=${DEPLOY_DIR}/webapps/ROOT/
NGINX_STATICS=/home/tools/MultimediaDesktop-Client-STATICS/
HOST_IPADDRESS=`ifconfig eth2 | grep 'inet 地址:' | cut -d: -f2 | awk '{ print $1}'`
LOG_DIR=/home/data/log/Client/${HOST_IPADDRESS}
SVNUP_log=${LOG_DIR}/svnup.log
RSYNC_log=${LOG_DIR}/rsync.log
DEPLOY_LOG=${LOG_DIR}/deploy.log
MAVEN_LOG=${LOG_DIR}/maven.log
FILE_EXCLUDE="--exclude .svn"
CLIENT_DIR=${PROJECT_DIR}/Client/target/MultimediaDesktop-Client/
STATICS_DIR=${PROJECT_DIR}/Client/target/statics/
FILE_MEDIA_DIR=/home/data/files/
服务端配置文件修改
Mail.properties:修改邮箱配置
Db.properties:修改数据库配置
Dubbo.properties:修改运行端口
消费端配置文件修改
Server.properties:修改运行端口和MemCache地址