部署安装ES文档记录

 

 

步骤一.在没一台上解压安装ES后,进入config中修改elasticsearch.yml

由于需要多实例:比如在192.168.17.234上装两台data节点,所以在/etc/elasticsearch目录下创建两个目录分别为instance1和instance2分别拷贝主目录下config中的配置文件,并修改成如下模板。

模板:

# ======================== Elasticsearch Configuration =========================

# ---------------------------------- Cluster -----------------------------------

# Use a descriptive name for your cluster:

cluster.name: es-test

# ------------------------------------ Node ------------------------------------

# Use a descriptive name for the node:

node.name: node-data1

# 设置不充当master节点,默认为true

node.master: false  

# 设置充当data节点,默认为true

node.data: true

# Add custom attributes to the node:

#node.attr.rack: r1

# ----------------------------------- Paths ------------------------------------

# Path to directory where to store the data (separate multiple locations by comma):

path.data: /opt/data

# Path to log files:

path.logs: /opt/logs

# ----------------------------------- Memory -----------------------------------

# Lock the memory on startup:

#bootstrap.memory_lock: true

# ---------------------------------- Network -----------------------------------

# Set the bind address to a specific IP (IPv4 or IPv6):

network.host: 192.168.17.234

#同一台host上的该端口号从9200开始每增加一台加1

http.port: 9200

#同一台host上的该端口号从9300开始每增加一台加1

transport.tcp.port: 9300

# For more information, consult the network module documentation.

# --------------------------------- Discovery ----------------------------------

# Pass an initial list of hosts to perform discovery when new node is started:

discovery.zen.ping.unicast.hosts: ["192.168.17.232:9300","192.168.17.234:9300","192.168.17.234:9301","192.168.17.235:9300"]

# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

#

discovery.zen.minimum_master_nodes: 1

# ---------------------------------- Gateway -----------------------------------

# Block initial recovery after a full cluster restart until N nodes are started:

#gateway.recover_after_nodes: 3

# ---------------------------------- Various -----------------------------------

# Require explicit names when deleting indices:

#action.destructive_requires_name: true

 

 

 

步骤二、创建es用户组合es用户,并更改ES主目录权限。

# groupadd es

# useradd es -g es -p es

# chown -R es:es elasticsearch-6.2.4

 

 

步骤三:

多实例启动时,前面需要加入环境。

 

ES_PATH_CONF=/opt/elasticsearch-6.5.1/config/instance1 ./elasticsearch -d -Ecluster.name=es-test -Enode.name=node-data1

 

 

日志报错 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

解决:vi /etc/security/limits.conf

添加如下

* soft nofile 65536

* hard nofile 131072

*为es用户

修改后要退出es用户连接在登录生效

 

 

报错: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

vi /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sysctl -p

 

 

[2018-12-13T04:37:53,657][WARN ][o.e.d.z.ZenDiscovery     ] [node-data1] not enough master nodes discovered during pinging (found [[Candidate{node={node-master}{nKV9YKaZTuqM78nC7jwelA}{jMGhXIqWTw6MmWUsglaa2g}{192.168.17.232}{192.168.17.232:9300}{ml.machine_memory=2968797184, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}, clusterStateVersion=-1}]], but needed [3]), pinging again

 

解决:es.yml 文件中discovery.zen.minimum_master_nodes: 3修改成1

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
对于Elasticsearch的部署和配置,我可以给你一些建议: 1. 硬件配置:确保你的硬件能够满足你的需求。Elasticsearch对内存和磁盘空间的要求较高,建议分配足够的内存和磁盘空间来支持你的数据量和查询负载。 2. 集群规模:如果你的数据量很大或者查询负载很高,考虑使用多个节点的集群来分摊负载和提高可用性。至少需要两个节点来实现高可用性。 3. JVM设置:根据你的硬件配置和数据量大小,合理配置JVM堆内存大小。一般来说,将堆内存设置为总内存的一半是一个不错的起点。同时,确保你的JVM版本与Elasticsearch版本兼容。 4. 存储设置:选择合适的存储引擎和文件系统,如SSD和XFS。这些能够提供更好的性能和稳定性。 5. 网络设置:确保节点之间的网络连接稳定,并根据需要进行网络配置调整。例如,调整最大连接数和超时设置。 6. 安全配置:考虑使用安全插件来保护你的Elasticsearch集群。配置访问控制列表(ACL)和安全认证以限制对集群的访问。 7. 监控和日志:配置适当的监控和日志记录,以便及时发现和解决问题。Elasticsearch提供了一些内置的监控和诊断工具,同时也可以使用第三方工具进行监控。 这些是一些基本的部署和配置建议,具体的设置取决于你的具体需求和环境。建议你参考Elasticsearch官方文档和社区资源,以获得更详细的指导和最佳实践。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值