Skip to content

Commit

Permalink
simplified docker-compose.yml
Browse files Browse the repository at this point in the history
-> only start one OS instance by default
-> use volumes for the OS data
  • Loading branch information
mammo0 committed Feb 14, 2024
1 parent c6bc64b commit 247ee37
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 84 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# the following files and directories are not needed for building the image
/.*
/es_data
/pcaps
/docker-compose.*
/LICENSE
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ You can use `docker-compose` if you want to setup OpenSearch together with Arkim
sysctl -w vm.max_map_count=262144
```

3. Run `chmod -R 777 os_data` **OR** `chown -R 1000:1000 os_data`. This is needed for the OpenSearch containers to be able to write to that direcotry.

#### Start
Simply run
```shell
docker-compose up -d
```
*It can take some time until the OpenSearch instances are fully started.*
*It can take some time until the OpenSearch instance(s) is/are fully started.*

The Arkime viewer instance can be accessed via

Expand Down
18 changes: 4 additions & 14 deletions docker-compose.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,14 @@
OS_VERSION=2.11.1

# the names of the OS nodes
# currently 3 instances are started
OS_NODE1=os01
OS_NODE2=os02
OS_NODE3=os03
# uncomment to create a cluster (more nodes can be added also)
# !!! do not forget to also adjust the docker-compose.yml file !!!
# OS_NODE2=os02

# specify how much memory should one OS instance get
# keep in mind that currently 3 instances are started!
# specify how much memory should one OS instance should get
OS_JAVA_MEM=512m

# the data of OS is stored in this direcotry
# it's recommended to store it on a SSD
# please note:
# 1. this directory MUST contain 3 sub-directories with the names of the OS
# nodes above or just copy the directory to the SSD and set the path here
# 2. this direcotry and especially the sub-directories must have file
# permissions 777 set. Or they must be owned by user AND group 1000.
OS_DATA_DIR=./os_data


# Arkime settings
#################
Expand Down
104 changes: 53 additions & 51 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,69 @@
x-os_instance: &_os_instance
image: opensearchproject/opensearch:$OS_VERSION
ulimits:
nofile:
soft: 65535
hard: 65535
memlock:
soft: -1
hard: -1
networks:
- arkime-os


services:
os01:
<<: *_os_instance
image: opensearchproject/opensearch:$OS_VERSION
ulimits:
nofile:
soft: 65535
hard: 65535
memlock:
soft: -1
hard: -1
container_name: $OS_NODE1
environment:
- node.name=$OS_NODE1
- discovery.seed_hosts=$OS_NODE2,$OS_NODE3
# default
- cluster.name=os-arkime-cluster
- cluster.initial_master_nodes=$OS_NODE1,$OS_NODE2,$OS_NODE3
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms$OS_JAVA_MEM -Xmx$OS_JAVA_MEM"
- DISABLE_SECURITY_PLUGIN=true
- DISABLE_INSTALL_DEMO_CONFIG=true
volumes:
- $OS_DATA_DIR/$OS_NODE1:/usr/share/opensearch/data
os02:
<<: *_os_instance
container_name: $OS_NODE2
environment:
- node.name=$OS_NODE2
- discovery.seed_hosts=$OS_NODE1,$OS_NODE3
# default
- cluster.name=os-arkime-cluster
- cluster.initial_master_nodes=$OS_NODE1,$OS_NODE2,$OS_NODE3
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms$OS_JAVA_MEM -Xmx$OS_JAVA_MEM"
- DISABLE_SECURITY_PLUGIN=true
- DISABLE_INSTALL_DEMO_CONFIG=true
volumes:
- $OS_DATA_DIR/$OS_NODE2:/usr/share/opensearch/data
os03:
<<: *_os_instance
container_name: $OS_NODE3
environment:
- node.name=$OS_NODE3
- discovery.seed_hosts=$OS_NODE1,$OS_NODE2
# default
- cluster.name=os-arkime-cluster
- cluster.initial_master_nodes=$OS_NODE1,$OS_NODE2,$OS_NODE3
- bootstrap.memory_lock=true
- "OPENSEARCH_JAVA_OPTS=-Xms$OS_JAVA_MEM -Xmx$OS_JAVA_MEM"
- DISABLE_SECURITY_PLUGIN=true
- DISABLE_INSTALL_DEMO_CONFIG=true

# comment this if an OS cluster should be created
- discovery.type=single-node
# uncomment this if an OS cluster should be created
# also add other OS node containers to this compose file
# - cluster.name=os-arkime-cluster
# - cluster.initial_cluster_manager_nodes=$OS_NODE1
# this variable must contain the names (comma-separated) of the OTHER (excluding this container) OS node containers that are part of the cluster
# - discovery.seed_hosts=$OS_NODE2
volumes:
- $OS_DATA_DIR/$OS_NODE3:/usr/share/opensearch/data
- os01_data:/usr/share/opensearch/data
networks:
- arkime-os
# uncomment to add another OS node container and create a cluster
# additional some modifications to the "environment" section of the os01 container must be made
# os02:
# image: opensearchproject/opensearch:$OS_VERSION
# ulimits:
# nofile:
# soft: 65535
# hard: 65535
# memlock:
# soft: -1
# hard: -1
# container_name: $OS_NODE2
# environment:
# - node.name=$OS_NODE2
# - bootstrap.memory_lock=true
# - "OPENSEARCH_JAVA_OPTS=-Xms$OS_JAVA_MEM -Xmx$OS_JAVA_MEM"
# - DISABLE_SECURITY_PLUGIN=true
# - DISABLE_INSTALL_DEMO_CONFIG=true

# # cluster settings
# - cluster.name=os-arkime-cluster
# # this variable must contain the names (comma-separated) of the OTHER (excluding this container) OS node containers that are part of the cluster
# - discovery.seed_hosts=$OS_NODE1
# volumes:
# - os02_data:/usr/share/opensearch/data
# networks:
# - arkime-os

arkime:
build:
context: .
dockerfile: Dockerfile
depends_on:
- $OS_NODE1
- $OS_NODE2
- $OS_NODE3
# uncomment and add all OS node container names
# - $OS_NODE2
environment:
- OS_HOST=$OS_NODE1
- OS_PORT=9200
Expand All @@ -82,6 +80,10 @@ volumes:
arkime_config:
arkime_logs:

os01_data:
# add a volume foreach OS node container
# os02_data:


networks:
arkime-os:
5 changes: 0 additions & 5 deletions os_data/os01/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions os_data/os02/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions os_data/os03/.gitignore

This file was deleted.

0 comments on commit 247ee37

Please sign in to comment.