激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

Linux|Centos|Ubuntu|系統(tǒng)進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務(wù)器之家 - 服務(wù)器系統(tǒng) - Centos - 詳解centos7虛擬機安裝elasticsearch5.0.x-安裝篇

詳解centos7虛擬機安裝elasticsearch5.0.x-安裝篇

2021-12-13 20:43王坊興 Centos

本篇文章主要介紹了centos7虛擬機安裝elasticsearch5.0.x-安裝篇,具有一定的參考價值,感興趣的小伙伴們可以參考一下。

centos7虛擬機安裝elasticsearch5.0.x-安裝篇

請預(yù)先安裝jdk詳細步驟請參考:http://www.zmynmublwnt.cn/article/184920.html

創(chuàng)建新用戶(非root用戶)

elasticsearch只能用非root啟動,這里我創(chuàng)建了一個叫seven的用戶

?
1
2
[root@localhost ~]# useradd seven
[root@localhost ~]# passwd seven

下載elasticsearch

?
1
2
3
4
5
[root@localhost ~]# su seven
[seven@localhost root]$ cd /home/seven
[seven@localhost ~]$ mkdir download
[seven@localhost ~]$ cd download
[seven@localhost download]$ wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/5.0.0-alpha3/elasticsearch-5.0.0-alpha3.tar.gz

解壓并運行elasticsearch

解壓

?
1
[seven@localhost download]$ tar -zxvf elasticsearch-5.0.0-alpha3.tar.gz

移動到指定文件夾并重命名(方便管理)

?
1
[seven@localhost download]$ mv elasticsearch-5.0.0-alpha3 /usr/java/elasticsearch

修改訪問elasticsearch的IP及端口

?
1
[seven@localhost config]$ vim /usr/java/elasticsearch/config/elasticsearch.yml

找到如下代碼段,并取消network.host及http.port所在行的注釋,修改IP及端口

?
1
2
3
4
5
6
7
8
9
10
11
12
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 192.168.0.155
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>

直接運行bin/elasticsearch文件啟動elasticsearch

?
1
2
[seven@localhost bin]$ cd /usr/java/elasticsearch/bin/
[seven@localhost bin]$ ./elasticsearch

啟動時發(fā)現(xiàn)報錯了。。。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[seven@localhost bin]$ ./elasticsearch
[2016-06-28 13:49:27,899][INFO ][node      ] [Mondo] version[5.0.0-alpha3], pid[3671], build[cad959b/2016-05-26T08:25:57.564Z], OS[Linux/3.10.0-327.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1 .0_91/25.91-b14]
▽2016-06-28 13:49:27,900][INFO ][node      ] [Mondo] initializing ...
[2016-06-28 13:49:28,941][INFO ][plugins     ] [Mondo] modules [percolator, lang-mustache, lang-painless, ingest-grok, reindex, lang-expression, lang-groovy], plugins []
[2016-06-28 13:49:28,963][INFO ][env      ] [Mondo] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [15.7gb], net total_space [17.4gb], spins? [unknown], types [rootfs]
[2016-06-28 13:49:28,963][INFO ][env      ] [Mondo] heap size [1.9gb], compressed ordinary object pointers [true]
[2016-06-28 13:49:31,980][INFO ][node      ] [Mondo] initialized
[2016-06-28 13:49:31,980][INFO ][node      ] [Mondo] starting ...
[2016-06-28 13:49:32,115][INFO ][transport    ] [Mondo] publish_address {192.168.0.155:9300}, bound_addresses {192.168.0.155:9300}
Exception in thread "main" java.lang.RuntimeException: bootstrap checks failed
initial heap size [268435456] not equal to maximum heap size [2147483648]; this can cause resize pauses and prevents mlockall from locking the entire heap
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
please set [discovery.zen.minimum_master_nodes] to a majority of the number of master eligible nodes in your cluster
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
  at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:125)
  at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:85)
  at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:65)
  at org.elasticsearch.bootstrap.Bootstrap$5.validateNodeBeforeAcceptingRequests(Bootstrap.java:183)
  at org.elasticsearch.node.Node.start(Node.java:337)
  at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:198)
  at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:257)
  at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:96)
  at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:91)
  at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
  at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)
  at org.elasticsearch.cli.Command.main(Command.java:53)
  at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:70)
  at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:63)
Refer to the log for complete error details.
[2016-06-28 13:49:32,144][INFO ][node      ] [Mondo] stopping ...
[2016-06-28 13:49:32,198][INFO ][node      ] [Mondo] stopped
[2016-06-28 13:49:32,198][INFO ][node      ] [Mondo] closing ...
[2016-06-28 13:49:32,210][INFO ][node      ] [Mondo] closed

于是我臨時提高了vm.max_map_count的大小

*此操作需要root權(quán)限

?
1
[root@localhost ~]# sysctl -w vm.max_map_count=262144

查看修改結(jié)果

?
1
2
[root@localhost ~]# sysctl -a|grep vm.max_map_count
vm.max_map_count = 262144

或者永久性修改

?
1
2
3
4
5
6
7
8
9
10
11
12
[root@localhost ~]# cat /etc/sysctl.conf | grep -v "vm.max_map_count" > /tmp/system_sysctl.conf
[root@localhost ~]# echo "vm.max_map_count=262144" >> /tmp/system_sysctl.conf
[root@localhost ~]# mv /tmp/system_sysctl.conf /etc/sysctl.conf
mv:是否覆蓋"/etc/sysctl.conf"? y
[root@localhost ~]# cat /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
vm.max_map_count=262144
[root@localhost ~]# sysctl -p
vm.max_map_count = 262144

上面還有一個錯誤是關(guān)于jvm內(nèi)存分配的問題heap size [268435456] not equal to maximum heap size [2147483648],需要修改的jvm配置

?
1
[seven@localhost bin]$ vim /usr/java/elasticsearch/config/jvm.options

將-Xmx2g改成-Xmx256m,也就是heap size [268435456] /1024/1024的值

又有新的錯誤。。。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Exception in thread "main" java.lang.RuntimeException: bootstrap checks failed
initial heap size [268435456] not equal to maximum heap size [2147483648]; this can cause resize pauses and prevents mlockall from locking the entire heap
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
memory locking requested for elasticsearch process but memory is not locked
  at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:125)
  at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:85)
  at org.elasticsearch.bootstrap.BootstrapCheck.check(BootstrapCheck.java:65)
  at org.elasticsearch.bootstrap.Bootstrap$5.validateNodeBeforeAcceptingRequests(Bootstrap.java:183)
  at org.elasticsearch.node.Node.start(Node.java:337)
  at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:198)
  at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:257)
  at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:96)
  at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:91)
  at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
  at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:91)
  at org.elasticsearch.cli.Command.main(Command.java:53)
  at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:70)
  at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:63)
Refer to the log for complete error details.
[2016-06-28 14:55:49,770][INFO ][node      ] [Goldbug] stopping ...
[2016-06-28 14:55:49,875][INFO ][node      ] [Goldbug] stopped
[2016-06-28 14:55:49,875][INFO ][node      ] [Goldbug] closing ...
[2016-06-28 14:55:49,887][INFO ][node      ] [Goldbug] closed

這個問題折騰了我一下午,最后還是找到了解決方案,同樣回到config/elasticsearch.yml文件,找到如下配置,開放discovery.zen.ping.unicast.hosts及discovery.zen.minimum_master_nodes

?
1
2
3
4
5
6
7
8
9
10
11
12
13
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["192.168.0.155"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>

然后修改max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]這個錯誤(切換到root操作)

?
1
2
3
4
5
[root@localhost ~]# cp /etc/security/limits.conf /etc/security/limits.conf.bak
[root@localhost ~]# cat /etc/security/limits.conf | grep -v "seven" > /tmp/system_limits.conf
[root@localhost ~]# echo "seven hard nofile 65536" >> /tmp/system_limits.conf
[root@localhost ~]# echo "seven soft nofile 65536" >> /tmp/system_limits.conf
[root@localhost ~]# mv /tmp/system_limits.conf /etc/security/limits.conf

修改后重新登錄seven用戶,使用如下命令查看是否修改成功

?
1
2
[seven@localhost ~]$ ulimit -Hn
65536

接下來就可以啟動elasticsearch了,啟動完成使用瀏覽器訪問http://192.168.0.155:9200

?
1
2
3
4
5
6
7
8
9
10
11
12
{
 "name" : "Vampire by Night",
 "cluster_name" : "elasticsearch",
 "version" : {
 "number" : "5.0.0-alpha3",
 "build_hash" : "cad959b",
 "build_date" : "2016-05-26T08:25:57.564Z",
 "build_snapshot" : false,
 "lucene_version" : "6.0.0"
 },
 "tagline" : "You Know, for Search"
}

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。

原文鏈接:http://blog.csdn.net/u012371450/article/details/51776505

延伸 · 閱讀

精彩推薦
  • CentosCentOS 6.6實現(xiàn)永久修改DNS地址的方法

    CentOS 6.6實現(xiàn)永久修改DNS地址的方法

    這篇文章主要介紹了CentOS 6.6實現(xiàn)永久修改DNS地址的方法,涉及針對CentOS配置文件的相關(guān)設(shè)置技巧,具有一定參考借鑒價值,需要的朋友可以參考下 ...

    Linux社區(qū)4472020-08-21
  • CentosCentOS7設(shè)置日期和時間方法以及基本概念介紹

    CentOS7設(shè)置日期和時間方法以及基本概念介紹

    這篇文章主要介紹了CentOS7設(shè)置日期和時間方法以及基本概念介紹,本文講解使用CentOS7中的新命令timedatectl設(shè)置日期時間方法,需要的朋友可以參考下 ...

    CentOS之家6522019-09-19
  • CentosCentOS6.5下Redis安裝與配置詳細步驟

    CentOS6.5下Redis安裝與配置詳細步驟

    本篇文章主要介紹了CentOS6.5下Redis安裝與配置詳細步驟,詳細介紹redis單機單實例安裝與配置,服務(wù)及開機自啟動。有興趣的可以了解一下。...

    飛流11452021-12-24
  • CentosCentos7運用/dev/shm進行網(wǎng)站優(yōu)化

    Centos7運用/dev/shm進行網(wǎng)站優(yōu)化

    這篇文章主要介紹了LINUX中Centos7運用/dev/shm進行網(wǎng)站優(yōu)化相關(guān)知識點,對此有興趣的朋友參考學(xué)習(xí)下。...

    彬菌9912022-03-02
  • CentosCentos 7開啟網(wǎng)卡自動獲取IP的詳細方法

    Centos 7開啟網(wǎng)卡自動獲取IP的詳細方法

    本篇文章主要介紹了Centos 7開啟網(wǎng)卡自動獲取IP的詳細方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧...

    凌鋒8972021-12-29
  • Centoscentos不小心刪除/root目錄該如何解決?

    centos不小心刪除/root目錄該如何解決?

    一些朋友最近在問小編centos不小心刪除/root目錄該如何解決?今天小編就為大家分享centos不小心刪除/root目錄解決辦法;希望對大家會有幫助,有需要的朋友...

    腳本之家8022019-05-29
  • Centoscentos 安裝與操作方法

    centos 安裝與操作方法

    這篇文章主要介紹了centos 安裝與操作方法,需要的朋友可以參考下...

    centos之家5272019-07-11
  • CentosCentOS下Uptime命令詳解

    CentOS下Uptime命令詳解

    在Linux下,我們可以使用uptime命令,而且此命令不必使用root權(quán)限。uptime命令在系統(tǒng)中已經(jīng)默認安裝了。今天小編為大家?guī)淼氖荂entOS下Uptime命令詳解;希望...

    CentOS之家11482019-06-19
主站蜘蛛池模板: 特级无码毛片免费视频尤物 | 国产成人av一区二区 | 久久逼网| 久久99久久98精品免观看软件 | 91在线精品亚洲一区二区 | 国产精品成人免费一区久久羞羞 | 国产一级大片在线观看 | 国产青草视频在线观看视频 | 久久精品女人天堂av | 成人激情视频网 | 国产精品一区视频 | 成人毛片av在线 | 久久免费精品 | 欧美一级鲁丝片免费看 | 99精品欧美一区二区 | 一本色道久久综合狠狠躁篇适合什么人看 | 日韩激情一区 | 国产亚洲精品久久久久久网站 | 成人啪啪18免费网站 | 极品一级片 | 日韩欧美视频一区二区三区 | 中文字幕一区在线观看视频 | 中国hdxxxx护士爽在线观看 | 一区二区久久久久草草 | 亚洲福利在线观看视频 | 未成年人在线观看 | 在线免费观看毛片 | 美女视频在线观看黄 | 国产精品区在线12p 午夜视频色 | 久久久www免费看片 亚洲综合视频一区 | 三级国产三级在线 | 成人aaaaa片毛片按摩 | 成人毛片网 | 美女网站黄在线观看 | 成人啪啪18免费网站 | 日本高清视频网站www | 免费午夜网站 | 中文字幕在线视频日本 | 一区二区三区四区视频在线观看 | 亚洲国产精品99 | 99精品视频在线观看免费播放 |