大家好,我们已经正式发布了webfunny的官方镜像:https://hub.docker.com/repository/docker/webfunny/webfunny_monitor
部署前提是你的服务器已经按照了Docker环境;
一、拉取官方镜像
执行命令$:docker pull webfunny/webfunny_monitor:3.0.95-beta
查看镜像$: docker images
二、创建配置文件
1. 在本地创建一个目录,如: /home/config_variable/, 则映射目录为:/home/config_variable/
2. 在映射目录下创建一个文件:config.json 文件模板可参考:模板
3. 配置文件的参数说明文档在最下方 ↓↓↓。
三、填写基础配置
1. 进入映射目录,找到配置文件进行修改:/home/config_variable/config.json
2. 填写授权码,如果没有,可以去官网:申请试用版
"purchase": {
"purchaseCode": "授权码",
"secretCode": "解码(没有可以空着)"
}
3. 填写数据库配置
"mysqlConfig": {
"write": {
"ip": "localhost",
"port": "3306",
"dataBaseName": "webfunny_db",
"userName": "root",
"password": "123456"
},
"read": []
},
4. 配置域名和端口号,如何配置?请参考文档的第四步:服务器部署
"domain": {
"localServerDomain": "localhost:8011",
"localAssetsDomain": "localhost:8010",
"localServerPort": "8011",
"localAssetsPort": "8010",
"mainDomain": ""
},
5. 配置生产环境,搭配nginx配置域名,代理配置可以参考文档:nginx代理配置
"domain": {
"localServerDomain": "www.baidu.com",
"localAssetsDomain": "www.baidu.com",
"localServerPort": "8011",
"localAssetsPort": "8010",
"mainDomain": ""
},
四、启动容器
1. 执行启动命令之前,需要替换一下映射目录和版本号,按照文档的示例,对应值如下:
映射目录 -> /home/config_variable/
版本号 -> 3.0.95-beta
2. 执行启动命令$:
docker run -it --rm -d --name webfunny -p 8011:8011 -p 8010:8010 -v 映射目录:/app/config_variable/ webfunny/webfunny_monitor:版本号
3. 查看容器情况$:docker container ls ; 进入启动的容器$:docker exec -it 容器id /bin/bash
4. 心跳检测地址: 域名 + /server/health
五、容器的其他常用操作指令
拉取镜像: docker pull webfunny/webfunny_monitor:3.0.95-beta
查看镜像:docker images
删除镜像:docker rmi -f 镜像id
查看容器:docker container ls , docker container ls —all
删除容器:docker container kill 容器id
启动容器:docker start 容器id
停止容器:docker stop 容器id
重启容器:docker restart 容器id
参数说明:
{
"purchase": {
"purchaseCode": "",
"secretCode": ""
},
"domain": {
"localServerDomain": "localhost:8011",
"localAssetsDomain": "localhost:8010",
"localServerPort": "8011",
"localAssetsPort": "8010",
"mainDomain": ""
},
"mysqlConfig": {
"write": {
"ip": "localhost",
"port": "3306",
"dataBaseName": "webfunny_db",
"userName": "root",
"password": "123456"
},
"read": []
},
"email": {
"useCusEmailSys": false,
"emailUser": "",
"emailPassword": ""
},
"httpReqRes": {
"requestTextLength": 1000,
"responseTextLength": 1000
},
"messageQueue": false,
"openMonitor": true,
"logSaveDays": 8,
"business": {
"userStayTimeScope": {
"min": 100,
"max": 100000
}
}
}
{
"purchase": {
"purchaseCode": "", //授权码
"secretCode": "" //解码
},
"domain": {
"localServerDomain": "localhost:8011", // 接口域名
"localAssetsDomain": "localhost:8010", // 前端域名
"localServerPort": "8011",
"localAssetsPort": "8010",
"mainDomain": ""
},
"mysqlConfig": { // 数据库配置
"write": {
"ip": "localhost",
"port": "3306",
"dataBaseName": "webfunny_db",
"userName": "root",
"password": "123456"
},
"read": [] // 读写分离配置
},
"email": {
"useCusEmailSys": false, // 是否使用自己的邮件系统, true: 使用配置的邮箱密码;false: 由webfunny系统给你发送邮件
"emailUser": "", // 163邮箱用户名
"emailPassword": "" // 163邮箱,网易老账号用密码, 新账号用安全码
},
"httpReqRes": {
"requestTextLength": 1000,
"responseTextLength": 1000
},
"messageQueue": false, // 是否开启消息队列,默认不开启
"openMonitor": true, // 是否开启监控,企业版可关闭此选项
"logSaveDays": 8, // 数据保存周期,默认8天
}