forked from Thirdparty/wvp
Compare commits
8 Commits
master
...
yunnan-roa
Author | SHA1 | Date |
---|---|---|
axzsd | 090b31f678 | |
axzsd | 3b68a00018 | |
axzsd | c8a9bf78b5 | |
axzsd | 57d94a8e67 | |
axzsd | e3cb461913 | |
axzsd | 9ef65b88ad | |
axzsd | 67028e889f | |
axzsd | c2d22a196e |
|
@ -0,0 +1,19 @@
|
|||
FROM openjdk:8u342-slim
|
||||
LABEL Author="axzsd" \
|
||||
Email="atva725@qq.com" \
|
||||
Description="智慧涉路作业平台视频WVP"
|
||||
|
||||
WORKDIR /opt
|
||||
|
||||
COPY target/*.jar app.jar
|
||||
|
||||
ENV SPRING_PROFILES_ACTIVE="dev"
|
||||
ENV JAVA_OPTIONS "-Xms512m -Xmx1024m \
|
||||
-Dfile.encoding=UTF-8 \
|
||||
-Djava.awt.headless=true \
|
||||
-Dsun.net.client.defaultConnectTimeout=10000 \
|
||||
-Dsun.net.client.defaultReadTimeout=30000"
|
||||
|
||||
|
||||
EXPOSE 80 5061
|
||||
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTIONS -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} app.jar"]
|
|
@ -0,0 +1,44 @@
|
|||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
REGISTRY='registry.cn-chengdu.aliyuncs.com'
|
||||
INTERIOR_REGISTRY='registry-vpc.cn-chengdu.aliyuncs.com'
|
||||
|
||||
IMAGE_NAMESPACE='chkj'
|
||||
IMAGE_NAME='roadbed-iot-vmp-vmanager'
|
||||
|
||||
DOCKER_FILE="builds/Dockerfile-roadbed"
|
||||
K8S_FILE="builds/deploy-roadbed.yml"
|
||||
}
|
||||
|
||||
|
||||
stages {
|
||||
|
||||
stage('compile & buildImage->push') {
|
||||
steps {
|
||||
withMaven(maven: 'M3', jdk: '8') {
|
||||
sh 'mvn clean package -Dmaven.test.skip=true'
|
||||
}
|
||||
withDockerServer([credentialsId: 'chkj-docker-client-cert', uri: 'tcp://8.137.98.119']) {
|
||||
withCredentials([usernamePassword(credentialsId: 'ch-aliyun-registry', passwordVariable: 'DOCKER_PASSWORD', usernameVariable: 'DOCKER_USERNAME')]) {
|
||||
sh 'echo "$DOCKER_PASSWORD" | docker login $INTERIOR_REGISTRY -u "$DOCKER_USERNAME" --password-stdin'
|
||||
sh 'docker build -f $DOCKER_FILE -t $INTERIOR_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID .'
|
||||
sh 'echo "push start..."'
|
||||
sh 'docker push $INTERIOR_REGISTRY/$IMAGE_NAMESPACE/$IMAGE_NAME:$BUILD_ID'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('ack deploy') {
|
||||
agent none
|
||||
steps {
|
||||
configFileProvider([configFile(fileId: '87b5c827-bd51-40af-99f4-31a800614e92', targetLocation: 'K8S-CONFIG', variable: 'KUBECONFIG')]) {
|
||||
sh 'export tag=$BUILD_ID && envsubst < $K8S_FILE | kubectl apply -f -'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: roadbed-iot-vmp-vmanager-api
|
||||
namespace: kube-qa
|
||||
labels:
|
||||
app: roadbed-iot-vmp-vmanager-api
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: roadbed-iot-vmp-vmanager-api
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 25%
|
||||
maxUnavailable: 25%
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: roadbed-iot-vmp-vmanager-api
|
||||
spec:
|
||||
containers:
|
||||
- name: roadbed-iot-vmp-vmanager-api
|
||||
image: ${REGISTRY}/${IMAGE_NAMESPACE}/${IMAGE_NAME}:${tag}
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 80
|
||||
protocol: TCP
|
||||
- name: sip
|
||||
containerPort: 5061
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Shanghai
|
||||
- name: SPRING_PROFILES_ACTIVE
|
||||
value: road
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 10
|
||||
httpGet:
|
||||
scheme: HTTP
|
||||
port: 80
|
||||
path: /actuator/health
|
||||
resources:
|
||||
limits:
|
||||
cpu: 2000m
|
||||
memory: 1024Gi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
volumes:
|
||||
- name: data-volume
|
||||
persistentVolumeClaim:
|
||||
claimName: zhslzy-pvc-nfs
|
||||
dnsPolicy: ClusterFirst
|
||||
imagePullSecrets:
|
||||
- name: ch-aliyun-registry
|
||||
restartPolicy: Always
|
||||
securityContext: { }
|
||||
terminationGracePeriodSeconds: 30
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: roadbed-iot-vmp-vmanager-api
|
||||
namespace: kube-qa
|
||||
labels:
|
||||
name: roadbed-iot-vmp-vmanager-api
|
||||
spec:
|
||||
selector:
|
||||
app: roadbed-iot-vmp-vmanager-api
|
||||
type: NodePort
|
||||
ports:
|
||||
- name: web
|
||||
port: 80
|
||||
targetPort: web
|
||||
protocol: TCP
|
||||
- name: sip
|
||||
port: 5061
|
||||
targetPort: sip
|
||||
protocol: TCP
|
||||
nodePort: 5061
|
66
pom.xml
66
pom.xml
|
@ -41,6 +41,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
|
@ -143,7 +147,10 @@
|
|||
<artifactId>jedis</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -169,4 +176,61 @@
|
|||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>store</id>
|
||||
<url>http://nexus-oss.hengxintec.com/repository/store/</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>store</id>
|
||||
<url>http://nexus-oss.hengxintec.com/repository/store/</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>central</id>
|
||||
<url>https://maven.aliyun.com/repository/central</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>maven-public</id>
|
||||
<url>http://nexus-oss.hengxintec.com/repository/maven-public/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>central</id>
|
||||
<url>https://maven.aliyun.com/repository/central</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>maven-public</id>
|
||||
<url>http://nexus-oss.hengxintec.com/repository/maven-public/</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
//@EnableTransactionManagement
|
||||
//@EnableFeignClients(basePackages = { "com.genersoft.iot.vmp", "org.integrain" })
|
||||
//@ServletComponentScan("com.genersoft.iot.vmp")
|
||||
@EnableAutoConfiguration
|
||||
public class VManageBootstrap extends LogManager {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(VManageBootstrap.class, args);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.genersoft.iot.vmp.gb28181.event.offline;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.connection.Message;
|
||||
import org.springframework.data.redis.listener.KeyExpirationEventMessageListener;
|
||||
|
@ -9,23 +11,25 @@ import org.springframework.stereotype.Component;
|
|||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description:设备心跳超时监听,借助redis过期特性,进行监听,监听到说明设备心跳超时,发送离线事件
|
||||
* @author: swwheihei
|
||||
* @date: 2020年5月6日 上午11:35:46
|
||||
* @date: 2020年5月6日 上午11:35:46
|
||||
*/
|
||||
@Component
|
||||
public class KeepliveTimeoutListener extends KeyExpirationEventMessageListener {
|
||||
|
||||
@Autowired
|
||||
private EventPublisher publisher;
|
||||
@Autowired
|
||||
private EventPublisher publisher;
|
||||
private static final Logger log = LoggerFactory.getLogger(KeepliveTimeoutListener.class);
|
||||
|
||||
public KeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) {
|
||||
super(listenerContainer);
|
||||
}
|
||||
public KeepliveTimeoutListener(RedisMessageListenerContainer listenerContainer) {
|
||||
super(listenerContainer);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 监听失效的key,key格式为keeplive_deviceId
|
||||
*
|
||||
* @param message
|
||||
* @param pattern
|
||||
*/
|
||||
|
@ -33,12 +37,14 @@ public class KeepliveTimeoutListener extends KeyExpirationEventMessageListener {
|
|||
public void onMessage(Message message, byte[] pattern) {
|
||||
// 获取失效的key
|
||||
String expiredKey = message.toString();
|
||||
if(!expiredKey.startsWith(VideoManagerConstants.KEEPLIVEKEY_PREFIX)){
|
||||
System.out.println("收到redis过期监听,但开头不是"+VideoManagerConstants.KEEPLIVEKEY_PREFIX+",忽略");
|
||||
return;
|
||||
if (!expiredKey.startsWith(VideoManagerConstants.KEEPLIVEKEY_PREFIX)) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("收到redis过期监听,但开头不是" + VideoManagerConstants.KEEPLIVEKEY_PREFIX + ",忽略");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
String deviceId = expiredKey.substring(VideoManagerConstants.KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
|
||||
|
||||
String deviceId = expiredKey.substring(VideoManagerConstants.KEEPLIVEKEY_PREFIX.length(), expiredKey.length());
|
||||
publisher.outlineEventPublish(deviceId, VideoManagerConstants.EVENT_OUTLINE_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
spring:
|
||||
application:
|
||||
name: iot-vmp-vmanager
|
||||
# 影子数据存储方式,支持redis、jdbc
|
||||
database: redis
|
||||
# 通信方式,支持kafka、http
|
||||
communicate: http
|
||||
redis:
|
||||
# Redis服务器IP
|
||||
#host: 10.24.20.63
|
||||
host: 117.33.142.185
|
||||
#端口号
|
||||
port: 6369
|
||||
database: 1
|
||||
#访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
|
||||
password: 20221122@dev
|
||||
#超时时间
|
||||
timeout: 10000
|
||||
datasource:
|
||||
name: eiot
|
||||
url: jdbc:mysql://117.33.142.185:3307/eiot_road?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: axzsd110
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
server:
|
||||
port: 80
|
||||
sip:
|
||||
# ip: 10.200.64.63
|
||||
ip: 127.0.0.1
|
||||
port: 5061
|
||||
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
|
||||
# 后两位为行业编码,定义参照附录D.3
|
||||
# 3701020049标识山东济南历下区 信息行业接入
|
||||
domain: 3701020049
|
||||
id: 37010200492000000001
|
||||
# 默认设备认证密码,后续扩展使用设备单独密码
|
||||
password: admin123
|
||||
media:
|
||||
# ip: 10.200.64.88
|
||||
ip: 113.141.178.17
|
||||
port: 10000
|
||||
endpoints:
|
||||
actuator:
|
||||
enabled: false
|
||||
health:
|
||||
enabled: true
|
||||
path: /actuator/health
|
|
@ -0,0 +1,48 @@
|
|||
spring:
|
||||
application:
|
||||
name: iot-vmp-vmanager
|
||||
# 影子数据存储方式,支持redis、jdbc
|
||||
database: redis
|
||||
# 通信方式,支持kafka、http
|
||||
communicate: http
|
||||
redis:
|
||||
# Redis服务器IP
|
||||
#host: 10.24.20.63
|
||||
host: redis.kube-qa.svc.cluster.local
|
||||
#端口号
|
||||
port: 6379
|
||||
database: 1
|
||||
#访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
|
||||
password: 20221122@dev
|
||||
#超时时间
|
||||
timeout: 10000
|
||||
datasource:
|
||||
name: eiot
|
||||
url: jdbc:mysql://mysql-5-0.mysql-5.kube-qa.svc.cluster.local:3306/eiot_road?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: axzsd110
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
server:
|
||||
port: 80
|
||||
sip:
|
||||
# ip: 10.200.64.63
|
||||
ip: 127.0.0.1
|
||||
port: 5061
|
||||
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
|
||||
# 后两位为行业编码,定义参照附录D.3
|
||||
# 3701020049标识山东济南历下区 信息行业接入
|
||||
domain: 3701020049
|
||||
id: 37010200492000000001
|
||||
# 默认设备认证密码,后续扩展使用设备单独密码
|
||||
password: admin123
|
||||
media:
|
||||
# ip: 10.200.64.88
|
||||
ip: zlmediakit-0.zlmediakit.kube-qa.svc.cluster.local
|
||||
port: 10000
|
||||
endpoints:
|
||||
actuator:
|
||||
enabled: false
|
||||
health:
|
||||
enabled: true
|
||||
path: /actuator/health
|
|
@ -1,42 +1,42 @@
|
|||
spring:
|
||||
application:
|
||||
name: iot-vmp-vmanager
|
||||
# 影子数据存储方式,支持redis、jdbc
|
||||
database: redis
|
||||
# 通信方式,支持kafka、http
|
||||
communicate: http
|
||||
redis:
|
||||
# Redis服务器IP
|
||||
#host: 10.24.20.63
|
||||
host: 127.0.0.1
|
||||
#端口号
|
||||
port: 6379
|
||||
datebase: 0
|
||||
#访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
|
||||
password:
|
||||
#超时时间
|
||||
timeout: 10000
|
||||
datasource:
|
||||
name: eiot
|
||||
url: jdbc:mysql://10.24.20.63:3306/eiot?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 123456
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
application:
|
||||
name: iot-vmp-vmanager
|
||||
# 影子数据存储方式,支持redis、jdbc
|
||||
database: redis
|
||||
# 通信方式,支持kafka、http
|
||||
communicate: http
|
||||
redis:
|
||||
# Redis服务器IP
|
||||
#host: 10.24.20.63
|
||||
host: 127.0.0.1
|
||||
#端口号
|
||||
port: 6379
|
||||
datebase: 0
|
||||
#访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接
|
||||
password:
|
||||
#超时时间
|
||||
timeout: 10000
|
||||
datasource:
|
||||
name: eiot
|
||||
url: jdbc:mysql://10.24.20.63:3306/eiot?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 123456
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
server:
|
||||
port: 8080
|
||||
port: 8080
|
||||
sip:
|
||||
# ip: 10.200.64.63
|
||||
ip: 192.168.0.102
|
||||
port: 5060
|
||||
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
|
||||
# 后两位为行业编码,定义参照附录D.3
|
||||
# 3701020049标识山东济南历下区 信息行业接入
|
||||
domain: 3701020049
|
||||
id: 37010200492000000001
|
||||
# 默认设备认证密码,后续扩展使用设备单独密码
|
||||
password: admin123
|
||||
# ip: 10.200.64.63
|
||||
ip: 192.168.0.102
|
||||
port: 5060
|
||||
# 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007)
|
||||
# 后两位为行业编码,定义参照附录D.3
|
||||
# 3701020049标识山东济南历下区 信息行业接入
|
||||
domain: 3701020049
|
||||
id: 37010200492000000001
|
||||
# 默认设备认证密码,后续扩展使用设备单独密码
|
||||
password: admin123
|
||||
media:
|
||||
# ip: 10.200.64.88
|
||||
ip: 192.168.0.102
|
||||
port: 10000
|
||||
# ip: 10.200.64.88
|
||||
ip: 192.168.0.102
|
||||
port: 10000
|
Loading…
Reference in New Issue