elasticsearchan安装

1. yum方式下载安装java

	服务器系统:centos7 64bit
	jdk版本:jdk1.7 64bit

命令:

# yum install java-java-1.8.0-openjdk.x86_64

成功后显示:

Dependency Installed:
  pcsc-lite-libs.x86_64 0:1.8.8-8.el7                                                                                                                                                                              

Updated:
  java-1.8.0-openjdk.x86_64 1:1.8.0.222.b10-0.el7_6                                                                                                                                                                

Dependency Updated:
  java-1.8.0-openjdk-headless.x86_64 1:1.8.0.222.b10-0.el7_6                                                                                                                                                       

Complete!

  • 通过yum安装的默认路径为:/usr/lib/jvm 将
  • jdk的安装路径加入到JAVA_HOME
vi /etc/profile

在文件最后加入:

#set java environment
JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk.x86_64
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME CLASSPATH PATH

写好后按esc进入底部命令模式,输入:wq保存并退出

-使配置文件生效

. /etc/profile (注意 . 之后应有一个空格)

运行后不报错即为立即生效了

[root@haha jvm]# . /etc/profile
[root@haha jvm]# java -version
openjdk version "1.8.0_222"

2安装els

命令:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.1-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.4.1-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-7.4.1-linux-x86_64.tar.gz.sha512 
tar -xzf elasticsearch-7.4.1-linux-x86_64.tar.gz
cd elasticsearch-7.4.1/ 

如果提示shasum命令找不到就试试yum install perl-Digest-SHA 我运行后就好使了
中途提示 选y就好

3切换用户

不能用root用户去执行els,为了你的系统安全,如果不是root用户跳过此步,进入4

  • adduser putao //添加新用户 pas
  • swd putao //给新用户配密码
[root@haha elasticsearch-7.4.1]# adduser putao
[root@haha elasticsearch-7.4.1]# passwd putao
Changing password for user putao.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

将这几个压缩包所在的文件夹及解压完的文件夹权限给你新建的用户。之后再使用新用户启动就OK了。

[root@haha jvm]# chown -R putao elasticsearch-7.4.1
[root@haha jvm]# cd ../
[root@haha lib]# chown -R putao jvm

切换到新用户,进入文件夹运行els

[root@haha lib]# su putao
[putao@haha lib]$ cd jvm/elasticsearch-7.4.1
[putao@haha elasticsearch-7.4.1]$ ./bin/elasticsearch
...
2019-10-28T11:52:07,051][WARN ][o.e.b.BootstrapChecks    ] [haha.com] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2019-10-28T11:52:07,051][WARN ][o.e.b.BootstrapChecks    ] [haha.com] max number of threads [3756] for user [putao] is too low, increase to at least [4096]
[2019-10-28T11:52:07,051][WARN ][o.e.b.BootstrapChecks    ] [haha.com] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-10-28T11:52:07,052][WARN ][o.e.b.BootstrapChecks    ] [haha.com] 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
[2019-10-28T11:52:07,091][INFO ][o.e.c.c.ClusterBootstrapService] [haha.com] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2019-10-28T11:52:10,098][INFO ][o.e.c.c.Coordinator      ] [haha.com] setting initial configuration to VotingConfiguration{O8PlUY5hSFyVRyPlkY4NSA}
[2019-10-28T11:52:10,302][INFO ][o.e.c.s.MasterService    ] [haha.com] elected-as-master ([1] nodes joined)[{haha.com}{O8PlUY5hSFyVRyPlkY4NSA}{hoBeRtEYQF-4iXIHfPCq9g}{127.0.0.1}{127.0.0.1:9300}{dilm}{ml.machine_memory=1019797504, xpack.installed=true, ml.max_open_jobs=20} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 1, version: 1, reason: master node changed {previous [], current [{haha.com}{O8PlUY5hSFyVRyPlkY4NSA}{hoBeRtEYQF-4iXIHfPCq9g}{127.0.0.1}{127.0.0.1:9300}{dilm}{ml.machine_memory=1019797504, xpack.installed=true, ml.max_open_jobs=20}]}
[2019-10-28T11:52:10,480][INFO ][o.e.c.c.CoordinationState] [haha.com] cluster UUID set to [W6g_rWrFQDCQJNBly5YTYg]
[2019-10-28T11:52:10,534][INFO ][o.e.c.s.ClusterApplierService] [haha.com] master node changed {previous [], current [{haha.com}{O8PlUY5hSFyVRyPlkY4NSA}{hoBeRtEYQF-4iXIHfPCq9g}{127.0.0.1}{127.0.0.1:9300}{dilm}{ml.machine_memory=1019797504, xpack.installed=true, ml.max_open_jobs=20}]}, term: 1, version: 1, reason: Publication{term=1, version=1}
[2019-10-28T11:52:10,792][INFO ][o.e.h.AbstractHttpServerTransport] [haha.com] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2019-10-28T11:52:10,792][INFO ][o.e.n.Node               ] [haha.com] started
[2019-10-28T11:52:10,931][INFO ][o.e.g.GatewayService     ] [haha.com] recovered [0] indices into cluster_state
[2019-10-28T11:52:11,396][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.watch-history-10] for index patterns [.watcher-history-10*]
[2019-10-28T11:52:11,529][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.watches] for index patterns [.watches*]
[2019-10-28T11:52:11,580][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.triggered_watches] for index patterns [.triggered_watches*]
[2019-10-28T11:52:11,623][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.slm-history] for index patterns [.slm-history-1*]
[2019-10-28T11:52:11,682][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-7-*]
[2019-10-28T11:52:11,857][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.monitoring-es] for index patterns [.monitoring-es-7-*]
[2019-10-28T11:52:11,927][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.monitoring-beats] for index patterns [.monitoring-beats-7-*]
[2019-10-28T11:52:11,982][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.monitoring-alerts-7] for index patterns [.monitoring-alerts-7]
[2019-10-28T11:52:12,019][INFO ][o.e.c.m.MetaDataIndexTemplateService] [haha.com] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-7-*]
[2019-10-28T11:52:12,085][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [haha.com] adding index lifecycle policy [watch-history-ilm-policy]
[2019-10-28T11:52:12,137][INFO ][o.e.x.i.a.TransportPutLifecycleAction] [haha.com] adding index lifecycle policy [slm-history-ilm-policy]
[2019-10-28T11:52:12,335][INFO ][o.e.l.LicenseService     ] [haha.com] license [6afdaaf6-cfc8-4696-a440-b15cdda11f87] mode [basic] - valid
[2019-10-28T11:52:12,336][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [haha.com] Active license is now [BASIC]; Security is disabled
   

运行成功了。访问浏览器loalhost:9200
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值