JEPaaS商业开发版部署教程

源码下载 && 基础环境搭建

前置要求

  • OS: windows/linux/macos

  • MySQL 5.7+

  • Redis 3.0+

  • Tomcat 7.0+

源码下载

  1. 下载商业开发板源码

数据库初始化

依次创建instant,jepaas 数据库,到jepaas-commercial\scripts\db-migration,把需要的脚本导入到Mysql执行

搭建redis

Redis 搭建成功后,需要在redis.conf 设置redis的密码,这里假设为 edtest123

参数修改 && 证书覆盖

  1. JEPaaS的授权证书重命名为je.license,复制到jepaas-commerical/je-web/src/main/webapp/JE/data/config目录下

  2. jepaas-commerical/je-web/src/main/resources/目录下为各个环境的配置文件,根据实际的MySQL、Redis 配置,修改jdbc.properties,redis.properties中的连接地址和认证参数

  3. scripts/push目录下是connector-serverinstant-push-server的构建好的文件,也需要修改mysql和redis 连接及认证参数

打包

-P 后面的参数代表maven打包时使用的profile,根据不同环境选择相应的profile,下面以prod为例

cd jepaas-commercial
mvn package -P prod

上述命令如果执行成功后,应该会输出一个war包jepaas-commercial\je-web\target\jepaas.war

部署 && 启动

  1. 启动 connector-serverinstant-push-server

  2. 下载tomcat后,把上面打包好的jepaas.war复制到TOMCAT_HOME\webapps\这个目录,然后把jepaas.war重命名为ROOT.war

  3. TOMCAT_HOME\bin\目录下,执行如下命令,启动服务

startup.sh

JePaaS-license加密分析

uncode-session.jar

MUserCanvas

errorInfo.json

{
"e1": "没有找到证书,请联系官方或下载证书!",
"e2": "获取认证信息出错!",
"e3": "您的证书最多创建%s张表!",
"e4": "您的证书最多创建%s个功能!",
"e5": "您的证书最多创建%s个流程!",
"e6": "证书认证异常!",
"e7": "学习版无法使用迁移工具,请购买指定的授权!",
"e8": "您的版本用户量超过限制!",
"e9": "您的证书已到期,请联系官方!",
"e10": "您的版本资源已超过限制,将无法启动!",
"e11": "授权告警!",
"e12": "请更新插件集!"
}

  • g 错误信息JSON
  • name license信息
  • s plugin.lock 信息
  • e 可创建表数量,-1 无限制
  • h 可创建流程数量,-1无限制
  • f 可创建功能数量,-1无限制
  • q 最大用户数量,-1无限制
  • i 证书到期时间
  • x 版本:develop开发版,commercial商业版
  • m 版本号
  • 。。

je.license定义

  • d RSA privateKey
  • b AES key
  • a AES IV
  • c AES 加密后的内容

plugin.lock定义

  • d RSA privateKey
  • b AES key
  • a AES IV
  • c AES 加密后的内容

je.license 解密前

{
"a": "Eu0KOoPjqTOWZKeEOyyIJcr6RTBchmdMVSJi0aX7oQEM5wcBKsTrUlHg0mdQS3wsPOc/LSKswc7IPAd1U/OE5GVhOkerLiPZgouIqXNVMIvfhH1RS5nXHkHtdHS1HVAkEUEZ9PA0EAZtBYdqYbUm1wHEBvBnGUoyHDP1ymVBQw8=",
"b": "QNu+ipkXIXXYZZkZczDUNTYfV60QimrI8nVxmoxKuBVJtnzC7YJo9O0wHrLYe0+iGQZy/qj4UZVlMdNc2qwpx4b03Orqu+c6qfp2L5befTH3AwDOT146OMx8F/dIRQ6KYmwuAGT5+zozw8K3BKA+WCrjuWYuK7BuuEld8OWQpMo=",
"c": "fkFTsuZi8C+f+zvfXPO/I4cm4bLdJdYP1P11HiJ9xAjUIlmc/TMS3yinyHGolZ6tjEYvLF3AUzzN3+HbQQn2jFvRldwZAPQzkS2iuG7wLiwzTwGxkBFk+6J2GCCQxzgFDcXIfxIFFB1YOqFnje2wiKW6viPQqQBFu2FniW57bHzH+7qAcNmZBewTE4REbMYfqUm7spbRvrr09kgaKmD0HmJBejVIulMoxBUFmSgqnW9ywPuToUwTB81OiqVPUqAvdsOwzxJnkQQRn2Pt0WzEdDbbAdONyWcZw3dc5sEKMz3U6lD5GUPPZi/Yn0QwHOZDQuxJ3dIliQ05vVDhIH2txLa58Cyuzw6UI2sMIWc4KlJm7sa3hlvz9bvkPE5FJUHx2fw+DLx8hszJ/g9+d7DnS1fM2YRgV8R7SuPXDZ9Yx/u7IUlNwbZiyyh1o8X9dQND5C98VDH34Q8twj4AiNqtOjX4prx6jvHMIYCv/eou/g7lHxWTwJ08kfFbKbpBUSmiedcHqLnAL8izdRHvUUlDBw==",
"d": "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIOKUqPHeVESjR47ptAd+BBBJUoVDfYkaMMrTUWIDQrO1OW1LPUYvLUXnrkePftmR1saeMyIKWaJX08dKqSKto5WJr/E6GD9/YADMlph1ZC2LGxFqDg8hgK2dqfcNMVuobIOFuBSjcFr5QKFcdchkNVC4ULtuoabFg8knoH2tnJPAgMBAAECgYAculPsEv+K1jtds/dtkm3/1sp3EHwZGsCKh2V73wfCKYPTmyrzaHCmOD9g/Jra0e6ZlgF14fLwwuW+2IbcorLVuOFg6WRmlLm21jb+IDIvdfsrkccH17ukuGjxT548QVmS/6axv/rtmaBqI8YvlQq4BSl+vvcacUMQnRmy4dJMWQJBAMR9l2zQjDYdUoahskMInpcCgDxGTbKNpyNiIBvArBG0cLghrOlQYC7NF8j/87HWRZxAeRf6Kls4KRxjMhrl+z0CQQCrYPlcs7mAqrmIsdjENAcrnnA7WEO9Zq/1fn2wnWHBIFS4UUmvTenytLnsGtTouJeznzK+vCrzF3mtQjvsrWx7AkBIXqGJGH6r57zfjWqkueX/ZJJqoNI5M2cd5yRAVISLuNPTXcPb4xip5CwggfT1yR+2XyC6rg8vrc2mgPqRYadZAkBE/R6k0LymLRPPETjfksooJvmrChcK0aGXw7m5NUG6ytcP87kj1suMpnAJuatnm5eF+VomKf1oKlUTCAyzdAStAkEAgyqG6NpVX9x39UpEZ5/Nk8NxUQdZxFVGT0vaFPE1qWUWriDUwSQx02N7LAUYhjlxuUtWjmms+IfiJV7DAvTOZg=="
}

解密算法

function rsaDecrypt(data){
return Crypto.rsaDecrypt(data);
}
const licenseInfo = Base64.decode(readFile("je.license")).toJSON();
const rsaPrivateKey = Crypto.genRSAPrivateKey(licenseInfo.d);
const aesKey = Crypto.aesKey(rsaDecrypt(licenseInfo.b));
const aesIV = Crypto.aesIV(rsaDecrypt(licenseInfo.a));
const result = Crypto.aesDecrpyt(aesKey,aesIV,licenseInfo.c);

解密后:

{
"a": "技术支持:凯特伟业",//topInfo
"b": "JEPAAS快速开发平台系统加载中...",//loadingInfo
"c": "北京凯特伟业提供技术支持 电话:400-0999-235", //companyInfo
"d": "",
"e": -1,//tableNum
"f": -1,//funNum
"h": -1,//proceeNum
"i": "-1",//
"j": "2020-08-19 16:13:33",//createdTime
"k": "http://jepaas.com",
"m": "v2",//pluginVersion
"n": "2021-05-10 17:39:14",//verifyTime
"o": "1888-6430-1121-8706",//verifyUniqueCode
"q": -1,//userNum
"r": "刘旭",//applicant
"t": "0",//auth
"v": "",//
"w": "2019-07-20 12:04:36",
"x": "develop",//licenseType
"y": 50,//machineNum
"z": "2.0"//licenseVersion
}

{
"success": true,
"obj": {
"userNum": "-1",
"auth": "1",
"companyInfo": "北京凯特伟业提供技术支持 电话:400-0999-235",
"machineNum": "50",
"loadInfo": "JEPAAS快速开发平台系统加载中...",
"topInfo": "技术支持:凯特伟业",
"verifyTime": "2021-12-31 17:49:02",
"applicant": "刘旭",
"licenseType": "develop",
"creatTime": "2020-08-19 16:13:33",
"funNum": "-1",
"tableNum": "-1",
"licenseVersion": "2.0",
"verifyUniqueCode": "6468-3423-1654-5339",
"processNum": "-1"
}
}

plugin.lock解码前

{
"a": "QruKKDuCwU9+ohAcw/NbZO47YTsOngaMrosHHOH9QDz3AwuQCsFfZ0K4FdyNIIcNfAygRNku4bts8AkOt1TLsT/vewr5SM2alkexCw101WedAQatYtMZt44FeqpBqWh3zSRcB7FAxySvS6Q+dEHtWsCoWxlW/xvNew+TASe9+OU=",
"b": "RHGz4esnrLvFLyMsRm2tVDNuIvGMAPE8X9vhQ0XhqI7sU/dCJ5XRf+7W5wuw5qLgzVmR6R8K6dFAgZn/oU5sHA3d5VUs3bSnq+BCNZoMBU1RQDhEixzzf9wfLuLtsrLX/gc5m4oK8+gu3PEZLuXgdHyV/5tLo0pOFVrEMPr9Btk=",
"c": "eKeHEjHkOZ25Du5Y3m/VJXF1/efUXYF8+rRRr0Pmp3zOb9AObNIi4sg+RHf79s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E_THIRDSOURCE",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_THIRDSOURCE\"}]",
"g": "plugin7.key"
},
{
"a": "JE_INSTANT_MESSAGE",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"DOM\",\"type\":\"IM\",\"info\":\".im-content .im-text\"}]",
"g": "plugin5.key"
},
{
"a": "JE_CORE_MESSAGE",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_PUSH_TEMPLATE\"}]",
"g": "plugin27.key"
},
{
"a": "JE_CORE_INDUSTRY",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_INDUSTRY\"},{\"model\":\"VIEW\",\"info\":\"JE.sys.svg.view.MainView\"}]",
"g": "plugin22.key"
},
{
"a": "JE-CORE-DESKTOP",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_DESKTOP_UPGRADE\"}]",
"g": "plugin18.key"
},
{
"a": "JE_SYS_TIMEDTASK",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_SYS_TIMEDTASK\"}]",
"g": "plugin6.key"
},
{
"a": "JE_CORE_PERMLIST",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"IDDT\",\"info\":\"JE_ADMINPERM,JE.sys.rbac.view.perm.MainView\"}]",
"g": "plugin8.key"
},
{
"a": "JE_CORE_EXCELGROUP",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_EXCELGROUP\"}]",
"g": "plugin13.key"
},
{
"a": "JE-CORE-THIRD",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CP_APP\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CP_DEPT\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CP_DEPTUSER\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_FS_DEPT\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_FS_DEPTUSER\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_DD_DEPT\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_DD_DEPTUSER\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_SERVER_DETAIL\"}]",
"g": "plugin19.key"
},
{
"a": "JE_CORE_DATAFLOW",
"b": "0",
"c": "CONFIG",
"f": "[{\"model\":\"FUNC\",\"type\":\"CONFIG\",\"info\":\"JE_DataflowConfig\"},{\"model\":\"VIEW\",\"info\":\"JE.sys.funccfg.view.data.DataFlowView\"}]",
"g": "plugin17.key"
},
{
"a": "JE_CHINA_JINCANG",
"b": "0",
"c": "BACKEND",
"f": "{\"className\":\"\"}",
"g": "cplugin2.key"
},
{
"a": "JE_CORE_COMMON_PERM",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"IDDT\",\"info\":\"JE_PUBLICPERM,JE.sys.rbac.view.public.MainView\"}]",
"g": "plugin9.key"
},
{
"a": "JE_CORE_NEWS",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"VIEW\",\"info\":\"PRO.portal.View\"}]",
"g": "plugin1.key"
},
{
"a": "JE_CORE_DISK",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"MENU\",\"type\":\"IDDT\",\"info\":\"JE_SYS_CLOUDFILE,PRO.cloud.View\"}]",
"g": "plugin16.key"
},
{
"a": "JE_CORE_MANAGERPLUGIN",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"IDDT\",\"info\":\"JE_RBAC_CJGL,JE.sys.rbac.view.cjgl.MainView\"}]",
"g": "plugin14.key"
},
{
"a": "JE_CORE_REPORT",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"IDDT\",\"info\":\"JE_CORE_CHARTS,JE.sys.chart.view.MainView\"},{\"model\":\"VIEW\",\"info\":\"JE.core.view.ChartView\"},{\"model\":\"VIEW\",\"info\":\"JE.core.view.ReportView\"}]",
"g": "plugin11.key"
},
{
"a": "JE_CHINA_DAMENG",
"b": "0",
"c": "BACKEND",
"f": "{\"className\":\"\"}",
"g": "cplugin3.key"
},
{
"a": "JE_CORE_IOT",
"b": "0",
"c": "BACKEND",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_WLW_KHD\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_WLW_EQUIPMENT\"}]",
"g": "plugin24.key"
},
{
"a": "JE_CORE_JEAPPH5",
"b": "0",
"c": "FRONTEND",
"f": "[]",
"g": "plugin26.key"
},
{
"a": "JE_CORE_BUSFLOW",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"SYSZ_FLOWINFO\"}]",
"g": "plugin10.key"
},
{
"a": "JE_CORE_DATASOURCE",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_DATASOURCE\"}]",
"g": "plugin3.key"
},
{
"a": "JE_CORE_UPPACKAGE",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_UPPLATFORM\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_UPPACKAGE\"}]",
"g": "plugin2.key"
},
{
"a": "JE_CHINA_SHENTONG",
"b": "0",
"c": "BACKEND",
"f": "{\"className\":\"\"}",
"g": "cplugin1.key"
},
{
"a": "JE_CORE_PROTAL",
"b": "0",
"c": "FUNC",
"f": "[{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_CORE_PROTAL\"},{\"model\":\"VIEW\",\"info\":\"JE.sys.portal.view.MainView\"},{\"model\":\"VIEW\",\"info\":\"JE.core.view.PortalView\"},{\"model\":\"VIEW\",\"info\":\"JE.core.view.PortalMenuView\"}]",
"g": "plugin15.key"
},
{
"a": "JE_CORE_TIDB",
"b": "0",
"c": "BACKEND",
"f": "[]",
"g": "plugin23.key"
},
{
"a": "JE_FUNCCONFIG_DATAPERM",
"b": "0",
"c": "CONFIG",
"f": "[{\"model\":\"FUNC\",\"type\":\"CONFIG\",\"info\":\"JE_DataConfig\"},{\"model\":\"VIEW\",\"info\":\"JE.sys.funccfg.view.power.PowerView\"}]",
"g": "plugin12.key"
},
{
"a": "JE_CORE_PHONE",
"b": "0",
"c": "FRONTEND",
"f": "[{\"model\":\"MENU\",\"type\":\"IDDT\",\"info\":\"JE_PHONE_APP,JE.sys.phone.view.ApkView,JE.sys.phone.controller.MainController\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_PHONE_UPGRADE\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_PHONE_FUNC\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_PHONE_PLUGIN\"},{\"model\":\"MENU\",\"type\":\"MT\",\"info\":\"JE_PHONE_LOGGER\"}]",
"g": "plugin4.key"
}
],
"b": "v7.2.7"
}

logging:
file:
name: logs/etc-service/etc-service.log #日志文件名称
max-size: 50KB #单个日志文件最大大小
max-history: 7 #日志归档保留天数
level:
root: info
org.hibernate.type.descriptor.sql.BasicBinder: trace
com.netflix.eureka: OFF
com.netflix.discovery: OFF
org.springframework.cloud.config.client.ConfigServicePropertySourceLocator: WARN
pattern:
#rolling-file-name: ${LOG_FILE}.%d{yyyy-MM-dd}.%i.log #滚动日志文件名称pattern,当文件已gz,zip结尾时,日志文件会被压缩
rolling-file-name: logs/etc-service/%d{yyyy-MM-dd,aux}/etc-service.%d{yyyy-MM-dd}.%i.log #滚动日志文件名称pattern,当文件已gz,zip结尾时,日志文件会被压缩

JOL

简介

JOL(Java Object Layout)是用于分析 JVM 中对象布局方案的微型工具箱。这些工具大量使用 Unsafe、JVMTI 和 Serviceability Agent (SA) 来解码实际的 对象布局、占用空间和引用。这使得JOL比其他依赖堆转储、规范假设等的工具更准确。

使用

测试类

public class SimpleObject {
//primitive type
private byte b;
private boolean bl;
private short s;
private char c;
private int a;
private float f;
private double d;
private long l;
//reference type
private Object obj;
private Object [] objArray;
}

测试代码


/**
* 打印class布局
*/
public void testPrintClassLayout(){
ClassLayout classLayout = ClassLayout.parseClass(SimpleObject.class);
System.out.println(classLayout.toPrintable());
}

/**
* 打印对象实例布局
*/
public void testPrintObjectLayout(){
SimpleObject obj = new SimpleObject();
System.out.println(ClassLayout.parseInstance(obj).toPrintable());
}

关闭指针压缩

VM参数:-XX:-UseCompressedOops

Class Layout

SimpleObject object internals:
OFF SZ TYPE DESCRIPTION VALUE
0 8 (object header: mark) N/A
8 8 (object header: class) N/A
16 8 double SimpleObject.d N/A
24 8 long SimpleObject.l N/A
32 4 int SimpleObject.a N/A
36 4 float SimpleObject.f N/A
40 2 short SimpleObject.s N/A
42 2 char SimpleObject.c N/A
44 1 byte SimpleObject.b N/A
45 1 boolean SimpleObject.bl N/A
46 2 (alignment/padding gap)
48 8 java.lang.Object SimpleObject.obj N/A
56 8 java.lang.Object[] SimpleObject.objArray N/A
Instance size: 64 bytes
Space losses: 2 bytes internal + 0 bytes external = 2 bytes total

Object Layout

SimpleObject object internals:
OFF SZ TYPE DESCRIPTION VALUE
0 8 (object header: mark) 0x0000000000000001 (non-biasable; age: 0)
8 8 (object header: class) 0x000000001c123380
16 8 double SimpleObject.d 0.0
24 8 long SimpleObject.l 0
32 4 int SimpleObject.a 0
36 4 float SimpleObject.f 0.0
40 2 short SimpleObject.s 0
42 2 char SimpleObject.c
44 1 byte SimpleObject.b 0
45 1 boolean SimpleObject.bl false
46 2 (alignment/padding gap)
48 8 java.lang.Object SimpleObject.obj null
56 8 java.lang.Object[] SimpleObject.objArray null
Instance size: 64 bytes
Space losses: 2 bytes internal + 0 bytes external = 2 bytes total

开启指针压缩

默认是开启的

VM参数:-XX:+UseCompressedOops

uid:8个字节
timpstamp:8个字节
Map每个Node大小
4+8+8+4
hash(4) + key(8) + value(8) +next(4)
每个用户占用16个字节

Class Layout

SimpleObject object internals:
OFF SZ TYPE DESCRIPTION VALUE
0 8 (object header: mark) N/A
8 4 (object header: class) N/A
12 4 int SimpleObject.a N/A
16 8 double SimpleObject.d N/A
24 8 long SimpleObject.l N/A
32 4 float SimpleObject.f N/A
36 2 short SimpleObject.s N/A
38 2 char SimpleObject.c N/A
40 1 byte SimpleObject.b N/A
41 1 boolean SimpleObject.bl N/A
42 2 (alignment/padding gap)
44 4 java.lang.Object SimpleObject.obj N/A
48 4 java.lang.Object[] SimpleObject.objArray N/A
52 4 (object alignment gap)
Instance size: 56 bytes
Space losses: 2 bytes internal + 4 bytes external = 6 bytes total

Object Layout

SimpleObject object internals:
OFF SZ TYPE DESCRIPTION VALUE
0 8 (object header: mark) 0x0000000000000001 (non-biasable; age: 0)
8 4 (object header: class) 0xf800c105
12 4 int SimpleObject.a 0
16 8 double SimpleObject.d 0.0
24 8 long SimpleObject.l 0
32 4 float SimpleObject.f 0.0
36 2 short SimpleObject.s 0
38 2 char SimpleObject.c
40 1 byte SimpleObject.b 0
41 1 boolean SimpleObject.bl false
42 2 (alignment/padding gap)
44 4 java.lang.Object SimpleObject.obj null
48 4 java.lang.Object[] SimpleObject.objArray null
52 4 (object alignment gap)
Instance size: 56 bytes
Space losses: 2 bytes internal + 4 bytes external = 6 bytes total

指针压缩对结果的影响

以下都是基于64bit操作系统的测试结果

开启指针压缩 关闭指针压缩
对象头 12byte 16byte
引用类型 4byte 8byte

其他

对象的大小是8的倍数,如果不是8的倍数,jvm在创建对象分配内存时会填充字节用以对齐

JUC lock与synchronized 差异

线程状态

    // Thread State
    // ReentrantLock.lock ->  java.lang.Thread.State: WAITING (parking)
    waiting on condition
    // synchronized ->  java.lang.Thread.State: BLOCKED (on object monitor) waiting for monitor entry
    // get lock on sleep ->  java.lang.Thread.State: TIMED_WAITING (sleeping)

取最小记录

没有比它更小的记录,那么就是最小记录

select v1.id,v2.id from certification_version v1 left join certification_version v2 on v1.certification_id = v2.certification_id
and v1.deleted = 'f'
and v2.created_time < v1.created_time
where 1=1
--and v1.id ='d0196569-393d-4bb1-a843-7b058efca61d'
and v2.id is null
and v1.certification_id = 'c1bb788b-cce3-4377-baae-53e4b4f589d8'

取最大记录

没有比它更新的记录,那么它就是最新记录

select v1.id,v2.id from certification_version v1 left join certification_version v2 on v1.certification_id = v2.certification_id
and v1.deleted = 'f'
and v1.created_time < v2.created_time
where 1=1
--and v1.id ='d0196569-393d-4bb1-a843-7b058efca61d'
and v2.id is null
and v1.certification_id = 'c1bb788b-cce3-4377-baae-53e4b4f589d8'

redis token store key specs

access: 
accessToken-> OAuth2AccessToken

auth:
accessToken -> OAuth2Authentication

auth_to_access:
md5(OAuth2Authentication -> {username=xxx,client_id=xxx,scope=xxx}) -> OAuth2AccessToken

uname_to_access: Set
clientId +":"+ username(phone) -> OAuth2AccessToken

client_id_to_access: Set
clientId -> OAuth2AccessToken

refresh_to_access:
refreshToken -> OAuth2RefreshToken

access_to_refresh:
accessToken -> refreshToken

DOCKER

查看指定服务名的日志(只有一个服务实列)
docker service ps t_mserv_espare|grep Running|awk '{print $1}'|xargs docker service logs -f

构建镜像

docker build -t <TAG_NAME> <Dockerfile_PATH>

运行镜像

docker run -d -p 3000:3000/tcp -v /d:\\test:/home/test gettingg-started

-d(etach) 后台模式运行 -p(ublish) <hostPort>:<containerPort>/<protocol[tpc,udp...]> 端口映射

-v(olume) 磁盘映射 hostPath:containerPath

查看镜像列表

docker images

查看容器实例列表

docker ps 或者 docker container ls

查看实例中运行的程序的STD_OUT(标准输出)(eg:c语言中的print/printf,node:console.log,java:System.out…)

docker logs <containerId>

运行当前运行中容器中的命令

docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

Options:
-d, --detach Detached mode: run command in the background
--detach-keys string Override the key sequence for detaching a
container
-e, --env list Set environment variables
-i, --interactive Keep STDIN open even if not attached
--privileged Give extended privileges to the command
-t, --tty Allocate a pseudo-TTY
-u, --user string Username or UID (format:
<name|uid>[:<group|gid>])
-w, --workdir string Working directory inside the container

eg: docker exec -it 12e /bin/sh

执行上述命令后会会自动连接到目标容易的终端

删除容器

`docker rm -f

创建服务

docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]

强制重启服务

docker service update your_service_name --force

查看service的containerId

for f in $(docker service ps -q t_mserv_base_mq);do docker inspect --format '{{.ServiceID}} {{.NodeID}} {{.Status.ContainerStatus.ContainerID}} {{.DesiredState}}' $f; done

docker 容器可视化

docker pull dockersamples/visualizer:latest
docker service create \
--name=viz \
--publish=12306:8080/tcp \
--constraint=node.role==manager \
--mount=type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
dockersamples/visualizer:latest

DockerFile

COPY SRC DEST

复制src文件到dest

ADD SRC DEST

复制src文件到dest,如果src为压缩文件,怎复制和自动解压

CMD cmd args…

docker run 时运行

RUN cmd args…

docker build时运行,可能

HEX(NUM) -> DECIMAL
int r= (int)(NUM / 10)*16 + NUM%10

日志

docker service logs --help

Usage:  docker service logs [OPTIONS] SERVICE|TASK

Fetch the logs of a service or task

Options:
--details Show extra details provided to logs
-f, --follow Follow log output
--no-resolve Do not map IDs to Names in output
--no-task-ids Do not include task IDs in output
--no-trunc Do not truncate output
--raw Do not neatly format logs
--since string Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)
-n, --tail string Number of lines to show from the end of the logs (default "all")
-t, --timestamps Show timestamps

eg:

查询日志通过服务名

docker service logs t_mserv_xgb_project --since 2022-04-22

查询日志通过taskId

获取服务对应的taskId

docker service ps t_mserv_xgb_project

通过taskId获取日志输出

docker service logs taskId --since 2022-04-22

网上搜索了很多文章都没解决,只好自己动手排查

通过对比可以正常转换的m3u8文件,发现出现问题的文件里少了 #EXTM3U

如果你遇到类似问题不妨检查下你的m3u8文件首行是不是#EXTM3U

0%