搭建skywalking需要用到三个镜像:
elasticsearch:用来存储数据
skywalking-oap-server:Skywalking服务器
skywalking-ui :Skywalking的UI界面

下载镜像

docker pull elasticsearch:7.9.0
docker pull apache/skywalking-oap-server:8.9.1
docker pull apache/skywalking-ui:8.9.1

Docker 单独镜像安装

安装elasticsearch

本机创建持久化目录,官方推荐

mkdir -p /Users/admin/Documents/data/elasticsearch/data
mkdir -p /Users/admin/Documents/data/elasticsearch/logs

持久化启动elasticsearch

安装elasticsearch并挂载文件

docker run -d --name=es7 \
--restart=always \
-p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-v /Users/admin/Documents/data/elasticsearch/data:/usr/share/elasticsearch/data \
-v /Users/admin/Documents/data/elasticsearch/logs:/usr/share/elasticsearch/logs \
elasticsearch:7.9.0

查看启动情况

docker ps -a

查看镜像日志

docker logs -f es7

验证ES

浏览器访问:http://localhost:9200/,返回:

{"name" : "a0455020b01a","cluster_name" : "docker-cluster","cluster_uuid" : "AFy_WI-iQa63pVug9XIUXQ","version" : {"number" : "7.9.0","build_flavor" : "default","build_type" : "docker","build_hash" : "a479a2a7fce0389512d6a9361301708b92dff667","build_date" : "2020-08-11T21:36:48.204330Z","build_snapshot" : false,"lucene_version" : "8.6.0","minimum_wire_compatibility_version" : "6.8.0","minimum_index_compatibility_version" : "6.0.0-beta1"},"tagline" : "You Know, for Search"
}

安装skywalking-oap

需要先安装好es才能安装opa

启动 skywalking-oap

docker run --name oap --restart=always -d \
-e TZ=Asia/Shanghai \
-p 12800:12800 \
-p 11800:11800 \
--link es7:es7 \
-e SW_STORAGE=elasticsearch7 \
-e SW_STORAGE_ES_CLUSTER_NODES=es7:9200 \
apache/skywalking-oap-server:8.9.0

-e TZ=Asia/Shanghai:指定时区。
--link es7:es7:关联es7容器,通过容器名字来解决ip会发生变更的问题。
-e SW_STORAGE=elasticsearch:设置环境变量,指定存储方式。
-e SW_STORAGE_ES_CLUSTER_NODES=es7:9200:设置环境变量,指定ES的地址

登录容器

docker exec -it oap bash

安装skywalking-ui

启动UI

docker run -d --name skywalking-ui \
--restart=always \
-e TZ=Asia/Shanghai \
-p 8088:8080 \
--link oap:oap \
-e SW_OAP_ADDRESS=oap:12800 \
apache/skywalking-ui:8.9.0

访问UI:http://localhost:8088/

docker-compose 安装

编写docker-compose.yml文件

https://github.com/apache/skywalking/tree/master/docker 官网有示例docker-compose.yml文件,我们只需要下载下来修改下即可。

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.version: '3.8'
services:elasticsearch:# image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ES_VERSION}image: elasticsearch:7.9.0container_name: elasticsearch# --restart=always : 开机启动,失败也会一直重启;# --restart=on-failure:10 : 表示最多重启10次restart: alwaysports:- "9200:9200"- "9300:9300"healthcheck:test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ]interval: 30stimeout: 10sretries: 3start_period: 10senvironment:- discovery.type=single-node# 锁定物理内存地址,防止elasticsearch内存被交换出去,也就是避免es使用swap交换分区,频繁的交换,会导致IOPS变高;- bootstrap.memory_lock=true# 设置时区- TZ=Asia/Shanghai# - "ES_JAVA_OPTS=-Xms512m -Xmx512m"ulimits:memlock:soft: -1hard: -1oap:image: apache/skywalking-oap-server:8.9.1container_name: oaprestart: always# 设置依赖的容器depends_on:elasticsearch:condition: service_healthy# 关联ES的容器,通过容器名字来找到相应容器,解决IP变动问题links:- elasticsearch# 端口映射ports:- "11800:11800"- "12800:12800"# 监控检查healthcheck:test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ]# 每间隔30秒执行一次interval: 30s# 健康检查命令运行超时时间,如果超过这个时间,本次健康检查就被视为失败;timeout: 10s# 当连续失败指定次数后,则将容器状态视为 unhealthy,默认 3 次。retries: 3# 应用的启动的初始化时间,在启动过程中的健康检查失效不会计入,默认 0 秒。start_period: 10senvironment:# 指定存储方式SW_STORAGE: elasticsearch# 指定存储的地址SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200SW_HEALTH_CHECKER: defaultSW_TELEMETRY: prometheusTZ: Asia/Shanghai# JAVA_OPTS: "-Xms2048m -Xmx2048m"ui:image: apache/skywalking-ui:8.9.1container_name: skywalking-uirestart: alwaysdepends_on:oap:condition: service_healthylinks:- oapports:- "8088:8080"environment:SW_OAP_ADDRESS: http://oap:12800TZ: Asia/Shanghai

启动容器

切换到docker-compose.yml文件下,然后执行一下命令:

docker-compose up -d

查看启动镜像

docker-compose ps

浏览器验证

访问网址 http://localhost:8088/

下载agent

  1. 下载源码包,然后解压取agent目录
    https://archive.apache.org/dist/skywalking/8.9.1/

    https://skywalking.apache.org/downloads/
    解压获得agent.jar

  2. 修改conf配置文件
    将地址改为skywalking地址

agent.service_name=${SW_AGENT_NAME:Your_ApplicationName}
agent.instance_name=${SW_AGENT_INSTANCE_NAME:}
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800}
  1. 启动文件配置agent
-javaagent:/skywalking-agent/skywalking-agent.jar -Dskywalking.agent.service_name=demoskywalking -Dskywalking.collector.backend_service=127.0.0.1:11800


jar包方式

java -javaagent:/skywalking-agent/agent/skywalking-agent.jar
-Dskywalking.agent.service_name=app-service
-Dskywalking.collector.backend_service=127.0.0.1:11800
-jar app-service.jar &

Docker搭建Skywalking环境相关推荐

  1. 【实战】本机用docker搭建elk环境并接入frostmourne,实现监控报警效果

    本篇文章着重的是实战方面,基于本机使用docker来搭建elk环境,然后接入frostmourne来实现监控.报警.分析系统,后续会再发文来介绍如何将此监控报警发布到生产环境. 本机用docker搭建 ...

  2. docker搭建 LNMP 环境

    一.准备镜像 安装完docker后,更换完镜像源(docker的安装十分简单自行百度即可) 打开/etc/docker目录下的daemon.json 添加以下内容 { "registry-m ...

  3. virtualbox php mac,详解mac下通过docker搭建LEMP环境

    在mac下通过docker搭建LEMP环境境 1.安装virtualbox.由于docker是在lxc环境的容器 2.安装boot2docker,用于与docker客户端通讯 > brew up ...

  4. apt ubuntu 指定ipv4_macOS 下使用 Docker 搭建 ubuntu 环境

    学习网络开发过程中不想"污染"macOS,考虑到之后部署网络应用主要是与linux打交道,所以安装了 ubuntu 虚拟机以满足短期的知识学习需求.十里安装了 ubuntu 虚拟机 ...

  5. docker ubuntu镜像_macOS 下使用 Docker 搭建 ubuntu 环境

    学习网络开发过程中不想"污染"macOS,考虑到之后部署网络应用主要是与linux打交道,所以安装了 ubuntu 虚拟机以满足短期的知识学习需求.十里安装了 ubuntu 虚拟机 ...

  6. Docker - 搭建LNMP环境 - 学习/实践

    1.应用场景 主要用于学习使用docker搭建开发环境. 学习容器化技术. 以及快速搭建开发环境, 同时保持团队之间开发/测试环境相同~~~~ 2.学习/操作 1.文档阅读 Docker - 学习/实 ...

  7. mac docker搭建开发环境

    前言 刚买了一个mac本, 决定搭建一个纯docker的开发环境, 说到做到, 开始踩坑. 搭建 在搭建环境的过程中, 经历了很多错误, 例如为了令两个docker环境可以互通(如: nginx和ph ...

  8. 使用Docker搭建LAMP环境,上线wordpress

    1,环境 系统版本:CentOS Linux release 7.5.1804 docker版本:Docker version 1.13.1 主机IP地址:192.168.116.128 前提条件: ...

  9. 使用docker搭建sqli-lab环境以及upload-labs环境 xss挑战之旅环境 搭建vulhub环境

    sqli-lab环境 1)查找sqli-lab环境 docker search sqli-labs 2)拉取镜像 docker pull acgpiano/sqli-labs 3) docker ru ...

最新文章

  1. JUnit测试类完成后事务是默认 回滚的。只能查询数据,不能增删改。
  2. (转)编译Android源码的全过程
  3. Git的工作流程简介
  4. 动规(LIS)-POJ-2533
  5. Redis整合springboot实现集群模式
  6. STL之函数对象和谓词
  7. 职业生涯中的选择时机非常重要,各种条件还没成熟时的时候,因为诱惑而贸然行事,只会得到适得其反的结果...
  8. Java讲课笔记21:List接口及其实现类
  9. acid事务 mysql_MySQL 事务ACID特性
  10. IPVS使用的Netfilter Hook点
  11. ios手游游戏辅助挂机工具_ios挂机RPG游戏大全_iPhone挂机RPG类手游排行榜_ios挂机RPG类手游精选推荐_ios挂机RP类手游下载...
  12. aida64使用方法_AIDA64中的详细功能使用步骤介绍
  13. Invalid bound statement (not found): com.itheima.mapper.userMapper.SelectAll
  14. (论文加源码)基于时频域特征分析和SVM分类器的DEAP脑电信号情感状态识别(matlab代码)(四分类)
  15. adb 删除文件时提示Read-only file system问题【not in /proc/mounts】
  16. bootstrap自采样再理解
  17. Android SDK简介
  18. ip伪装软件对游戏多开有什么用?
  19. 计算机工程毕业论文任务书,计算机工程毕业设计论文任务书开题报告模板.doc...
  20. Spring相关文章汇总篇【Spring,SpringBoot,SpringCloud等】

热门文章

  1. 四月IDO第四期,12个热门项目即将上线
  2. fl studio2020中文版免费下载激活教程网盘
  3. 处理JSON最强命令jq使用详解
  4. Timed-Elastic-Band局部路径规划算法
  5. 学生-课程数据库—初识sql语句(04)(注释版)
  6. Kotlin ListView设置Adapter
  7. 最新版本交易猫钓鱼源码完整版
  8. 统计单词的数量----Python
  9. matlab自适应amc,自适应调制解调(ACM),Adaptive modulation and coding (AMC),音标,读音,翻译,英文例句,英语词典...
  10. 可逆网络风格迁移-解决内容泄漏问题 [CVPR 2021] ArtFlow: Unbiased Image Style Transfer via Reversible Neural Flows