首页 > 网站 > 建站经验 > 正文

详解centos7虚拟机安装elasticsearch5.0.x-安装篇

2019-11-02 16:44:22
字体:
来源:转载
供稿:网友

centos7虚拟机安装elasticsearch5.0.x-安装篇

请预先安装jdk详细步骤请参考:http://www.jb51.net/softjc/193398.html

创建新用户(非root用户)

elasticsearch只能用非root启动,这里我创建了一个叫seven的用户

[root@localhost ~]# useradd seven[root@localhost ~]# passwd seven

下载elasticsearch

[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

解压

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

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

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

修改访问elasticsearch的IP及端口

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

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

# ---------------------------------- 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

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

启动时发现报错了。。。

[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 failedinitial heap size [268435456] not equal to maximum heap size [2147483648]; this can cause resize pauses and prevents mlockall from locking the entire heapmax 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 clustermax 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
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表