Skip to content

Worker4

worker4

worker4是主要的对外服务运行机器。

基本配置

访问地址

内网IP 10.221.77.79
外网IP 203.195.206.152
内部域名 worker4.cluster.gm

内部域名解析配置 /etc/hosts

127.0.0.1 merchandise.cluster.gm
127.0.0.1 thrift.cluster.gm
10.143.80.155 redis.cluster.gm
127.0.0.1 static.cluster.gm
10.143.80.155 rabbitmq.cluster.gm
10.66.184.165 mongo.cluster.gm
10.66.193.35 mysql.cluster.gm
127.0.0.1 order.cluster.gm

其它配置

登录用户superman/1qaz2wsx
挂载云硬盘 mount /dev/vdb /data
禁止密码登录 /etc/ssh/sshd.config PasswordAuthentication no
设置每天0点日志轮转 /etc/crontab中增加行
    0 0    * * *   root    /new/path/to/logrotate/script

基本软件

sshd python3 python3-pip python3-venv libmysqlclient-dev git nginx uwsgi

服务列表

nginx

对外web服务
配置文件/etc/nginx
日志轮转修改 /etc/logrotate.d/nginx 不压缩 默认权限为644

gmdeploy

部署脚本
/usr/local/bin/gmdeploy -> /data/script/gm_release/run.py

gm_distributor

食通八方
host zgspwm.com zgspwm.cn www.zgspwm.com www.zgspwm.cn
关联 10.190.150.57:10088
工程目录 /data/www/gm_distributor
日志目录 /data/www/gm_distributor/logs
启动命令 deploy.sh start
端口号 8910

gm_higreen

海吉星冷链
host higreen.guanmai.cn
工程目录 /data/www/gm_higreen
日志目录 /data/www/gm_higreen/logs
启动命令 run/uwsgi_website/higreen start
端口号 8888
帐号 superman/1qaz2wsx

gm_server_merchandise

商品库服务
host merchandise.cluster.gm
工程目录 /data/www/merchandise/
日志目录 /data/log/merchandise/
启动命令 run/uwsgi_website/merchandise start
端口号 1988

gm_server_order

订单服务
host order.cluster.gm
工程目录 /data/www/order/
日志目录 /data/log/order/
启动命令 run/uwsgi_website/order start
端口号 8870

gm_server_bshop

bshop商城
host bshop.guanmai.cn
工程目录 /data/www/bshop/
日志目录 /data/log/bshop/
启动命令 run/uwsgi_website/bshop start
端口号 8610-8620

gm_service

station业务平台
host station.guanmai.cn
工程目录 /data/www/station/
日志目录 /data/log/station/
启动命令 run/uwsgi_website/station start
端口号 8570-8580

gm_management

manage信息平台
host manage.guanmai.cn
工程目录 /data/www/manage/
日志目录 /data/log/manage/
启动命令 run/uwsgi_website/manage start
端口号 8880-8890

static

静态文件
host static.guanmai.cn js.guanmai.cn
目录 /data/www/gm_static /data/www/static_resource/

templates

模板文件,后台工程通过软链接绑定对应的模板文件
目录 /data/templates

certbot

证书服务,获取免费证书,三个月失效
申请 sudo certbot certonly --webroot -w /var/www/html/ -d xx.cn -d xx.com
更新 sudo certbot renew
需要申请证书的域名nginx增加配置
location /.well-known/ {
    root /usr/share/nginx/html;
}
已使用域名
    wxwmlt.cn