- 我是在centos7的虚拟机中安装的,首先要安装docker、 docker-compose (这俩尽量安装新一点的版本,否则不支持version3.8的yml)。虚拟机内存要尽量设置大一点,最好是4G.
- docker-compose.yml 如下
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2
container_name: elasticsearch
ports:
- "9200:9200"
healthcheck:
test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "TZ=Asia/Shanghai"
- "ES_JAVA_OPTS=-Xms2g -Xmx2g -XX:-UseConcMarkSweepGC -XX:-UseCMSInitiatingOccupancyOnly -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=75"
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
oap:
image: apache/skywalking-oap-server:8.9.1
container_name: oap
depends_on:
elasticsearch:
condition: service_healthy
links:
- elasticsearch
ports:
- "11800:11800"
- "12800:12800"
healthcheck:
test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
environment:
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
SW_HEALTH_CHECKER: default
SW_TELEMETRY: prometheus
TZ: Asia/Shanghai
JAVA_OPTS: "-Xms1g -Xmx1g -XX:-UseConcMarkSweepGC -XX:-UseCMSInitiatingOccupancyOnly -XX:+UseG1GC -XX:InitiatingHeapOccupancyPercent=75"
SW_KAFKA_FETCHER_SERVERS: 192.168.229.139:9092
SW_KAFKA_FETCHER: 'default'
SW_KAFKA_FETCHER_PARTITIONS_FACTOR: '1'
volumes:
- ./oap/conf/alarm-settings.yml:/skywalking/config/alarm-settings.yml
ui:
image: apache/skywalking-ui:8.9.1
container_name: ui
depends_on:
oap:
condition: service_healthy
links:
- oap
ports:
- "8080:8080"
environment:
SW_OAP_ADDRESS: http://oap:12800
TZ: Asia/Shanghai
-
如果docker-compose不支持version3.8,需要升级。(我升级到的是2.7.0)
-
上述文件中volumes 挂载路径提前创建好,并创建elasticsearch.yml和alarm-settings.yml,不然后续安装的过程中会报错,报错的大概意思是:docker-compose把elasticsearch.yml和alarm-settings.yml当成文件夹去创建了。文章来源:https://www.toymoban.com/news/detail-510709.html
-
在elasticsearch.yml 配置 network.host: 0.0.0.0和 indices.breaker.total.use_real_memory: false, 否则oap会连接es失败文章来源地址https://www.toymoban.com/news/detail-510709.html
到了这里,关于docker-compose安装skywalking的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!