博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ElasticSearch安装部署,基本配置(Ubuntu14.04)
阅读量:6902 次
发布时间:2019-06-27

本文共 2403 字,大约阅读时间需要 8 分钟。

ElasticSearch部署文档(Ubuntu 14.04)

安装java

sudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-installersudo apt-get install oracle-java8-set-default java -version whereis java which java (java执行路径) echo $JAVA_HOME

echo $PATH

 

安装ElasticSearch

wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -echo "deb http://packages.elastic.co/elasticsearch/1.6/debian stable main" | sudo tee -a /etc/apt/sources.listsudo apt-get updatesudo apt-get install elasticsearchsudo update-rc.d elasticsearch defaults 95 10

ElasticSearch各个目录说明

type description location
home Home of elasticsearch installation /usr/share/elasticsearch
bin Binary scripts including elasticsearch to start a node /usr/share/elasticsearch/bin
conf Configuration files elasticsearch.yml and logging.yml /etc/elasticsearch
conf Environment variables including heap size,file descriptors /etc/default/elasticsearch
data The location of the data files /var/lib/elasticsearch/
logs Log files location /var/log/elasticsearch
plugins Plugin files location /usr/share/elasticsearch/plugins

配置

# 在/etc/default/elasticsearch中修改:ES_HEAP_SIZE=4g    #不要超过32g,如果整台机器只部署ES,一半内存用于Java heap,另一半给Lucene

cat <
> /etc/security/limits.confelasticsearch - nofile 65535EOF# 在/etc/default/elasticsearch中修改:MAX_OPEN_FILES=65535

cat <
> /etc/sysctl.confvm.max_map_count=262144EOFsysctl -p

# 在/etc/elasticsearch/elasticsearch.yml中修改:bootstrap.mlockall: true# 在/etc/default/elasticsearch中修改:MAX_LOCKED_MEMORY=unlimited

在/etc/elasticsearch/elasticsearch.yml中修改:# 集群名称,同一集群,名称要设置相同cluster.name: elasticsearch_production# 节点名称node.name: elasticsearch_001_data# 数据路径,可配置多个,英文逗号分开,注意目录的权限,保证elasticsearch用户可写path.data: /path/to/data1,/path/to/data2 # 日志路径,注意目录的权限,保证elasticsearch用户可写 path.logs: /path/to/logs # 插件路径 path.plugins: /path/to/plugins # 该属性是为了形成一个集群,有主节点资格并互相连接的节点的最小数目 # (number of master-eligible nodes / 2) + 1。 下面的值是在3个有主节点资格的情况下设定 # 因为节点数,以后可以增加,或者减少,故该配置可以动态修改 discovery.zen.minimum_master_nodes: 2 # 恢复控制 gateway.recover_after_nodes: 2 gateway.expected_nodes: 3 gateway.recover_after_time: 5m #关闭多播,用单播。并指定至少一个能接受单播的主机 discovery.zen.ping.multicast.enabled: false discovery.zen.ping.unicast.hosts: ["192.168.2.1:9300", "192.168.2.2:9300", "192.168.2.3:9300"]

sudo /etc/init.d/elasticsearch start# 验证上面一些配置是否配置成功curl localhost:9200/_nodes/process?pretty

参考链接

 
 
 

转载地址:http://ybpdl.baihongyu.com/

你可能感兴趣的文章
Vue:v-model指令
查看>>
Software Engineering | Strategy pattern
查看>>
ios开发系列-准备工作
查看>>
Android Studio调试手机或者安装APK的时候出现install failed test only
查看>>
js闭包
查看>>
Xcode +SVN
查看>>
设置界面分析
查看>>
SQL中DateTime转换成Varchar样式
查看>>
java.util.AbstractList
查看>>
几个常见用于解决nginx负载均衡的session共享问题的办法
查看>>
setTimeOut、setInterval与clearInterval函数
查看>>
Appium原理及版本变化细节
查看>>
iphone ios 用xcode4.2开发 访问web service的功能
查看>>
Visual Studio 代码折叠快捷键(摘要)
查看>>
《2016ThoughtWorks技术雷达峰会----雷达新趋势》
查看>>
正则【备用】
查看>>
FeatureSelectors
查看>>
数据库防火墙DBShield安装
查看>>
sudo with no password
查看>>
Windows 局域网ping获取设备IP
查看>>