skywalking部署文档

举报
fsifdds 发表于 2023/08/22 15:35:31 2023/08/22
【摘要】 1、创建skywalking+es#创建docker-compose.yamlversion: '3.3'services: elasticsearch: image: elasticsearch:7.14.2 container_name: elasticsearch restart: unless-stopped ports: - 9200:9200 ...

1、创建skywalking+es

#创建docker-compose.yaml
version: '3.3'
services:
  elasticsearch:
    image: elasticsearch:7.14.2
    container_name: elasticsearch
    restart: unless-stopped
    ports:
      - 9200:9200
      - 9300:9300
    environment:
      - "TAKE_FILE_OWNERSHIP=true" #volumes 挂载权限 如果不想要挂载es文件改配置可以删除
      - "discovery.type=single-node" #单机模式启动
      - "TZ=Asia/Shanghai" # 设置时区
      - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m" # 设置jvm内存大小
    volumes:
      - ./elasticsearch/logs:/usr/share/elasticsearch/logs
      - ./elasticsearch/data:/usr/share/elasticsearch/data
 #     - ./elasticsearch/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - skywalking
  skywalking-oap-server:
    image: apache/skywalking-oap-server:9.4.0
    container_name: skywalking-oap-server
    depends_on:
      - elasticsearch
    links:
      - elasticsearch
    restart: unless-stopped
    ports:
      - 11800:11800
      - 12800:12800
    environment:
      SW_STORAGE: elasticsearch
      SW_ENABLE_UPDATE_UI_TEMPLATE: "true"
      SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
      TZ: Asia/Shanghai
    networks:
      - skywalking
    volumes:
     - ./application.yml:/skywalking/config/application.yml
#     - ./oap/conf/alarm-settings.yml:/skywalking/config/alarm-settings.yml
  skywalking-ui:
    image: apache/skywalking-ui:9.4.0
    container_name: skywalking-ui
    depends_on:
      - skywalking-oap-server
    links:
      - skywalking-oap-server
    restart: unless-stopped
    ports:
      - 8080:8080
    environment:
      SW_OAP_ADDRESS: http://skywalking-oap-server:12800
      SW_ZIPKIN_ADDRESS: http://skywalking-oap-server:9412
      TZ: Asia/Shanghai
    networks:
      - skywalking
 
networks:
  skywalking:
    driver: bridge


2、应用加入skywalking

创建pvc,然后挂载到pod的/home/skywalking,目录放置apache-skywalking-java-agent-8.13.0.tgz的解压包skywalking-agent

yaml文件增加部分是agent挂载还有Java启动参数

    spec:
      containers:
        - env:
            - name: JVM_OPTS
              value: >-
                -javaagent:/home/skywalking/skywalking-agent/skywalking-agent.jar
                -Dskywalking.agent.service_name=<大类,如prod>::<服务名字>
                -Dskywalking.collector.backend_service=ip:11800
          volumeMounts:
            - mountPath: /home/skywalking
              name: skywalking-agent
       volumes:
        - name: skywalking-agent
          persistentVolumeClaim:
            claimName: skywalking-agent 

3、成功实例如下

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。