Elasticssearch 7.6.2的下载:wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz
kibana-7.6.2的下载:wget https://artifacts.elastic.co/downloads/kibana/kibana-7.6.2-linux-x86_64.tar.gz
logstash-7.6.2的下载:wget https://artifacts.elastic.co/downloads/logstash/logstash-7.6.2.tar.gz
https://www.elastic.co/guide/en/elasticsearch/reference/7.6/release-notes-7.6.2.html
tar -zxvf elasticsearch-7.6.2-linux-x86_64.tar.gz
mv elasticsearch-7.6.2 elasticsearch
查看自己的电脑是否安装了java环境,如果安装了就不用管(1.8或者1.8以上) ,没安装也没事,es从7开始自带jdk了,只需要配置下配置环境变量就可以:
查看jdk版本命令:java -version
配置jdk环境变量的文件:vim /etc/profile
如果当前自己安装的jdk版本比es自带的jdk版本低,启动es时会有提示,但可以运行:
future versions of Elasticsearch will require Java 11; your Java version from [/home/jdk1.8/jre] does not meet this requirement
2.4.1 修改jvm内存:vim /home/elasticsearch/config/jvm.options,内存的大小可以结合自己的配置及需求修改,我这没改:
2.4.2 修改ES的最重要的配置:vim /home/elasticsearch/config/elasticsearch.yml:
以上操作都是在root用户下进行的;
[root@query bin]# ./elasticsearch
future versions of Elasticsearch will require Java 11; your Java version from [/home/jdk1.8/jre] does not meet this requirement
[2020-04-03T03:34:48,832][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [query] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:125) ~[elasticsearch-cli-7.6.2.jar:7.6.2]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.6.2.jar:7.6.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.6.2.jar:7.6.2]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) ~[elasticsearch-7.6.2.jar:7.6.2]
at org.elas
解决方法是:
adduser elk
passwd elk
加完“elk”用户后,启动ES必须切换到elk用户下再启动;
Exception in thread "main" java.nio.file.AccessDeniedException: /home/elasticsearch/config/jvm.options
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:64)
解决方法:(回到root下,给整个es解压文件目录)
chown -R elk:elk elasticsearch
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
ERROR: Elasticsearch did not exit normally - check the logs at /home/elasticsearch/logs/my-application.log
解决方法:回到root用户下:
su root ,输入root的密码;
vim /etc/security/limits.conf,在最后一行“# End of file”的前面加上以下配置
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
* soft nofile 131070
* hard nofile 655360
* soft nproc 4096
* hard nproc 4096
# End of file
vim /etc/security/limits.conf,在最下面,加两行配置:
vm.max_map_count=655360
fs.file-max=655360
sysctl -p 使得配置生效
登录web地址:http://ip:9200,出现以下的内容:
https://github.com/mobz/elasticsearch-head/blob/master/crx/es-head.crx
遇见文件请参看我的另一篇文章《该扩展程序未列在 Chrome 网上应用店中,并可能是在您不知情的情况下添加的--解决方法》;
看到以上内容,插件安装成功!