elasticsearch在centos7下的安装
程序员文章站
2022-05-17 08:34:55
...
参考: https://segmentfault.com/a/1190000011899522
注: elasticsearch需要先安装配置jdk: https://blog.csdn.net/sjhuangx/article/details/79691426
1. 首先下载elasticsearch,并解压到 /opt目录下
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.3.tar.gz
tar xvzf elasticsearch-6.2.3.tar.gz
sudo mv elasticsearch-6.2.3 /opt
2. 运行 /opt/elasticsearch-6.2.3/bin/elasticsearch,如果想后台运行后面加 -d
3. 新开一个终端,用curl访问 curl 'http://localhost:9200/?pretty'
4.修改elasticsearch配置文件
vim ./config/elasticsearch.yml
# 找到network.host: 一行,去除#号,修改为:
network.host: 192.168.241.100
5. 修改vm.max_map_count
问题1
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
max_map_count 的值是指一个进程最多可用于的内存映射区(memory map areas),在调用malloc会用到,由mmap/mprotect生成。解决办法:
切换到root用户修改配置/etc/sysctl.conf
sudo vim /etc/sysctl.conf
# 在文件末尾加入
vm.max_map_count=655360
# 使其生效
sudo sysctl -p
6. 修改/etc/security/limits.conf
问题2
max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
文件描述符太低解决办法: 修改/etc/security/limits.conf
sudo vim /etc/security/limits.conf
# 在文件末尾加入
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
7. 运行elasticsearch,如果想后台运行后面加 -d
[aaa@qq.com elasticsearch-6.2.3]$ ./bin/elasticsearch
[2018-03-26T10:39:16,691][INFO ][o.e.n.Node ] [] initializin
[2018-03-26T10:39:16,750][INFO ][o.e.e.NodeEnvironment ] [iragA5b] usinspace [32.4gb], net total_space [35.7gb], types [rootfs]
[2018-03-26T10:39:16,750][INFO ][o.e.e.NodeEnvironment ] [iragA5b] heaps [true]
[2018-03-26T10:39:16,751][INFO ][o.e.n.Node ] node name [ira set [node.name] to override
[2018-03-26T10:39:16,751][INFO ][o.e.n.Node ] version[6.2.3]3Z], OS[Linux/3.10.0-693.21.1.el7.x86_64/amd64], JVM[Oracle Corporation/Ja]
[2018-03-26T10:39:16,751][INFO ][o.e.n.Node ] JVM arguments tiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+Alwa.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.nerue, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnablr=/tmp/elasticsearch.qoAH01YE, -XX:+HeapDumpOnOutOfMemoryError, -XX:+PrintgDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -X-XX:GCLogFileSize=64m, -Des.path.home=/opt/elasticsearch-6.2.3, -Des.path.
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,273][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] load
[2018-03-26T10:39:17,274][INFO ][o.e.p.PluginsService ] [iragA5b] no p
[2018-03-26T10:39:19,079][INFO ][o.e.d.DiscoveryModule ] [iragA5b] usin
[2018-03-26T10:39:19,437][INFO ][o.e.n.Node ] initialized
[2018-03-26T10:39:19,437][INFO ][o.e.n.Node ] [iragA5b] star
[2018-03-26T10:39:19,578][INFO ][o.e.t.TransportService ] [iragA5b] publ{192.168.241.100:9300}
[2018-03-26T10:39:19,589][INFO ][o.e.b.BootstrapChecks ] [iragA5b] boun bootstrap checks
[2018-03-26T10:39:22,719][INFO ][o.e.c.s.MasterService ] [iragA5b] zen-new_master {iragA5b}{iragA5bAQc6N5W-2QMgzyQ}{qiFHpwn8RVWhbv6qTw_W1g}{192.1
[2018-03-26T10:39:22,726][INFO ][o.e.c.s.ClusterApplierService] [iragA5b] 8RVWhbv6qTw_W1g}{192.168.241.100}{192.168.241.100:9300}, reason: apply clu6N5W-2QMgzyQ}{qiFHpwn8RVWhbv6qTw_W1g}{192.168.241.100}{192.168.241.100:930s-master ([0] nodes joined)]])
[2018-03-26T10:39:22,798][INFO ][o.e.h.n.Netty4HttpServerTransport] [iragAdresses {192.168.241.100:9200}
[2018-03-26T10:39:22,798][INFO ][o.e.n.Node ] [iragA5b] star
[2018-03-26T10:39:22,803][INFO ][o.e.g.GatewayService ] [iragA5b] reco
使用浏览器访问 http://localhost:9200/?pretty
推荐阅读
-
Ubuntu 下 nginx , php , mysql 和 golang 的简单安装
-
javascript - json格式的数据在非UTF-8编码下会不会乱码??如果解决呢??
-
在Mysql下查看给某个用户授予什么样的权限_MySQL
-
在Unix下的Oracle 8.1.7.4内安装XDK
-
JavaScript在IE和Firefox浏览器下的7个差异兼容写法小结_javascript技巧
-
php程序员在mac下开发常用的工具有那些?
-
在搭建php环境下的翻来覆去
-
windows上php环境下memcache和mongodb的安装
-
在laravel中怎么引入composer安装在vendor中的第三方引用
-
jquery在ie7下选择器的问题导致append失效的解决方法_jquery