Skip to content

Commit 446f2e2

Browse files
authored
Merge pull request #16 from infocyph/feature/multi-stack
Feature/multi stack
2 parents b833de3 + 5caadac commit 446f2e2

15 files changed

Lines changed: 113 additions & 10 deletions

File tree

.gitignore

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
.idea
2-
.env
3-
*~
4-
Local
5-
*.txt
6-
!docs/requirements.txt
1+
*
2+
!bin
3+
!configuration
4+
!data/.gitignore
5+
!docker/compose
6+
!docker/conf
7+
!docker/dockerfiles
8+
!docs
9+
!logs
10+
!.gitignore
11+
!.gitattributes
12+
!.readthedocs.yaml
13+
!lds
14+
!lds.bat
15+
!LICENSE
16+
!README.md

docker/compose/companion.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ services:
2323
networks:
2424
backend:
2525
ipv4_address: 172.29.0.10
26+
datastore:
27+
ipv4_address: 172.30.0.10
2628

2729
runner:
2830
container_name: RUNNER
@@ -36,7 +38,17 @@ services:
3638
- ../../configuration/scheduler/cron-jobs:/etc/cron.d:ro
3739
- ../../logs/runner:/var/log/supervisor
3840
- ../../logs/apache:/global/log/apache
41+
- ../../logs/cloudbeaver:/global/log/cloudbeaver
42+
- ../../logs/elasticsearch:/global/log/elasticsearch
43+
- ../../logs/kibana:/global/log/kibana
44+
- ../../logs/mariadb:/global/log/mariadb
45+
- ../../logs/mongo-express:/global/log/mongo-express
46+
- ../../logs/mongodb:/global/log/mongodb
47+
- ../../logs/mysql:/global/log/mysql
3948
- ../../logs/nginx:/global/log/nginx
49+
- ../../logs/postgresql:/global/log/postgresql
50+
- ../../logs/redis:/global/log/redis
51+
- ../../logs/redis-insight:/global/log/redis-insight
4052
- /var/run/docker.sock:/var/run/docker.sock
4153
depends_on:
4254
- server-tools

docker/compose/db-client.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ services:
1717
- RI_REDIS_HOST=redis
1818
volumes:
1919
- ../../data/redis-insight:/data
20+
- ../../logs/redis-insight:/var/log/redis-insight
2021
networks:
2122
datastore:
2223
ipv4_address: 172.30.0.150
@@ -33,6 +34,7 @@ services:
3334
- TZ=${TZ:-}
3435
volumes:
3536
- ../../data/cloudbeaver:/opt/cloudbeaver/workspace
37+
- ../../logs/cloudbeaver:/opt/cloudbeaver/logs
3638
networks:
3739
datastore:
3840
ipv4_address: 172.30.0.151
@@ -53,6 +55,8 @@ services:
5355
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGODB_ROOT_USERNAME:-root}
5456
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGODB_ROOT_PASSWORD:-12345}
5557
- ME_CONFIG_MONGODB_URL=mongodb://${MONGODB_ROOT_USERNAME:-root}:${MONGODB_ROOT_PASSWORD:-12345}@mongodb:${MONGODB_PORT:-27017}/admin
58+
volumes:
59+
- ../../logs/mongo-express:/var/log/mongo-express
5660
networks:
5761
datastore:
5862
ipv4_address: 172.30.0.152
@@ -63,7 +67,7 @@ services:
6367
<<: *db-client-service
6468
container_name: KIBANA
6569
hostname: kibana
66-
image: kibana:${ELASTICSEARCH_VERSION:-9.2.4}
70+
image: kibana:${ELASTICSEARCH_VERSION:-9.3.0}
6771
profiles: [elasticsearch]
6872
depends_on:
6973
- elasticsearch
@@ -72,8 +76,26 @@ services:
7276
- "ELASTICSEARCH_HOSTS=http://elasticsearch:9200"
7377
volumes:
7478
- ../../data/kibana:/usr/share/kibana/data
79+
- ../../logs/kibana:/usr/share/kibana/logs
7580
networks:
7681
datastore:
7782
ipv4_address: 172.30.0.153
7883
frontend:
7984
ipv4_address: 172.28.0.153
85+
86+
filebeat:
87+
image: docker.elastic.co/beats/filebeat:${ELASTICSEARCH_VERSION:-9.3.0}
88+
container_name: FILEBEAT
89+
restart: unless-stopped
90+
user: root
91+
profiles: [elasticsearch]
92+
depends_on:
93+
- elasticsearch
94+
volumes:
95+
- ../conf/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
96+
- ../../logs:/global/log:ro
97+
- ../../data/filebeat:/usr/share/filebeat/data
98+
command: ["--strict.perms=false"]
99+
networks:
100+
datastore:
101+
ipv4_address: 172.30.0.154

docker/compose/db.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ services:
1212
profiles: [redis]
1313
volumes:
1414
- ../../data/redis:/data
15+
- ../../logs/redis:/var/log/redis
1516
environment:
1617
- TZ=${TZ:-}
1718
- REDIS_ARGS=--save 10 1 --appendonly yes
@@ -37,6 +38,7 @@ services:
3738
- POSTGRES_DB=${POSTGRES_DATABASE:-postgres}
3839
volumes:
3940
- ../../data/postgresql:/var/lib/postgresql
41+
- ../../logs/postgresql:/var/log/postgresql
4042
- ../conf/pg_hba.conf:/etc/postgresql/pg_hba.conf
4143
# - ../conf/postgresql.conf:/etc/postgresql/postgresql.conf
4244
command:
@@ -94,6 +96,7 @@ services:
9496
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ROOT_PASSWORD:-12345}
9597
volumes:
9698
- ../../data/mongo:/data/db
99+
- ../../logs/mongodb:/var/log/mongodb
97100
healthcheck:
98101
test:
99102
[
@@ -135,7 +138,7 @@ services:
135138
<<: *db-service
136139
container_name: ELASTICSEARCH
137140
hostname: elasticsearch
138-
image: elasticsearch:${ELASTICSEARCH_VERSION:-9.2.4}
141+
image: elasticsearch:${ELASTICSEARCH_VERSION:-9.3.0}
139142
profiles: [elasticsearch]
140143
environment:
141144
- TZ=${TZ:-}
@@ -145,6 +148,7 @@ services:
145148
- "node.name=elasticsearch-node-single"
146149
volumes:
147150
- ../../data/elasticsearch:/usr/share/elasticsearch/data
151+
- ../../logs/elasticsearch:/usr/share/elasticsearch/logs
148152
healthcheck:
149153
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
150154
interval: 30s

docker/conf/filebeat.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
filebeat.inputs:
2+
- type: filestream
3+
id: lds-global-logs
4+
enabled: true
5+
paths:
6+
- /global/log/*/*.log
7+
- /global/log/*/*/*.log
8+
exclude_files: ['-\d{8}(\.gz)?$']
9+
processors:
10+
- dissect:
11+
tokenizer: "/global/log/%{service}/%{file}"
12+
field: "log.file.path"
13+
target_prefix: ""
14+
- convert:
15+
fields:
16+
- {from: "service", to: "service", type: "string"}
17+
ignore_missing: true
18+
fail_on_error: false
19+
output.elasticsearch:
20+
hosts: ["http://elasticsearch:9200"]
21+
index: "lds-%{[service]}-%{+yyyyMMdd}"
22+
setup.template.enabled: true
23+
setup.template.name: "lds"
24+
setup.template.pattern: "lds-*-*"
25+
setup.template.overwrite: false
26+
setup.dashboards.enabled: true
27+
setup.dashboards.retry.enabled: true
28+
setup.dashboards.retry.interval: 10s
29+
setup.dashboards.retry.maximum: 30
30+
setup.kibana:
31+
host: "http://kibana:5601"

lds

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ fix_perms() {
371371
chmod 2777 "$DIR/data"
372372
mkdir -p "$DIR/data/cloudbeaver" "$DIR/data/mysql" "$DIR/data/postgresql" "$DIR/data/mongo" \
373373
"$DIR/data/mariadb" "$DIR/data/elasticsearch" "$DIR/data/redis" "$DIR/data/mailpit" \
374-
"$DIR/data/redis-insight" "$DIR/data/kibana"
374+
"$DIR/data/redis-insight" "$DIR/data/kibana" "$DIR/data/filebeat"
375375
find "$DIR/data" -mindepth 1 -maxdepth 1 -type d -exec chmod 2777 {} +
376376
find "$DIR/data" -type f -exec chmod 666 {} +
377377

@@ -469,7 +469,7 @@ declare -A SERVICES=(
469469
declare -a SERVICE_ORDER=(POSTGRESQL MYSQL MARIADB ELASTICSEARCH MONGODB REDIS)
470470

471471
declare -A PROFILE_ENV=(
472-
[elasticsearch]="ELASTICSEARCH_VERSION=9.2.4"
472+
[elasticsearch]="ELASTICSEARCH_VERSION=9.3.0"
473473
[mysql]="MYSQL_VERSION=latest MYSQL_ROOT_PASSWORD=12345 MYSQL_USER=infocyph MYSQL_PASSWORD=12345 MYSQL_DATABASE=localdb"
474474
[mariadb]="MARIADB_VERSION=latest MARIADB_ROOT_PASSWORD=12345 MARIADB_USER=infocyph MARIADB_PASSWORD=12345 MARIADB_DATABASE=localdb"
475475
[mongodb]="MONGODB_VERSION=latest MONGODB_ROOT_USERNAME=root MONGODB_ROOT_PASSWORD=12345"

logs/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,13 @@
44
!nginx
55
!mariadb
66
!mysql
7+
!cloudbeaver
8+
!kibana
9+
!mongo-express
10+
!redis-insight
11+
!elasticsearch
12+
!mongodb
13+
!postgresql
14+
!redis
715
!olds
816
!.gitignore

logs/cloudbeaver/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

logs/elasticsearch/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

logs/kibana/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)