mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2024-11-24 17:55:10 +08:00
调试 elastic
Signed-off-by: 萌森 <qyg2297248353@163.com>
This commit is contained in:
parent
9635354efe
commit
531b2d304c
46
apps/elastic-elasticsearch-node/8.14.3/data.yml
Normal file
46
apps/elastic-elasticsearch-node/8.14.3/data.yml
Normal file
@ -0,0 +1,46 @@
|
||||
additionalProperties:
|
||||
formFields:
|
||||
- default: "/home/elasticsearch"
|
||||
edit: true
|
||||
envKey: ELASTICSEARCH_ROOT_PATH
|
||||
labelZh: 数据持久化路径
|
||||
labelEn: Data persistence path
|
||||
required: true
|
||||
type: text
|
||||
- default: 9200
|
||||
edit: true
|
||||
envKey: PANEL_APP_PORT_HTTPS
|
||||
labelZh: WebUI 端口
|
||||
labelEn: WebUI port
|
||||
required: true
|
||||
rule: paramPort
|
||||
type: number
|
||||
- default: 9300
|
||||
edit: true
|
||||
envKey: PANEL_APP_PORT_CLUSTER
|
||||
labelZh: 集群端口
|
||||
labelEn: Cluster port
|
||||
required: true
|
||||
rule: paramPort
|
||||
type: number
|
||||
- default: ""
|
||||
edit: true
|
||||
envKey: ENROLLMENT_TOKEN
|
||||
labelZh: 节点注册令牌
|
||||
labelEn: Node enrollment token
|
||||
required: true
|
||||
type: text
|
||||
- default: "es-node"
|
||||
edit: true
|
||||
envKey: ES_SETTING_NODE_NAME
|
||||
labelZh: 节点名称 (集群内唯一值)
|
||||
labelEn: Node name (unique value within the cluster)
|
||||
required: true
|
||||
type: text
|
||||
- default: "-Xms1g -Xmx1g"
|
||||
edit: true
|
||||
envKey: ES_JAVA_OPTS
|
||||
labelZh: Elasticsearch Java 配置 (可选)
|
||||
labelEn: Elasticsearch Java configuration (optional)
|
||||
required: false
|
||||
type: text
|
37
apps/elastic-elasticsearch-node/8.14.3/docker-compose.yml
Normal file
37
apps/elastic-elasticsearch-node/8.14.3/docker-compose.yml
Normal file
@ -0,0 +1,37 @@
|
||||
version: "3.8"
|
||||
|
||||
networks:
|
||||
1panel-network:
|
||||
external: true
|
||||
|
||||
services:
|
||||
elasticsearch:
|
||||
image: elasticsearch:8.14.3
|
||||
container_name: ${CONTAINER_NAME}
|
||||
labels:
|
||||
createdBy: "Apps"
|
||||
restart: always
|
||||
networks:
|
||||
- 1panel-network
|
||||
tty: true
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
nofile:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
ports:
|
||||
- ${PANEL_APP_PORT_HTTPS}:9200
|
||||
- ${PANEL_APP_PORT_CLUSTER}:9300
|
||||
env_file:
|
||||
- /etc/1panel/envs/global.env
|
||||
- ${ENV_FILE:-/etc/1panel/envs/default.env}
|
||||
volumes:
|
||||
- ${ELASTICSEARCH_ROOT_PATH}/data:/usr/share/elasticsearch/data
|
||||
- ${ELASTICSEARCH_ROOT_PATH}/backup:/usr/share/elasticsearch/backup
|
||||
- ${ELASTICSEARCH_ROOT_PATH}/plugins:/usr/share/elasticsearch/plugins
|
||||
environment:
|
||||
- LICENSE=basic
|
||||
- ES_SETTING_BOOTSTRAP_MEMORY__LOCK=true
|
||||
- ES_SETTING_PATH_REPO=/usr/share/elasticsearch/backup
|
21
apps/elastic-elasticsearch-node/8.14.3/scripts/init.sh
Normal file
21
apps/elastic-elasticsearch-node/8.14.3/scripts/init.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
|
||||
# setup-1 add default values
|
||||
CURRENT_DIR=$(pwd)
|
||||
sed -i '/^ENV_FILE=/d' .env
|
||||
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
||||
|
||||
mkdir -p $ELASTICSEARCH_ROOT_PATH
|
||||
mkdir -p "$ELASTICSEARCH_ROOT_PATH/data"
|
||||
mkdir -p "$ELASTICSEARCH_ROOT_PATH/backup"
|
||||
mkdir -p "$ELASTICSEARCH_ROOT_PATH/plugins"
|
||||
|
||||
chown -R 1000:1000 $ELASTICSEARCH_ROOT_PATH
|
||||
|
||||
echo "Check Finish."
|
||||
else
|
||||
echo "Error: .env file not found."
|
||||
fi
|
10
apps/elastic-elasticsearch-node/8.14.3/scripts/uninstall.sh
Normal file
10
apps/elastic-elasticsearch-node/8.14.3/scripts/uninstall.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
|
||||
echo "Check Finish."
|
||||
|
||||
else
|
||||
echo "Error: .env file not found."
|
||||
fi
|
15
apps/elastic-elasticsearch-node/8.14.3/scripts/upgrade.sh
Normal file
15
apps/elastic-elasticsearch-node/8.14.3/scripts/upgrade.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f .env ]; then
|
||||
source .env
|
||||
|
||||
# setup-1 add default values
|
||||
CURRENT_DIR=$(pwd)
|
||||
sed -i '/^ENV_FILE=/d' .env
|
||||
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
|
||||
|
||||
echo "Check Finish."
|
||||
|
||||
else
|
||||
echo "Error: .env file not found."
|
||||
fi
|
109
apps/elastic-elasticsearch-node/README.md
Normal file
109
apps/elastic-elasticsearch-node/README.md
Normal file
@ -0,0 +1,109 @@
|
||||
# Elasticsearch
|
||||
|
||||
搜索并分析您的数据
|
||||
|
||||
<img src="https://file.lifebus.top/imgs/elasticsearch_logo.svg" width="100%"/>
|
||||
|
||||
Elasticsearch 是 Elastic Stack 核心的分布式搜索和分析引擎。 Logstash 和 Beats 有助于收集、聚合和丰富您的数据并将其存储在
|
||||
Elasticsearch 中。
|
||||
Kibana 使您能够以交互方式探索、可视化和分享对数据的见解,并管理和监控堆栈。 Elasticsearch 是索引、搜索和分析魔法发生的地方。
|
||||
|
||||
## 安装说明
|
||||
|
||||
当前应用为主节点,仅首次部署有效。集群节点请使用 `Elasticsearch 节点` 应用。
|
||||
|
||||
### 宿主机配置
|
||||
|
||||
+ `vm.max_map_count` 配置
|
||||
|
||||
Elasticsearch 需要设置 `vm.max_map_count` 为至少 `262144`。可以通过以下命令设置:
|
||||
|
||||
```sh
|
||||
grep vm.max_map_count /etc/sysctl.conf
|
||||
|
||||
# 如果输出为空,表示没有设置,需要手动添加
|
||||
vm.max_map_count=262144
|
||||
```
|
||||
|
||||
添加配置
|
||||
|
||||
```sh
|
||||
# 临时生效
|
||||
sysctl -w vm.max_map_count=262144
|
||||
|
||||
# 永久生效
|
||||
echo "vm.max_map_count=262144" >>/etc/sysctl.conf
|
||||
sysctl -p
|
||||
```
|
||||
|
||||
### 单节点安装
|
||||
|
||||
+ `集群名称` 配置
|
||||
|
||||
用于标识集群的名称。默认为 `elasticsearch-cluster`。
|
||||
|
||||
+ `节点名称` 配置
|
||||
|
||||
用于标识节点的名称。默认为 `elasticsearch-node`。
|
||||
|
||||
+ `Elasticsearch 密码 (elastic)` 配置
|
||||
|
||||
内置用户 `elastic` 的密码。默认情况下,密码是随机生成的。
|
||||
|
||||
+ `Kibana 密码 (kibana_system)` 配置
|
||||
|
||||
内置用户 `kibana_system` 的密码。默认情况下,密码是随机生成的。
|
||||
|
||||
用于保护内置用户 `kibana_system` 的密码。默认情况下,密码是随机生成的。
|
||||
|
||||
+ `注册令牌 (节点)` 配置
|
||||
|
||||
忽略即可
|
||||
|
||||
### 集群节点安装
|
||||
|
||||
+ `集群名称` 配置
|
||||
|
||||
与加入的集群名称一致。
|
||||
|
||||
+ `节点名称` 配置
|
||||
|
||||
集群中唯一的节点名称。请勿重复
|
||||
|
||||
+ `Elasticsearch 密码 (elastic)` 配置
|
||||
|
||||
忽略即可
|
||||
|
||||
+ `Kibana 密码 (kibana_system)` 配置
|
||||
|
||||
忽略即可
|
||||
|
||||
+ `注册令牌 (节点)` 配置
|
||||
|
||||
用于加入集群的注册令牌。在集群中的节点中生成,用于加入集群验证。每个注册令牌有效时长30分钟。
|
||||
|
||||
## 快捷操作
|
||||
|
||||
> 重置密码
|
||||
|
||||
```sh
|
||||
cd /usr/share/elasticsearch/bin
|
||||
./elasticsearch-reset-password -u elastic
|
||||
```
|
||||
|
||||
> 创建 `kibana` 注册令牌
|
||||
|
||||
```sh
|
||||
cd /usr/share/elasticsearch/bin
|
||||
./elasticsearch-create-enrollment-token -s kibana
|
||||
```
|
||||
|
||||
> 导出证书
|
||||
|
||||
<容器名称> 为容器名称或容器 ID,可以通过 `docker ps` 命令查看。
|
||||
|
||||
导出 `http_ca.crt` 证书到当前目录
|
||||
|
||||
```sh
|
||||
docker cp <容器名称>:/usr/share/elasticsearch/config/certs/http_ca.crt .
|
||||
```
|
18
apps/elastic-elasticsearch-node/data.yml
Normal file
18
apps/elastic-elasticsearch-node/data.yml
Normal file
@ -0,0 +1,18 @@
|
||||
name: Elasticsearch 节点
|
||||
title: 分布式、RESTful 风格的搜索和数据分析引擎
|
||||
description: 分布式、RESTful 风格的搜索和数据分析引擎
|
||||
additionalProperties:
|
||||
key: elastic-elasticsearch-node
|
||||
name: Elasticsearch 节点
|
||||
tags:
|
||||
- Database
|
||||
- Middleware
|
||||
- Local
|
||||
shortDescZh: 分布式、RESTful 风格的搜索和数据分析引擎
|
||||
shortDescEn: Distributed, RESTful-style search and data analysis engine
|
||||
type: runtime
|
||||
crossVersionUpdate: true
|
||||
limit: 0
|
||||
website: https://www.elastic.co/
|
||||
github: https://github.com/elastic/elasticsearch/
|
||||
document: https://www.elastic.co/docs/
|
BIN
apps/elastic-elasticsearch-node/logo.png
Normal file
BIN
apps/elastic-elasticsearch-node/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
@ -37,13 +37,6 @@ additionalProperties:
|
||||
labelEn: Kibana password (kibana_system)
|
||||
required: false
|
||||
type: password
|
||||
- default: "-Xms1g -Xmx1g"
|
||||
edit: true
|
||||
envKey: ES_JAVA_OPTS
|
||||
labelZh: Elasticsearch Java 配置 (可选)
|
||||
labelEn: Elasticsearch Java configuration (optional)
|
||||
required: false
|
||||
type: text
|
||||
- default: "elasticsearch"
|
||||
edit: true
|
||||
envKey: ES_SETTING_CLUSTER_NAME
|
||||
@ -58,3 +51,10 @@ additionalProperties:
|
||||
labelEn: Node name
|
||||
required: true
|
||||
type: text
|
||||
- default: "-Xms1g -Xmx1g"
|
||||
edit: true
|
||||
envKey: ES_JAVA_OPTS
|
||||
labelZh: Java 启动参数 (可选)
|
||||
labelEn: Java startup parameters (optional)
|
||||
required: false
|
||||
type: text
|
||||
|
@ -36,66 +36,56 @@ echo "vm.max_map_count=262144" >>/etc/sysctl.conf
|
||||
sysctl -p
|
||||
```
|
||||
|
||||
### 单节点安装
|
||||
### 集群主节点安装
|
||||
|
||||
+ `集群名称` 配置
|
||||
> `集群名称` 配置
|
||||
|
||||
用于标识集群的名称。默认为 `elasticsearch-cluster`。
|
||||
|
||||
+ `节点名称` 配置
|
||||
> `节点名称` 配置
|
||||
|
||||
用于标识节点的名称。默认为 `elasticsearch-node`。
|
||||
|
||||
+ `Elasticsearch 密码 (elastic)` 配置
|
||||
> `Elasticsearch 密码 (elastic)` 配置
|
||||
|
||||
内置用户 `elastic` 的密码。默认情况下,密码是随机生成的。
|
||||
|
||||
+ `Kibana 密码 (kibana_system)` 配置
|
||||
> `Kibana 密码 (kibana_system)` 配置
|
||||
|
||||
内置用户 `kibana_system` 的密码。默认情况下,密码是随机生成的。
|
||||
|
||||
用于保护内置用户 `kibana_system` 的密码。默认情况下,密码是随机生成的。
|
||||
|
||||
+ `注册令牌 (节点)` 配置
|
||||
> `Java 启动参数 (可选)` 配置
|
||||
|
||||
忽略即可
|
||||
Java 启动参数。默认为空。
|
||||
|
||||
### 集群节点安装
|
||||
推荐参数:`-Xms1g -Xmx1g`
|
||||
|
||||
+ `集群名称` 配置
|
||||
|
||||
与加入的集群名称一致。
|
||||
|
||||
+ `节点名称` 配置
|
||||
|
||||
集群中唯一的节点名称。请勿重复
|
||||
|
||||
+ `Elasticsearch 密码 (elastic)` 配置
|
||||
|
||||
忽略即可
|
||||
|
||||
+ `Kibana 密码 (kibana_system)` 配置
|
||||
|
||||
忽略即可
|
||||
|
||||
+ `注册令牌 (节点)` 配置
|
||||
|
||||
用于加入集群的注册令牌。在集群中的节点中生成,用于加入集群验证。每个注册令牌有效时长30分钟。
|
||||
小内存推荐参数:`-Xms512m -Xmx512m`
|
||||
|
||||
## 快捷操作
|
||||
|
||||
> 重置密码
|
||||
|
||||
```sh
|
||||
cd /usr/share/elasticsearch/bin
|
||||
./elasticsearch-reset-password -u elastic
|
||||
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
|
||||
```
|
||||
|
||||
> 创建 `节点` 注册令牌
|
||||
|
||||
注册令牌的有效期为30分钟。
|
||||
|
||||
```sh
|
||||
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
|
||||
```
|
||||
|
||||
> 创建 `kibana` 注册令牌
|
||||
|
||||
注册令牌的有效期为30分钟。
|
||||
|
||||
```sh
|
||||
cd /usr/share/elasticsearch/bin
|
||||
./elasticsearch-create-enrollment-token -s kibana
|
||||
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
|
||||
```
|
||||
|
||||
> 导出证书
|
||||
|
Loading…
Reference in New Issue
Block a user