- [x] 完成log模块镜像构建、本地端到端写日志——收集——查询流程; - [x] 完成bind模块构建; - [x] 内置域名IP自动更新脚本,使用 /private/argus/etc目录下文件进行同步,容器启动时自动写IP,定时任务刷新更新DNS服务器IP和DNS规则; Co-authored-by: root <root@curious.host.com> Reviewed-on: #8 Reviewed-by: sundapeng <sundp@mail.zgclab.edu.cn>
33 lines
1.0 KiB
Bash
33 lines
1.0 KiB
Bash
#!/bin/bash
|
||
set -euo pipefail
|
||
|
||
echo "[INFO] Starting Elasticsearch under supervisor..."
|
||
|
||
# 创建数据目录并设置权限(如果不存在)
|
||
mkdir -p /private/argus/log/elasticsearch
|
||
|
||
# 创建软链接到Elasticsearch预期的数据目录
|
||
if [ -L /usr/share/elasticsearch/data ]; then
|
||
rm /usr/share/elasticsearch/data
|
||
elif [ -d /usr/share/elasticsearch/data ]; then
|
||
rm -rf /usr/share/elasticsearch/data
|
||
fi
|
||
|
||
ln -sf /private/argus/log/elasticsearch /usr/share/elasticsearch/data
|
||
|
||
# 记录容器ip地址
|
||
DOMAIN=es.log.argus.com
|
||
IP=`ifconfig | grep -A 1 eth0 | grep inet | awk '{print $2}'`
|
||
echo current IP: ${IP}
|
||
echo ${IP} > /private/argus/etc/${DOMAIN}
|
||
|
||
echo "[INFO] Data directory linked: /usr/share/elasticsearch/data -> /private/argus/log/elasticsearch"
|
||
|
||
# 设置环境变量(ES配置通过docker-compose传递)
|
||
export ES_JAVA_OPTS="${ES_JAVA_OPTS:-"-Xms512m -Xmx512m"}"
|
||
|
||
echo "[INFO] Starting Elasticsearch process..."
|
||
|
||
# 启动原始的Elasticsearch entrypoint
|
||
exec /usr/local/bin/docker-entrypoint.sh elasticsearch
|