update
This commit is contained in:
15
elasticsearch6/Demo/SingleNode/README.md
Normal file
15
elasticsearch6/Demo/SingleNode/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# 部署单节点 es
|
||||
|
||||
- 根据实际环境修改
|
||||
- docker-compose.yml
|
||||
|
||||
- 创建目录
|
||||
```
|
||||
grep '\<source:' docker-compose.yml | cut -d: -f2 | xargs mkdir -p
|
||||
```
|
||||
|
||||
- 启动
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
31
elasticsearch6/Demo/SingleNode/docker-compose.yml
Normal file
31
elasticsearch6/Demo/SingleNode/docker-compose.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
es:
|
||||
image: harbor.colben.cn/general/elasticsearch:6
|
||||
container_name: es
|
||||
restart: "on-failure"
|
||||
stop_grace_period: 5m
|
||||
privileged: true
|
||||
environment:
|
||||
_CONF_network.host: 127.0.0.1
|
||||
_CONF_http.port: 9200
|
||||
_CONF_transport.port: 9300
|
||||
network_mode: host
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./es/config
|
||||
target: /opt/es/config
|
||||
- type: bind
|
||||
source: ./es/data
|
||||
target: /opt/es/data
|
||||
- type: bind
|
||||
source: ./es/logs
|
||||
target: /opt/es/logs
|
||||
- type: bind
|
||||
source: ./es/plugins
|
||||
target: /opt/es/plugins
|
||||
- type: bind
|
||||
source: ./es/offline-plugins
|
||||
target: /opt/es/offline-plugins
|
||||
|
18
elasticsearch6/Demo/ThreeNodes/README.md
Normal file
18
elasticsearch6/Demo/ThreeNodes/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# 部署三节点 es 集群
|
||||
|
||||
- 部署集群,有三个节点,每个节点有三个 ip
|
||||
- 每个节点的 127.0.1.x 和 127.0.2.x 用于 http 请求
|
||||
- 每个节点的 127.0.3.x 用于节点间通信
|
||||
- 根据实际环境修改
|
||||
- docker-compose.yml
|
||||
|
||||
- 创建目录
|
||||
```
|
||||
grep '\<source:' docker-compose.yml | cut -d: -f2 | xargs mkdir -p
|
||||
```
|
||||
|
||||
- 启动
|
||||
```
|
||||
docker-compose up -d
|
||||
```
|
||||
|
108
elasticsearch6/Demo/ThreeNodes/docker-compose.yml
Normal file
108
elasticsearch6/Demo/ThreeNodes/docker-compose.yml
Normal file
@@ -0,0 +1,108 @@
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
es1:
|
||||
image: harbor.colben.cn/general/elasticsearch:6
|
||||
container_name: es1
|
||||
restart: "on-failure"
|
||||
stop_grace_period: 5m
|
||||
privileged: true
|
||||
environment:
|
||||
ES_JAVA_OPTS: "-Xms8g -Xmx8g"
|
||||
_CONF_cluster.name: myes
|
||||
_CONF_node.name: es1
|
||||
_CONF_network.bind_host: '[127.0.1.1,127.0.2.1]'
|
||||
_CONF_network.publish_host: 127.0.3.1
|
||||
_CONF_http.port: 9200
|
||||
_CONF_transport.port: 9300
|
||||
_CONF_discovery.zen.ping.unicast.hosts: '[127.0.3.1,127.0.3.2,127.0.3.3]'
|
||||
_CONF_discovery.zen.minimum_master_nodes: 2
|
||||
_CONF_gateway.recover_after_nodes: 2
|
||||
network_mode: host
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./es1/config
|
||||
target: /opt/es/config
|
||||
- type: bind
|
||||
source: ./es1/data
|
||||
target: /opt/es/data
|
||||
- type: bind
|
||||
source: ./es1/logs
|
||||
target: /opt/es/logs
|
||||
- type: bind
|
||||
source: ./es1/plugins
|
||||
target: /opt/es/plugins
|
||||
- type: bind
|
||||
source: ./es1/offline-plugins
|
||||
target: /opt/es/offline-plugins
|
||||
|
||||
es2:
|
||||
image: harbor.colben.cn/general/elasticsearch:6
|
||||
container_name: es2
|
||||
restart: "on-failure"
|
||||
stop_grace_period: 5m
|
||||
privileged: true
|
||||
environment:
|
||||
ES_JAVA_OPTS: "-Xms8g -Xmx8g"
|
||||
_CONF_cluster.name: myes
|
||||
_CONF_node.name: es2
|
||||
_CONF_network.bind_host: '[127.0.1.2,127.0.2.2]'
|
||||
_CONF_network.publish_host: 127.0.3.2
|
||||
_CONF_http.port: 9200
|
||||
_CONF_transport.port: 9300
|
||||
_CONF_discovery.zen.ping.unicast.hosts: '[127.0.3.1,127.0.3.2,127.0.3.3]'
|
||||
_CONF_discovery.zen.minimum_master_nodes: 2
|
||||
_CONF_gateway.recover_after_nodes: 2
|
||||
network_mode: host
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./es2/config
|
||||
target: /opt/es/config
|
||||
- type: bind
|
||||
source: ./es2/data
|
||||
target: /opt/es/data
|
||||
- type: bind
|
||||
source: ./es2/logs
|
||||
target: /opt/es/logs
|
||||
- type: bind
|
||||
source: ./es2/plugins
|
||||
target: /opt/es/plugins
|
||||
- type: bind
|
||||
source: ./es2/offline-plugins
|
||||
target: /opt/es/offline-plugins
|
||||
|
||||
es3:
|
||||
image: harbor.colben.cn/general/elasticsearch:6
|
||||
container_name: es3
|
||||
restart: "on-failure"
|
||||
stop_grace_period: 5m
|
||||
privileged: true
|
||||
environment:
|
||||
ES_JAVA_OPTS: "-Xms8g -Xmx8g"
|
||||
_CONF_cluster.name: myes
|
||||
_CONF_node.name: es3
|
||||
_CONF_network.bind_host: '[127.0.1.3,127.0.2.3]'
|
||||
_CONF_network.publish_host: 127.0.3.3
|
||||
_CONF_http.port: 9200
|
||||
_CONF_transport.port: 9300
|
||||
_CONF_discovery.zen.ping.unicast.hosts: '[127.0.3.1,127.0.3.2,127.0.3.3]'
|
||||
_CONF_discovery.zen.minimum_master_nodes: 2
|
||||
_CONF_gateway.recover_after_nodes: 2
|
||||
network_mode: host
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./es3/config
|
||||
target: /opt/es/config
|
||||
- type: bind
|
||||
source: ./es3/data
|
||||
target: /opt/es/data
|
||||
- type: bind
|
||||
source: ./es3/logs
|
||||
target: /opt/es/logs
|
||||
- type: bind
|
||||
source: ./es3/plugins
|
||||
target: /opt/es/plugins
|
||||
- type: bind
|
||||
source: ./es3/offline-plugins
|
||||
target: /opt/es/offline-plugins
|
||||
|
Reference in New Issue
Block a user