k8s容器云架构之dubbo微服务—全链路监控安装

官方地址:https://github.com/pinpoint-apm/pinpoint-docker

下载这两个文件并修改多余的服务具体修改配置细节参考如下文档即可。

k8s容器云架构之dubbo微服务—全链路监控安装

1.pinpoint服务端安装

[root@iZbp18oiu762o1fteyqxvnZ app]# pwd
/app
[root@iZbp18oiu762o1fteyqxvnZ app]# cat docker-compose.yml 
version: "3.6"

services:
  pinpoint-hbase:
    
    container_name: "${PINPOINT_HBASE_NAME}"
    image: "pinpointdocker/pinpoint-hbase:${PINPOINT_VERSION}"
    networks:
      - pinpoint
    volumes:
      - /home/pinpoint/hbase
      - /home/pinpoint/zookeeper
    expose:
      # HBase Master API port
      - "60000"
      # HBase Master Web UI
      - "16010"
      # Regionserver API port
      - "60020"
      # HBase Regionserver web UI
      - "16030"
    ports:
      - "60000:60000"
      - "16010:16010"
      - "60020:60020"
      - "16030:16030"
    restart: always
    depends_on:
      - zoo1

  pinpoint-mysql:
   
    container_name: pinpoint-mysql
    restart: always
    image: "pinpointdocker/pinpoint-mysql:${PINPOINT_VERSION}"
    hostname: pinpoint-mysql
    ports:
      - "3306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}

    volumes:
      - mysql_data:/var/lib/mysql
    networks:
      - pinpoint

  pinpoint-web:
   

    container_name: "${PINPOINT_WEB_NAME}"
    image: "pinpointdocker/pinpoint-web:${PINPOINT_VERSION}"

    depends_on:
      - pinpoint-hbase
      - pinpoint-mysql
      - zoo1
    restart: always
    expose:
      - "9997"
    ports:
      - "9997:9997"
      - "${SERVER_PORT:-8080}:${SERVER_PORT:-8080}"
    environment:
      - SERVER_PORT=${SERVER_PORT}
      - SPRING_PROFILES_ACTIVE=${SPRING_PROFILES},batch
      - PINPOINT_ZOOKEEPER_ADDRESS=${PINPOINT_ZOOKEEPER_ADDRESS}
      - CLUSTER_ENABLE=${CLUSTER_ENABLE}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - CONFIG_SENDUSAGE=${CONFIG_SENDUSAGE}
      - LOGGING_LEVEL_ROOT=${WEB_LOGGING_LEVEL_ROOT}
      - CONFIG_SHOW_APPLICATIONSTAT=${CONFIG_SHOW_APPLICATIONSTAT}
      - BATCH_ENABLE=${BATCH_ENABLE}
      - BATCH_SERVER_IP=${BATCH_SERVER_IP}
      - BATCH_FLINK_SERVER=${BATCH_FLINK_SERVER}
      - JDBC_DRIVERCLASSNAME=${JDBC_DRIVERCLASSNAME}
      - JDBC_URL=${JDBC_URL}
      - JDBC_USERNAME=${JDBC_USERNAME}
      - JDBC_PASSWORD=${JDBC_PASSWORD}
      - ALARM_MAIL_SERVER_URL=${ALARM_MAIL_SERVER_URL}
      - ALARM_MAIL_SERVER_PORT=${ALARM_MAIL_SERVER_PORT}
      - ALARM_MAIL_SERVER_USERNAME=${ALARM_MAIL_SERVER_USERNAME}
      - ALARM_MAIL_SERVER_PASSWORD=${ALARM_MAIL_SERVER_PASSWORD}
      - ALARM_MAIL_SENDER_ADDRESS=${ALARM_MAIL_SENDER_ADDRESS}
      - ALARM_MAIL_TRANSPORT_PROTOCOL=${ALARM_MAIL_TRANSPORT_PROTOCOL}
      - ALARM_MAIL_SMTP_PORT=${ALARM_MAIL_SMTP_PORT}
      - ALARM_MAIL_SMTP_AUTH=${ALARM_MAIL_SMTP_AUTH}
      - ALARM_MAIL_SMTP_STARTTLS_ENABLE=${ALARM_MAIL_SMTP_STARTTLS_ENABLE}
      - ALARM_MAIL_SMTP_STARTTLS_REQUIRED=${ALARM_MAIL_SMTP_STARTTLS_REQUIRED}
      - ALARM_MAIL_DEBUG=${ALARM_MAIL_DEBUG}
    links:
      - "pinpoint-mysql:pinpoint-mysql"
    networks:
      - pinpoint

  pinpoint-collector:
   

    container_name: "${PINPOINT_COLLECTOR_NAME}"
    image: "pinpointdocker/pinpoint-collector:${PINPOINT_VERSION}"

    depends_on:
      - pinpoint-hbase
      - zoo1
    restart: always
    expose:
      - "9991"
      - "9992"
      - "9993"
      - "9994"
      - "9995"
      - "9996"
    ports:
      - "${COLLECTOR_RECEIVER_GRPC_AGENT_PORT:-9991}:9991/tcp"
      - "${COLLECTOR_RECEIVER_GRPC_STAT_PORT:-9992}:9992/tcp"
      - "${COLLECTOR_RECEIVER_GRPC_SPAN_PORT:-9993}:9993/tcp"
      - "${COLLECTOR_RECEIVER_BASE_PORT:-9994}:9994"
      - "${COLLECTOR_RECEIVER_STAT_UDP_PORT:-9995}:9995/tcp"
      - "${COLLECTOR_RECEIVER_SPAN_UDP_PORT:-9996}:9996/tcp"
      - "${COLLECTOR_RECEIVER_STAT_UDP_PORT:-9995}:9995/udp"
      - "${COLLECTOR_RECEIVER_SPAN_UDP_PORT:-9996}:9996/udp"

    networks:
      - pinpoint
    environment:
      - SPRING_PROFILES_ACTIVE=${SPRING_PROFILES}
      - PINPOINT_ZOOKEEPER_ADDRESS=${PINPOINT_ZOOKEEPER_ADDRESS}
      - CLUSTER_ENABLE=${CLUSTER_ENABLE}
      - LOGGING_LEVEL_ROOT=${COLLECTOR_LOGGING_LEVEL_ROOT}
      - FLINK_CLUSTER_ENABLE=${FLINK_CLUSTER_ENABLE}
      - FLINK_CLUSTER_ZOOKEEPER_ADDRESS=${FLINK_CLUSTER_ZOOKEEPER_ADDRESS}


  #zookeepers
  zoo1:
    image: zookeeper:3.4
    restart: always
    hostname: zoo1
    expose:
      - "2181"
      - "2888"
      - "3888"
    ports:
      - "2181"
    environment:
      ZOO_MY_ID: 1
      ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
    networks:
      - pinpoint

  zoo2:
    image: zookeeper:3.4
    restart: always
    hostname: zoo2
    expose:
      - "2181"
      - "2888"
      - "3888"
    ports:
      - "2181"
    environment:
      ZOO_MY_ID: 2
      ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zoo3:2888:3888
    networks:
      - pinpoint

  zoo3:
    image: zookeeper:3.4
    restart: always
    hostname: zoo3
    expose:
      - "2181"
      - "2888"
      - "3888"
    ports:
      - "2181"
    environment:
      ZOO_MY_ID: 3
      ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=0.0.0.0:2888:3888
    networks:
      - pinpoint


volumes:
  data-volume:
  mysql_data:

networks:
  pinpoint:
    driver: bridge
准备变量.env
[root@iZbp18oiu762o1fteyqxvnZ app]# ls -a
.  ..  docker-compose.yml  .env
[root@iZbp18oiu762o1fteyqxvnZ app]# 

[root@iZbp18oiu762o1fteyqxvnZ app]# cat .env 
PINPOINT_VERSION=2.2.2
SPRING_PROFILES=release
#zookeeper information required
PINPOINT_ZOOKEEPER_ADDRESS=zoo1

### Pinpoint-Hbase

PINPOINT_HBASE_NAME=pinpoint-hbase
#config for hbase in external docker

### Pinpoint-mysql
MYSQL_ROOT_PASSWORD=root123
MYSQL_USER=admin
MYSQL_PASSWORD=admin
MYSQL_DATABASE=pinpoint

### Pinpoint-Web

PINPOINT_WEB_NAME=pinpoint-web

SERVER_PORT=8079

WEB_LOGGING_LEVEL_ROOT=INFO

CLUSTER_ENABLE=true

ADMIN_PASSWORD=admin

#analytics
CONFIG_SENDUSAGE=true

#flink server information required if used
BATCH_ENABLE=false
BATCH_SERVER_IP=127.0.0.1
BATCH_FLINK_SERVER=pinpoint-flink-jobmanager

CONFIG_SHOW_APPLICATIONSTAT=true

#mysql information required if used
JDBC_DRIVERCLASSNAME=com.mysql.jdbc.Driver
JDBC_URL=jdbc:mysql://pinpoint-mysql:3306/pinpoint?characterEncoding=UTF-8
JDBC_USERNAME=admin
JDBC_PASSWORD=admin

#mail server information required if used
ALARM_MAIL_SERVER_URL=smtp.gmail.com
ALARM_MAIL_SERVER_PORT=587
ALARM_MAIL_SERVER_USERNAME=username
ALARM_MAIL_SERVER_PASSWORD=password
ALARM_MAIL_SENDER_ADDRESS=pinpoint_operator@pinpoint.com
ALARM_MAIL_TRANSPORT_PROTOCOL=smtp
ALARM_MAIL_SMTP_PORT=25
ALARM_MAIL_SMTP_AUTH=false
ALARM_MAIL_SMTP_STARTTLS_ENABLE=false
ALARM_MAIL_SMTP_STARTTLS_REQUIRED=false
ALARM_MAIL_DEBUG=false


### Pinpoint-Collector

PINPOINT_COLLECTOR_NAME=pinpoint-collector

CLUSTER_ENABLE=true

COLLECTOR_LOGGING_LEVEL_ROOT=INFO

#grpc
COLLECTOR_RECEIVER_GRPC_AGENT_PORT=9991
COLLECTOR_RECEIVER_GRPC_STAT_PORT=9992
COLLECTOR_RECEIVER_GRPC_SPAN_PORT=9993

#thrift
COLLECTOR_RECEIVER_BASE_PORT=9994
COLLECTOR_RECEIVER_STAT_UDP_PORT=9995
COLLECTOR_RECEIVER_SPAN_UDP_PORT=9996

FLINK_CLUSTER_ENABLE=true
FLINK_CLUSTER_ZOOKEEPER_ADDRESS=zoo1


### Pinpoint-Agent

PINPOINT_AGENT_NAME=pinpoint-agent

#network module(GRPC,THRIFT)
PROFILER_TRANSPORT_MODULE=GRPC

#collector information required
COLLECTOR_IP=pinpoint-collector
PROFILER_TRANSPORT_AGENT_COLLECTOR_PORT=9991
PROFILER_TRANSPORT_METADATA_COLLECTOR_PORT=9991
PROFILER_TRANSPORT_STAT_COLLECTOR_PORT=9992
PROFILER_TRANSPORT_SPAN_COLLECTOR_PORT=9993
COLLECTOR_TCP_PORT=9994
COLLECTOR_STAT_PORT=9995
COLLECTOR_SPAN_PORT=9996

# Set sampling rate. If you set it to N, 1 out of N transaction will be sampled.
PROFILER_SAMPLING_RATE=1

AGENT_ID=app-in-docker
APP_NAME=quickapp

AGENT_DEBUG_LEVEL=INFO


### Pinpoint-flink

PINPOINT_FLINK_NAME=pinpoint-flink
FLINK_WEB_PORT=8081


### Pinpoint-quickstart

APP_PORT=8000

2.pinpoint agent安装

官方下在agent安装包

[root@iZbp1fbq736g1rz0g0lpnmZ app]# ll
总用量 604676
-rw-r--r-- 1 root root      5755 7月   1 17:31 application.yml
-rw-r--r-- 1 root root       550 7月  21 17:56 Dockerfile
-rw-r--r-- 1 root root  23132144 3月   5 15:05 pinpoint-agent-2.2.2.tar.gz //agent安装包
-rw-r--r-- 1 root root     48574 7月  21 15:44 pinpoint.config  //配置文件
-rw-r--r-- 1 root root 150536645 7月  21 16:11 zk_esl_release.jar 



修改配置文件
[root@iZbp1fbq736g1rz0g0lpnmZ app]# cat pinpoint.config |grep 47
profiler.transport.grpc.collector.ip=47.99.185.15  //pinpoint服务端的IP
profiler.collector.ip=47.99.185.15


FROM esl/jdk:1.8.0
COPY zk_esl_release.jar /
ADD pinpoint-agent-2.2.2.tar.gz /
COPY application.yml /
COPY pinpoint.config /pinpoint-agent-2.2.2/profiles/release/
CMD java -javaagent:/pinpoint-agent-2.2.2/pinpoint-bootstrap.jar -Dpinpoint.agentId=YF -Dpinpoint.applicationName=YF_esl_app_1 -jar /zk_esl_release.jar

3.验证

访问:http://IP:8079

k8s容器云架构之dubbo微服务—全链路监控安装

k8s容器云架构之dubbo微服务—全链路监控安装

上一篇:ArcGIS for qml -设置地图和视域中心


下一篇:ZigBee TI ZStack CC2530 3.19 串口02-接收