.NET---Exceptionless 轻量级的分布式日志管理平台
一、环境准备
1、服务器文件限制
echo "vm.max_map_count=262144" >> /etc/sysctl.conf sysctl -p echo "* soft nofile 65535 * hard nofile 65535" >> /etc/security/limits.conf
2、安装docker和docker-compose
vim docker_install.sh
#/bin/bash curl http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo yum -y install docker-ce [ ! -d /etc/docker ] && mkdir /etc/docker [ ! -d /data/docker ] && mkdir -p /data/docker cat > /etc/docker/daemon.json <<- EOF { "exec-opts": ["native.cgroupdriver=systemd"], "log-driver": "json-file", "log-opts": { "max-size": "100m", "max-file": "3" }, "storage-driver": "overlay2", "storage-opts": [ "overlay2.override_kernel_check=true" ], "data-root": "/data/docker", "max-concurrent-downloads": 5, "storage-driver": "overlay2", "registry-mirrors": [ "https://pf5f57i3.mirror.aliyuncs.com", "http://harbor.xhyun.vip:81" ] } EOF systemctl enable --now docker
bash docker_install.sh
安装1.29.2版的docker-compose
curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose docker-compose --version
二、下载文件、修改配置文件
curl -L https://github.com/exceptionless/Exceptionless/archive/refs/heads/master.zip -o Exceptionless.zip unzip Exceptionless.zip -d /data/ cd /data/Exceptionless-master
vim docker-compose.yml #本机IP:192.168.10.40
version: ‘3.7‘
services:
api:
depends_on:
- elasticsearch
- redis
build:
context: .
target: api
image: exceptionless/api:latest
container_name: exceptionless_api
environment:
EX_AppMode: Production
EX_ConnectionStrings__Cache: provider=redis
EX_ConnectionStrings__Elasticsearch: server=http://192.168.10.40:9200
EX_ConnectionStrings__MessageBus: provider=redis
EX_ConnectionStrings__Queue: provider=redis
EX_ConnectionStrings__Redis: server=192.168.10.40:6379,abortConnect=false
EX_RunJobsInProcess: ‘false‘
EX_MaximumRetentionDays: 2 #最大保留天数
ports:
- 5000:80
volumes:
- appdata:/app/storage
shm_size: ‘10gb‘
jobs:
depends_on:
- api
image: exceptionless/job:latest
container_name: exceptionless_jobs
build:
context: .
target: job
environment:
EX_AppMode: Production
EX_BaseURL: http://192.168.10.40:5000
EX_ConnectionStrings__Cache: provider=redis
EX_ConnectionStrings__Elasticsearch: server=http://192.168.10.40:9200
EX_ConnectionStrings__MessageBus: provider=redis
EX_ConnectionStrings__Queue: provider=redis
EX_ConnectionStrings__Redis: server=192.168.10.40:6379,abortConnect=false
EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
EX_MaximumRetentionDays: 2
volumes:
- appdata:/app/storage
shm_size: ‘8gb‘
elasticsearch:
image: exceptionless/elasticsearch:7.10.0
container_name: elasticsearch
environment:
discovery.type: single-node
xpack.security.enabled: ‘false‘
ES_JAVA_OPTS: -Xms1g -Xmx8g
ports:
- 9200:9200
- 9300:9300
volumes:
- esdata7:/usr/share/elasticsearch/data
# kibana:
# depends_on:
# - elasticsearch
# image: docker.elastic.co/kibana/kibana:7.10.0
# container_name: kibana
# ports:
# - 5601:5601
redis:
image: redis:6.0-alpine
container_name: redis
ports:
- 6379:6379
ui:
image: exceptionless/ui:latest
environment:
AppMode: Production
EX_ApiUrl: http://192.168.10.40:5000
ports:
- 55001:80 # This can be commented out if using reverse proxy.
shm_size: ‘2gb‘
volumes:
esdata7:
driver: local
appdata:
driver: local
docker-compose up -d