ElasticSearch

es安装及其相关配置

2020-04-10  本文已影响0人  梦梦_9f1a

docker安装es镜像

这里我们选择的是elasticsearch-kibana这个容器

注:如果不适用docker安装ElasticSearch和kibana进行选择版本一致的安装包


### 安装步骤

docker search elasticsearch # 搜索es镜像

docker pull nshou/elasticsearch-kibana  # 下载es镜像

docker images   # 查看本地镜像

docker run -d -p 9200:9200 -p 5601:5601 nshou/elasticsearch-kibana  #创建并启动容器容器

docker exec 容器id sh # 进入ElasticSearch-kibana容器

es相关配置

elasticsearch\config目录下,有三个核心的配置文件:

elasticsearch.yml

Cluster


cluster.name: my-application


transport.tcp.port: 9300


cluster.routing.allocation.same_shard.host:true


cluster.routing.allocation.node_initial_primaries_recoveries: 4


cluster.routing.allocation.node_concurrent_recoveries: 4

Node


node.name: node-1


node.attr.rack: r1


node.master: true


node.data: true


index.number_of_shards: 5


index.number_of_replicas: 1


indices.recovery.max_size_per_ser: 0


indices.recovery.concurrent_streams: 5


indices.recovery.max_size_per_ser: 0


indices.recovery.concurrent_streams: 5

Paths


path.data: /path/to/data

# path.data: /path/to/data1,/path/to/data1


path.work: /path/to/work


path.logs: /path/to/logs


path.logs: /path/to/logs


path.plugins: /path/to/plugins

Network


discovery.zen.ping.multicast.enabled: true


discovery.zen.ping.unicast.hosts: ["host1", "host2"]

discovery.zen.ping.unicast.hosts: ["10.0.0.1", "10.0.0.3:9300", "10.0.0.6[9300-9400]"]


discovery.zen.ping.timeout: 3s

Memory


bootstrap.memory_lock: true


bootstrap.mlockall: true

Gateway


transport.tcp.compress: true


http.max_content_length: 100mb


http.enabled: false


gateway.type: local


gateway.recover_after_nodes: 3


gateway.recover_after_time: 5m


gateway.expected_nodes: 2

Various


action.destructive_requires_name: true

jvm.options


-Xms1g    # 设置最小堆为1g

-Xmx1g  # 设置最大堆为1g

log4j2.properties

这个配置文件,一般不修改其配置

上一篇 下一篇

猜你喜欢

热点阅读