소스 검색

deploy pro/realtime-yuewen-v2:r191006 按小时同步日志

pmrd 1 년 전
부모
커밋
2ead523dc6
3개의 변경된 파일57개의 추가작업 그리고 12개의 파일을 삭제
  1. 5 5
      .drone.yml
  2. 1 1
      Dockerfile
  3. 51 6
      deploy-tmp.yaml

+ 5 - 5
.drone.yml

@@ -19,8 +19,8 @@ steps:
   pull: always
   # privileged: true
   environment:
-    JNLP_ENV: qa
-    JNLP_REPLICAS: 1
+    JNLP_ENV: pro
+    JNLP_REPLICAS: 3
     JNLP_TAG: r191006
     JNLP_VERSION: v1  # default v1, v2 for canary
     DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1 or k8s-2
@@ -54,8 +54,8 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline qa/realtime-yuewen-v2:r191006 Success"
-    description: "${DRONE_BUILD_LINK} qa/realtime-yuewen-v2:r191006 部署完成 按小时同步日志"
+    title: "Pipeline pro/realtime-yuewen-v2:r191006 Success"
+    description: "${DRONE_BUILD_LINK} pro/realtime-yuewen-v2:r191006 部署完成 按小时同步日志"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"
   when:
@@ -68,7 +68,7 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline qa/realtime-yuewen-v2:r191006 Failure"
+    title: "Pipeline pro/realtime-yuewen-v2:r191006 Failure"
     description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!按小时同步日志"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"

+ 1 - 1
Dockerfile

@@ -1 +1 @@
-FROM hub.evbj.easou.com/qa/realtime-yuewen-v2:r191006
+FROM hub.evbj.easou.com/pro/realtime-yuewen-v2:r191006

+ 51 - 6
deploy-tmp.yaml

@@ -3,12 +3,12 @@ apiVersion: apps/v1
 kind: StatefulSet
 metadata:
   name: realtime-yuewen-v2
-  namespace: qa
+  namespace: pro
   labels:
     app: realtime-yuewen-v2
 spec:
   serviceName: realtime-yuewen-v2
-  replicas: 1
+  replicas: 3
   selector:
     matchLabels:
       app: realtime-yuewen-v2
@@ -47,7 +47,7 @@ spec:
       #              topologyKey: kubernetes.io/hostname
       containers:
         - name: realtime-yuewen-v2
-          image: hub.evbj.easou.com/qa/realtime-yuewen-v2:r191006
+          image: hub.evbj.easou.com/pro/realtime-yuewen-v2:r191006
           imagePullPolicy: IfNotPresent
           env:
             - name: MY_NODE_NAME
@@ -67,7 +67,7 @@ spec:
                 fieldRef:
                   fieldPath: metadata.namespace
             - name: JAVA_OPTS
-              value: "-server  -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=n  -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=test"
+              value: "-server  -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=product"
           ports:
             - containerPort: 8080
               name: port
@@ -99,7 +99,7 @@ spec:
               port: 8080
             initialDelaySeconds: 40
             periodSeconds: 15
-        - image: hub.evbj.easou.com/dev/flume-test:1.7.0-20230811
+        - image: hub.evbj.easou.com/dev/flume:1.7.0-20230811
           imagePullPolicy: IfNotPresent
           name: flume
           volumeMounts:
@@ -108,6 +108,13 @@ spec:
 #            - name: flume-config
 #              mountPath: /app/soft/flume-1.7.0/conf/flume.conf
 #              subPath: flume.conf
+      volumes:
+        - name: flume-config
+          configMap:
+            name: flume-config-realtime-yuewen-v2
+            items:
+              - key: flume.conf
+                path: flume.conf
 
   volumeClaimTemplates:
     - metadata:
@@ -123,7 +130,7 @@ apiVersion: v1
 kind: Service
 metadata:
   name: realtime-yuewen-v2-svc
-  namespace: qa
+  namespace: pro
   labels:
     app: realtime-yuewen-v2-svc
 spec:
@@ -134,5 +141,43 @@ spec:
       name: "main"
   selector:
     app: realtime-yuewen-v2
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: flume-config-realtime-yuewen-v2
+  namespace: pro
+data:
+  flume.conf: |
+    a1.channels.c1.type = org.apache.flume.channel.kafka.KafkaChannel
+    a1.channels.c1.kafka.bootstrap.servers = 10.26.27.71:8092,10.26.22.102:8092,10.26.22.120:8092,10.26.22.121:8092,10.26.22.122:8092
+    a1.channels.c1.kafka.topic = yuewen_buydetail
+    a1.channels.c1.kafka.consumer.group.id = flume2kafka
+    
+    # Define an Avro source called r1 on a1 and tell it
+    # to bind to 0.0.0.0:41414. Connect it to channel c1.
+    #注意这里分出2个channel出来,一个是到k1,一个到k2
+    #如果这里只出一个channel c1的话,下面2个sink channel都为c1,则消息就会随机分到2个sink上,而不是2个sink都有一份
+    a1.sources.r1.channels = c1
+    a1.sources.r1.type = exec
+    a1.sources.r1.command = tail -F /data/logs/app/access.log
+    a1.sources.r1.restart = true
+    a1.sources.r1.selector.optional = c1
+    a1.sources.r1.batchSize = 100000
+    a1.sources.r1.interceptors = i1 i2 i3
+    a1.sources.r1.interceptors.i1.type = timestamp
+    a1.sources.r1.interceptors.i2.type = host
+    a1.sources.r1.interceptors.i2.useIP = false
+    a1.sources.r1.interceptors.i3.type = regex_filter
+    a1.sources.r1.interceptors.i3.regex = ^\\s*$
+    a1.sources.r1.interceptors.i3.excludeEvents = true
+    #默认是replicationg,还有multiplexer
+    #a1.sources.r1.selector.type = replicationg
+    
+    # Finally, now that we've defined all of our components, tell
+    # a1 which ones we want to activate.
+    a1.sources = r1
+    a1.channels = c1
+    a1.sinks =