天天看點

SCRM營銷平台-MarketGo安裝部署

作者:營銷平台MarketGo

1、産品介紹

SCRM營銷平台-MarketGo介紹

SCRM營銷平台-MarketGo産品介紹

2、伺服器準備

伺服器的最低配置如下:

類型 配置
作業系統 CentOS 7.6
CPU 4核
記憶體 8G
硬碟 80G
帶寬 3M

端口設定:

服務 端口
zookeeper 2181
mktgo-gateway 8521
mktgo-web 8520
dubbo 28090
xxl-job 8580、9999
redis 6379
mysql 3306

元件清單:

元件名稱 版本号
JDK 1.8
mysql 5.7.0
redis 7.0.2
rabbitmq 3.10.0
nginx 1.20.1
zookeeper 3.4.6

3、服務部署

前端部署:

#下載下傳代碼,進入根目錄下的version目錄,上傳dist.zip
scp dist.zip root@${IP}:/opt/soft/marketgo/
#登入伺服器,進入/opt/soft/marketgo/
unzip dist.zip
mv dist html

#修改伺服器位址
cd /opt/soft/marketgo/html
#修改伺服器的位址
vim env.js 

           

後端部署:

設定nginx.conf,配置如下:

http {
    gzip on;
    gzip_static on;
    gzip_disable "msie6";
    gzip_min_length 100k;
    gzip_buffers 4 16k;
    gzip_comp_level 5;
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 4096;
    client_max_body_size  20m;
    client_body_buffer_size 20m;
    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;

    server {
        listen       80;
        listen       [::]:80;
        server_name  localhost;

       location / {
            proxy_set_header Host $host;
            proxy_set_header   X-Real-IP        $remote_addr;
            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
            proxy_buffer_size  128k;
            proxy_buffers   32 32k;
            proxy_busy_buffers_size 128k;
            proxy_connect_timeout       60;
            proxy_send_timeout          60;
            proxy_read_timeout          60;
            send_timeout                60;

            root   /opt/soft/marketgo/html;
            index  index.html index.htm;
        }
        location /web {
        if ($request_method = 'OPTIONS') {
add_header Access-Control-Allow-Origin '$http_origin';
         add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,api-token,header-api-token,language,Api-Token,isPlatform';
         add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, OPTIONS, PUT';
         add_header Access-Control-Allow-Credentials 'true';
            return 204;
         }
            proxy_pass http://127.0.0.1:8520/;
        }

        location /api {
            proxy_pass http://127.0.0.1:8521/;
        }
        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

    }
           

建立資料庫

#下載下傳代碼,進入根目錄下的version目錄,上傳xxl-job的資料庫
scp xxl-job.zip root@${IP}:/opt/soft/marketgo
#解壓
unzip xxl-job.zip
#登入mysql,加載xxl-job資料庫
source /opt/soft/marketgo/xxl-job/tables_xxl_job.sql
#導入定時任務的資訊
source /opt/soft/marketgo/xxl-job/xxl_job.sql

#下載下傳代碼,進入根目錄下的version目錄,上傳marketgo的資料庫
scp web.zip root@${IP}:/opt/soft/marketgo
#解壓
unzip web.zip
#登入mysql,加載marketgo資料庫
source /opt/soft/marketgo/web/marketgo.sql

           

部署gateway服務

#下載下傳代碼,進入根目錄下的version目錄,上傳gateway.zip
scp gateway.zip root@${IP}:/opt/soft/marketgo/
#登入伺服器,進入/opt/soft/marketgo/
unzip gateway.zip
cd gateway
chmod +777 *
./start_service.sh start
           

部署web服務

#下載下傳代碼,進入根目錄下的version目錄,上傳web.zip
scp web.zip root@${IP}:/opt/soft/marketgo/
#登入伺服器,進入/opt/soft/marketgo/
unzip web.zip
cd web
chmod +777 *
./start_service.sh start
           

繼續閱讀