https://github.com/apache/skywalking-docker/tree/master/6/6.5

https://hub.docker.com/r/apache/skywalking-oap-server
https://hub.docker.com/r/apache/skywalking-ui

mkdir /opt/skywalking-oap-server

wget -P /opt/skywalking-oap-server https://github.com/apache/skywalking-docker/blob/master/6/6.5/oap/docker-entrypoint.sh

wget -P /opt/skywalking-oap-server https://github.com/apache/skywalking-docker/blob/master/6/6.5/oap/log4j2.xml

vim /opt/skywalking-oap-server/Dockerfile

FROM apache/skywalking-oap-server:6.5.0
EXPOSE 12800 11800 1234

vim /opt/skywalking-oap-server/docker-compose.yml

es:

非docker版 目前已经支持es7.x,需配置成

storage:
elasticsearch7: 以下是es6
version: '3.3'
services:
oap:
image: v-skywalking-oap-server
container_name: skywalking-oap-server
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 11800:11800
- 12800:12800
- 1234:1234
environment:
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: 192.168.1.101:9200

mysql:

version: '3.3'
services:
oap:
image: v-skywalking-oap-server
container_name: skywalking-oap-server
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 11800:11800
- 12800:12800
- 1234:1234
environment:
SW_STORAGE: mysql
SW_JDBC_URL: "jdbc:mysql://192.168.0.101:3306/skywalking?useSSL=false"
SW_DATA_SOURCE_USER: root
SW_DATA_SOURCE_PASSWORD: root
SW_DATA_SOURCE_CACHE_PREP_STMTS: "true"
SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE: 250
SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT: 2048
SW_DATA_SOURCE_USE_SERVER_PREP_STMTS: "true"
SW_STORAGE_MYSQL_QUERY_MAX_SIZE: 5000
volumes:
- ./oap-libs/mysql-connector-java-5.1.47.jar:/skywalking/oap-libs/mysql-connector-java-5.1.47.jar

若以nacos作为集群模式

nacos的docker-compose配置
https://github.com/apache/skywalking-docker/blob/master/6/6.5/oap/docker-entrypoint.sh

generateClusterNacos() {
cat <<EOT >> ${var_application_file}
cluster:
nacos:
serviceName: \${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
hostPort: \${SW_CLUSTER_NACOS_HOST_PORT:nacos:}
namespace: \${SW_CLUSTER_NACOS_NAMESPACE:nacos:"public"}
EOT
}

SW_CLUSTER: nacos
默认standalone

version: '3.3'
services:
oap:
image: v-skywalking-oap-server
container_name: skywalking-oap-server
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 11800:11800
- 12800:12800
- 1234:1234
environment:
SW_CORE_GRPC_HOST: 0.0.0.0
SW_CORE_GRPC_PORT: 11800
SW_CORE_REST_HOST: 0.0.0.0
SW_CORE_REST_PORT: 12800
SW_STORAGE: mysql
SW_JDBC_URL: "jdbc:mysql://mysqlserver:3306/skywalking?useSSL=false"
SW_DATA_SOURCE_USER: root
SW_DATA_SOURCE_PASSWORD: root
SW_DATA_SOURCE_CACHE_PREP_STMTS: "true"
SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE: 250
SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT: 2048
SW_DATA_SOURCE_USE_SERVER_PREP_STMTS: "true"
SW_STORAGE_MYSQL_QUERY_MAX_SIZE: 5000
SW_CLUSTER: nacos
SW_SERVICE_NAME: SkyWalking_OAP_Cluster
SW_CLUSTER_NACOS_HOST_PORT: nacosserver:8848
SW_CLUSTER_NACOS_NAMESPACE: public
SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR: "true"
SW_CORE_DATA_KEEPER_EXECUTE_PERIOD: 5
SW_CORE_RECORD_DATA_TTL: 90
SW_CORE_MINUTE_METRIC_DATA_TTL: 90
SW_CORE_HOUR_METRIC_DATA_TTL: 36
SW_CORE_DAY_METRIC_DATA_TTL: 45
SW_CORE_MONTH_METRIC_DATA_TTL: 18
SW_CORE_ENABLE_DATABASE_SESSION: "true"
volumes:
- ./oap-libs/mysql-connector-java-5.1.47.jar:/skywalking/oap-libs/mysql-connector-java-5.1.47.jar
extra_hosts:
- "mysqlserver:192.168.0.101"
- "nacosserver:192.168.0.101"

下载mysql-connector-java-5.1.47.jar

wget -P /opt/downloads https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.47.tar.gz
mkdir /opt/skywalking-oap-server/oap-libs
tar zxvf /opt/downloads/mysql-connector-java-5.1.47.tar.gz -C /opt/skywalking-oap-server/oap-libs
cp /opt/skywalking-oap-server/oap-libs/mysql-connector-java-5.1.47/mysql-connector-java-5.1.47.jar /opt/skywalking-oap-server/oap-libs/
rm -rf /opt/skywalking-oap-server/oap-libs/mysql-connector-java-5.1.47

在Mysql创建skywalking库

初始化mysql脚本

mkdir /opt/skywalking-oap-server/bin/

vim /opt/skywalking-oap-server/bin/oapServiceInit.sh

#!/usr/bin/env sh

PRG="$0"
PRGDIR=`dirname "$PRG"`
[ -z "$OAP_HOME" ] && OAP_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` OAP_LOG_DIR="${OAP_HOME}/logs"
JAVA_OPTS=" -Xms256M -Xmx512M" if [ ! -d "${OAP_HOME}/logs" ]; then
mkdir -p "${OAP_LOG_DIR}"
fi _RUNJAVA=${JAVA_HOME}/bin/java
[ -z "$JAVA_HOME" ] && _RUNJAVA=java CLASSPATH="$OAP_HOME/config:$CLASSPATH"
for i in "$OAP_HOME"/oap-libs/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done OAP_OPTIONS=" -Doap.logDir=${OAP_LOG_DIR}" eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} ${OAP_OPTIONS} -classpath $CLASSPATH -Dmode=init org.apache.skywalking.oap.server.starter.OAPServerStartUp \
2>${OAP_LOG_DIR}/oap.log 1> /dev/null &" if [ $? -eq 0 ]; then
sleep 1
echo "SkyWalking OAP started successfully!"
else
echo "SkyWalking OAP started failure!"
exit 1
fi

存储参考:https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/backend-storage.md

cd /opt/skywalking-oap-server
docker-compose build
docker-compose up -d --force-recreate
docker-compose down
docker-compose restart

查看日志
docker logs --tail="500" skywalking-oap-server

必须在容器启动后进入容器后执行初始化脚本:

docker exec -it skywalking-oap-server /bin/bash
chmod 777 /skywalking/bin/oapServiceInit.sh
/skywalking/bin/oapServiceInit.sh

复制出配置

docker cp skywalking-oap-server:/skywalking/config/application.yml /opt/skywalking-oap-server/application_bak.yml

--------------------------------------------------------------------

mkdir /opt/skywalking-ui

wget -P /opt/skywalking-ui https://github.com/apache/skywalking-docker/blob/master/6/6.3/ui/docker-entrypoint.sh

wget -P /opt/skywalking-ui https://github.com/apache/skywalking-docker/blob/master/6/6.3/ui/logback.xml

vim /opt/skywalking-ui/Dockerfile

FROM apache/skywalking-ui:6.5.0
EXPOSE 8080

vim /opt/skywalking-ui/docker-compose.yml

version: '3.3'
services:
oap:
image: v-skywalking-ui
restart: always
container_name: skywalking-ui
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 11880:8080
environment:
SW_OAP_ADDRESS: skywalkingoapserver:12800
extra_hosts:
- "skywalkingoapserver:192.168.0.101"

SW_OAP_ADDRESS可以是oap集群的多个地址


ui的路径为/skywalking/webapp/webapp.yml

cd /opt/skywalking-ui
docker-compose build
docker-compose up -d --force-recreate
docker-compose down
docker-compose restart

查看日志
docker logs --tail="500" skywalking-ui

进入容器
docker exec -it skywalking-ui /bin/bash

复制出配置

docker cp skywalking-ui:/skywalking/webapp/webapp.yml /opt/skywalking-ui/webapp_bak.yml

需要agent时安装包下载地址:http://skywalking.apache.org/downloads/

agent集群配置

collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.168.0.101:11800,192.168.0.102:11800}

注:java程序部署在docker里 spring.cloud.sentinel.transport.client-ip 就需设置了

skywalking安装运行(docker)的更多相关文章

  1. Docker——MacOS上安装运行docker

    近几年来,Docker越来越流行,使用场景也越来越广泛.为了能尽快跟上时代步伐.学习并应用到实际工作中,我也开始了Docker之旅. Docker版本 Docker共有两种版本: 社区版(Commun ...

  2. TICK/TIGK运维栈安装运行 docker【中】

    InfluxDB docker search influxdb docker pull influxdb docker run -d -p 8086:8086 -v /var/lib/influxdb ...

  3. elastic stack安装运行(docker)

    https://www.docker.elastic.co 注:目前阿里云为7.4 elasticsearch 参考https://www.elastic.co/guide/en/elasticsea ...

  4. Centos7基于容器安装运行Docker私有仓库及添加认证

    一.前言 官方的Docker hub是一个用于管理公共镜像的好地方,我们可以在上面找到我们想要的镜像,也可以把我们自己的镜像推送上去.但是,有时候,我们的使用场景需要我们拥有一个私有的镜像仓库用于管理 ...

  5. kafka安装运行(docker)

    zookeeper参照https://www.cnblogs.com/wintersoft/p/11128484.html mkdir /opt/kafka -pvim /opt/kafka/Dock ...

  6. zookeeper安装运行(docker)

    拉取镜像docker pull zookeeper:latest 获取镜像基本信息docker inspect zookeeper mkdir /opt/zookeeper -p vim /opt/z ...

  7. Linux通过docker安装运行酷Q--用QQ骰子君进行跑团

    Linux通过docker安装运行酷Q 文:铁乐与猫 需求:和小伙伴周末进行愉快的TRPG跑团,需要在QQ讨论组上加了qq小号后,将qq小号用酷Q配合投骰的应用变成骰子君. 限制:我个人的云计算服务器 ...

  8. windows使用docker运行mysql等工具(二)安装运行mysql

    今天接着上一篇的内容继续来学习安装运行mysql.建议先阅读第一篇:windows安装docker 一 查看mysql版本 如果想知道mysql镜像具体有哪几个版本,需要去docker hub查看. ...

  9. docker下安装运行mysql的过程以mysql5.7为例

    一.查找mysql资源 docker search mysql 其实这步顶多是看看有哪些mysql资源,除非你自己commit过一个特定的版本,否则直接执行下一步 二.安装mysql docker p ...

随机推荐

  1. insmod/rmmod

    insmod -f 不检查目前kernel版本与模块编译时的kernel版本是否一致,强制将模块载入 -k 将模块设置为自动卸除 -m 输出模块的载入信息 -o <模块名称> 指定模块的名 ...

  2. unity shader入门(一):基本结构话痨版

    unity shader 有三种形式:表面着色器(Surface Shader),顶点/片元着色器(Vertex/Fragment Shader),固定函数着色器(Fixed Function Sha ...

  3. 【BBED】编译及基本命令(1)

    [BBED]编译及基本命令(1) 一.1  BLOG文档结构图       一.2  前言部分   一.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你 ...

  4. cpython多进程

    四 同步\异步and阻塞\非阻塞(重点) 同步: #所谓同步,就是在发出一个功能调用时,在没有得到结果之前,该调用就不会返回.按照这个定义,其实绝大多数函数都是同步调用.但是一般而言,我们在说同步.异 ...

  5. Flask入门很轻松 (一)

    转载请在文章开头附上原文链接地址:https://www.cnblogs.com/Sunzz/p/10956837.html Flask诞生于2010年,是Armin ronacher(人名)用 Py ...

  6. centos7 ipython安装

    ##下载yum源(Centos 7 为例)[root@localhost ~]# wget http://mirror.centos.org/centos/7/extras/x86_64/Packag ...

  7. python3使用WSGI启动服务

    WSGI是Web Server Gateway Interface的简称.它不是服务器,python模块,框架,API和任何种类的软件.它仅仅是一个服务器和应用间的接口规范. from wsgiref ...

  8. C++——STL(算法)

    以下对所有算法进行细致分类并标明功能:<一>查找算法(13个):判断容器中是否包含某个值adjacent_find:   在iterator对标识元素范围内,查找一对相邻重复元素,找到则返 ...

  9. Codeforces E. Alyona and a tree(二分树上差分)

    题目描述: Alyona and a tree time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  10. 解决SELinux导致Apache更改端口后无法启动的问题

    systemctl start httpd    # 将Apache的默认端口改为90后,启动Apache时提示失败 systemctl status httpd    # 查看Apache的状态 可 ...