服务器系统: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!
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"
命令:
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就好
不能用root用户去执行els,为了你的系统安全,如果不是root用户跳过此步,进入4
[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