zoukankan      html  css  js  c++  java
  • CentOS环境部署单节点ElasticSearch实战案例

            CentOS环境部署单节点ElasticSearch实战案例

                                     作者:尹正杰

    版权声明:原创作品,谢绝转载!否则将追究法律责任。

    一.环境说明

    1>.准备环境

    [root@es201.yinzhengjie.com ~]# free -h
                  total        used        free      shared  buff/cache   available
    Mem:           3.8G         97M        3.6G         11M        118M        3.6G
    Swap:            0B          0B          0B
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# uname -r
    3.10.0-957.el7.x86_64
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# uname -m
    x86_64
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# cat /etc/redhat-release 
    CentOS Linux release 7.6.1810 (Core) 
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# vim /etc/profile.d/jdk.sh
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# cat /etc/profile.d/jdk.sh
    #!/bin/bash
    
    export JAVA_HOME=/yinzhengjie/softwares/jdk1.8.0_201
    export JRE_HOME=$JAVA_HOME/jre
    export CLASSPATH=.:$JAVA_HOME/LIB:$JRE_HOME/LIB:$CLASSPATH
    export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# source /etc/profile.d/jdk.sh
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# java -version
    java version "1.8.0_201"
    Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
    Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
    [root@es201.yinzhengjie.com ~]#

    2>.下载Elasticsearch软件包

      博主推荐阅读:
        https://www.cnblogs.com/yinzhengjie2020/p/12934518.html

    二.基于二进制安装包方式部署

    1>.将下载的Elasticsearch软件包上传到指定的服务器并解压

    [root@es201.yinzhengjie.com ~]# ll
    total 146432
    -rw-r--r-- 1 root root 149943230 Jun  2 08:02 elasticsearch-6.8.9.tar.gz
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# mkdir -pv /yinzhengjie/softwares/elasticstack
    mkdir: created directory ‘/yinzhengjie/softwares/elasticstack’
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# tar -zxf elasticsearch-6.8.9.tar.gz -C /yinzhengjie/softwares/elasticstack/
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# ll /yinzhengjie/softwares/elasticstack/
    total 0
    drwxr-xr-x 8 631 503 143 May  5 01:04 elasticsearch-6.8.9
    [root@es201.yinzhengjie.com ~]#
    [root@es201.yinzhengjie.com ~]# tar -zxf elasticsearch-6.8.9.tar.gz -C /yinzhengjie/softwares/elasticstack/

    2>.创建符号链接

    [root@es201.yinzhengjie.com ~]# ll /yinzhengjie/softwares/elasticstack/
    total 0
    drwxr-xr-x 8 631 503 143 May  5 01:04 elasticsearch-6.8.9
    [root@es201.yinzhengjie.com ~]#
    [root@es201.yinzhengjie.com ~]# ln -sv /yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9 /yinzhengjie/softwares/elasticstack/es
    ‘/yinzhengjie/softwares/elasticstack/es’ -> ‘/yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9’
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# ll /yinzhengjie/softwares/elasticstack/
    total 0
    drwxr-xr-x 8  631  503 143 May  5 01:04 elasticsearch-6.8.9
    lrwxrwxrwx 1 root root  55 Jun  2 16:16 es -> /yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9
    [root@es201.yinzhengjie.com ~]# 
     
    [root@es201.yinzhengjie.com ~]# ln -sv /yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9 /yinzhengjie/softwares/elasticstack/es

    3>.Elasticsearch目录结构说明

    [root@es201.yinzhengjie.com ~]# ll /yinzhengjie/softwares/elasticstack/es/
    total 460
    drwxr-xr-x  3 631 503   4096 Jun  2 16:14 bin                #ES服务的管理脚本
    drwxr-xr-x  2 631 503    148 Jun  2 16:14 config              #ES的配置文件
    drwxr-xr-x  3 631 503   4096 Jun  2 16:14 lib                #ES的依赖JAR包
    -rw-r--r--  1 631 503  13675 May  5 00:58 LICENSE.txt
    drwxr-xr-x  2 631 503      6 May  5 01:04 logs                #日志信息
    drwxr-xr-x 31 631 503   4096 May  5 01:04 modules              #ES的核心模块
    -rw-r--r--  1 631 503 427502 May  5 01:04 NOTICE.txt
    drwxr-xr-x  2 631 503      6 May  5 01:04 plugins              #ES的插件
    -rw-r--r--  1 631 503   8534 May  5 00:58 README.textile
    [root@es201.yinzhengjie.com ~]#

    4>.配置ES的环境变量

    [root@es201.yinzhengjie.com ~]# vim /etc/profile.d/es.sh
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# cat /etc/profile.d/es.sh
    #!/bin/bash
    
    #ADD BY Yinzhengjie FOR elasticstack
    ES_HOME=/yinzhengjie/softwares/elasticstack/es
    PATH=$PATH:${ES_HOME}/bin
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# el        #输入2个字母后连按两下"TAB"键,如果有以下提示说明环境变量配置成功
    elasticsearch                      elasticsearch-croneval             elasticsearch-plugin               elasticsearch-sql-cli              elasticsearch-users
    elasticsearch-certgen              elasticsearch-croneval.bat         elasticsearch-saml-metadata        elasticsearch-sql-cli-6.8.9.jar    elasticsearch-users.bat
    elasticsearch-certgen.bat          elasticsearch-env                  elasticsearch-saml-metadata.bat    elasticsearch-sql-cli.bat          elfedit
    elasticsearch-certutil             elasticsearch-keystore             elasticsearch-setup-passwords      elasticsearch-syskeygen            elif
    elasticsearch-certutil.bat         elasticsearch-migrate              elasticsearch-setup-passwords.bat  elasticsearch-syskeygen.bat        else
    elasticsearch-cli                  elasticsearch-migrate.bat          elasticsearch-shard                elasticsearch-translog             
    [root@es201.yinzhengjie.com ~]#
    [root@es201.yinzhengjie.com ~]# vim /etc/profile.d/es.sh

    5>.创建用户并在前台启动

    [root@es201.yinzhengjie.com ~]# elasticsearch               #很明显发现基于root用户启动失败啦,从输出信息可用看出ES服务不能基于root用户启动哟~
    [2020-06-02T16:29:36,240][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] 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:163) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.9.jar:6.8.9]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.9.jar:6.8.9]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.9.jar:6.8.9]
    Caused by: java.lang.RuntimeException: can not run elasticsearch as root  
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.9.jar:6.8.9]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.9.jar:6.8.9]
        ... 6 more
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# elasticsearch               #很明显发现基于root用户启动失败啦,从输出信息可用看出ES服务不能基于root用户启动哟~
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch           #尽管我们使用普通用户启动ES发现依旧无法启动,从报错信息来看是权限被拒绝
    Exception in thread "main" java.nio.file.AccessDeniedException: /yinzhengjie/softwares/elasticstack/es/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:60)
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch           #尽管我们使用普通用户启动ES发现依旧无法启动,从报错信息来看是权限被拒绝
    [root@es201.yinzhengjie.com ~]# useradd yinzhengjie
    [root@es201.yinzhengjie.com ~]# 
    
    [root@es201.yinzhengjie.com ~]# ll /yinzhengjie/softwares/elasticstack/
    total 0
    drwxr-xr-x 8 631 503 143 May 5 01:04 elasticsearch-6.8.9
    lrwxrwxrwx 1 root root 55 Jun 2 16:16 es -> /yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# chown -R yinzhengjie:yinzhengjie /yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9/
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# ll /yinzhengjie/softwares/elasticstack/
    total 0
    drwxr-xr-x 8 yinzhengjie yinzhengjie 143 May 5 01:04 elasticsearch-6.8.9
    lrwxrwxrwx 1 root root 55 Jun 2 16:16 es -> /yinzhengjie/softwares/elasticstack/elasticsearch-6.8.9
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# su -l yinzhengjie
    Last login: Tue Jun  2 16:34:02 CST 2020 on pts/0
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch            #在前台启动ES服务
    [root@es201.yinzhengjie.com ~]# su -l yinzhengjie
    Last login: Tue Jun  2 16:34:02 CST 2020 on pts/0
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch
    [2020-06-02T16:39:27,211][INFO ][o.e.e.NodeEnvironment    ] [l_93UUz] using [1] data paths, mounts [[/yinzhengjie (/dev/mapper/centos-yinzhengjie)]], net usable_space [1.5tb], net total_spa
    ce [1.5tb], types [xfs][2020-06-02T16:39:27,213][INFO ][o.e.e.NodeEnvironment    ] [l_93UUz] heap size [1007.3mb], compressed ordinary object pointers [true]
    [2020-06-02T16:39:27,214][INFO ][o.e.n.Node               ] [l_93UUz] node name derived from node ID [l_93UUzbTyO7p8v2gi0k5g]; set [node.name] to override
    [2020-06-02T16:39:27,215][INFO ][o.e.n.Node               ] [l_93UUz] version[6.8.9], pid[6162], build[default/tar/be2c7bf/2020-05-04T17:00:34.323820Z], OS[Linux/3.10.0-957.el7.x86_64/amd64
    ], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09][2020-06-02T16:39:27,215][INFO ][o.e.n.Node               ] [l_93UUz] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOcc
    upancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-4253411128705206804, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/yinzhengjie/softwares/elasticstack/es, -Des.path.conf=/yinzhengjie/softwares/elasticstack/es/config, -Des.distribution.flavor=default, -Des.distribution.type=tar][2020-06-02T16:39:29,446][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [aggs-matrix-stats]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [analysis-common]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-common]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-geoip]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-user-agent]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-expression]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-mustache]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-painless]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [mapper-extras]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [parent-join]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [percolator]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [rank-eval]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [reindex]
    [2020-06-02T16:39:29,447][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [repository-url]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [transport-netty4]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [tribe]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ccr]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-core]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-deprecation]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-graph]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ilm]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-logstash]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ml]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-monitoring]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-rollup]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-security]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-sql]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-upgrade]
    [2020-06-02T16:39:29,448][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-watcher]
    [2020-06-02T16:39:29,449][INFO ][o.e.p.PluginsService     ] [l_93UUz] no plugins loaded
    [2020-06-02T16:39:33,428][INFO ][o.e.x.s.a.s.FileRolesStore] [l_93UUz] parsed [0] roles from file [/yinzhengjie/softwares/elasticstack/es/config/roles.yml]
    [2020-06-02T16:39:34,092][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [l_93UUz] [controller/6224] [Main.cc@109] controller (64 bit): Version 6.8.9 (Build 9e6927f4414d87) Copyright (c) 2020 Ela
    sticsearch BV[2020-06-02T16:39:34,582][DEBUG][o.e.a.ActionModule       ] [l_93UUz] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2020-06-02T16:39:34,844][INFO ][o.e.d.DiscoveryModule    ] [l_93UUz] using discovery type [zen] and host providers [settings]
    [2020-06-02T16:39:35,726][INFO ][o.e.n.Node               ] [l_93UUz] initialized
    [2020-06-02T16:39:35,726][INFO ][o.e.n.Node               ] [l_93UUz] starting ...
    [2020-06-02T16:39:35,970][INFO ][o.e.t.TransportService   ] [l_93UUz] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
    [2020-06-02T16:39:35,998][WARN ][o.e.b.BootstrapChecks    ] [l_93UUz] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    [2020-06-02T16:39:39,080][INFO ][o.e.c.s.MasterService    ] [l_93UUz] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{AIo7i7GvQuaX6g6AJz
    tnkQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}[2020-06-02T16:39:39,085][INFO ][o.e.c.s.ClusterApplierService] [l_93UUz] new_master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{AIo7i7GvQuaX6g6AJztnkQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4
    123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{AIo7i7GvQuaX6g6AJztnkQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])[2020-06-02T16:39:39,177][INFO ][o.e.h.n.Netty4HttpServerTransport] [l_93UUz] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
    [2020-06-02T16:39:39,177][INFO ][o.e.n.Node               ] [l_93UUz] started
    [2020-06-02T16:39:39,182][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [l_93UUz] Failed to clear cache for realms [[]]
    [2020-06-02T16:39:39,240][INFO ][o.e.g.GatewayService     ] [l_93UUz] recovered [0] indices into cluster_state
    [2020-06-02T16:39:39,421][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.triggered_watches] for index patterns [.triggered_watches*]
    [2020-06-02T16:39:39,484][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.watch-history-9] for index patterns [.watcher-history-9*]
    [2020-06-02T16:39:39,511][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.watches] for index patterns [.watches*]
    [2020-06-02T16:39:39,537][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*]
    [2020-06-02T16:39:39,573][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*]
    [2020-06-02T16:39:39,606][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*]
    [2020-06-02T16:39:39,633][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6]
    [2020-06-02T16:39:39,660][INFO ][o.e.c.m.MetaDataIndexTemplateService] [l_93UUz] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*]
    [2020-06-02T16:39:39,739][INFO ][o.e.l.LicenseService     ] [l_93UUz] license [474d3b12-a4b9-4c91-995e-1b4355db65cb] mode [basic] - valid
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch           #在前台启动ES服务后,所有的日志信息会打印到当前的终端且当前终端陷入阻塞状态,需要开启新的终端验证ES服务是否启动
    [root@es201.yinzhengjie.com ~]# ss -ntl                    #观察ES服务是否启动成功,很明显默认是启动成功的,但仅限于本机访问哟~
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      20480                                                      127.0.0.1:9200                                                                           *:*                  
    LISTEN      0      20480                                                      127.0.0.1:9300                                                                           *:*                  
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# curl 127.0.0.1:9200             #访问ES,如果出现如下信息说明服务安装成功
    {
      "name" : "l_93UUz",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "6gzg1P3xQ4mwRkdihZ6buA",
      "version" : {
        "number" : "6.8.9",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "be2c7bf",
        "build_date" : "2020-05-04T17:00:34.323820Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.3",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# curl 127.0.0.1:9200             #访问ES,如果出现如下信息说明服务安装成功

    6>.修改ES的监听端口并后台启动

    [root@es201.yinzhengjie.com ~]# grep network.host /yinzhengjie/softwares/elasticstack/es/config/elasticsearch.yml 
    #network.host: 192.168.0.1
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# sed -r -i 's@#(network.host: )192.168.0.1@1es201.yinzhengjie.com@' /yinzhengjie/softwares/elasticstack/es/config/elasticsearch.yml 
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# grep network.host /yinzhengjie/softwares/elasticstack/es/config/elasticsearch.yml 
    network.host: es201.yinzhengjie.com
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# sed -r -i 's@#(network.host: )192.168.0.1@1es201.yinzhengjie.com@' /yinzhengjie/softwares/elasticstack/es/config/elasticsearch.yml
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch           #先前台启动,观察能否正常启动,如果有报错就先解决掉之后再使用后台方式启动
    [2020-06-02T17:22:13,845][INFO ][o.e.e.NodeEnvironment    ] [l_93UUz] using [1] data paths, mounts [[/yinzhengjie (/dev/mapper/centos-yinzhengjie)]], net usable_space [1.5tb], net total_spa
    ce [1.5tb], types [xfs][2020-06-02T17:22:13,847][INFO ][o.e.e.NodeEnvironment    ] [l_93UUz] heap size [1007.3mb], compressed ordinary object pointers [true]
    [2020-06-02T17:22:13,848][INFO ][o.e.n.Node               ] [l_93UUz] node name derived from node ID [l_93UUzbTyO7p8v2gi0k5g]; set [node.name] to override
    [2020-06-02T17:22:13,849][INFO ][o.e.n.Node               ] [l_93UUz] version[6.8.9], pid[6590], build[default/tar/be2c7bf/2020-05-04T17:00:34.323820Z], OS[Linux/3.10.0-957.el7.x86_64/amd64
    ], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09][2020-06-02T17:22:13,849][INFO ][o.e.n.Node               ] [l_93UUz] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOcc
    upancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-9184920614920500920, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/yinzhengjie/softwares/elasticstack/es, -Des.path.conf=/yinzhengjie/softwares/elasticstack/es/config, -Des.distribution.flavor=default, -Des.distribution.type=tar][2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [aggs-matrix-stats]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [analysis-common]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-common]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-geoip]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-user-agent]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-expression]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-mustache]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-painless]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [mapper-extras]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [parent-join]
    [2020-06-02T17:22:15,677][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [percolator]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [rank-eval]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [reindex]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [repository-url]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [transport-netty4]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [tribe]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ccr]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-core]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-deprecation]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-graph]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ilm]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-logstash]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ml]
    [2020-06-02T17:22:15,678][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-monitoring]
    [2020-06-02T17:22:15,679][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-rollup]
    [2020-06-02T17:22:15,679][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-security]
    [2020-06-02T17:22:15,679][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-sql]
    [2020-06-02T17:22:15,679][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-upgrade]
    [2020-06-02T17:22:15,679][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-watcher]
    [2020-06-02T17:22:15,679][INFO ][o.e.p.PluginsService     ] [l_93UUz] no plugins loaded
    [2020-06-02T17:22:18,802][INFO ][o.e.x.s.a.s.FileRolesStore] [l_93UUz] parsed [0] roles from file [/yinzhengjie/softwares/elasticstack/es/config/roles.yml]
    [2020-06-02T17:22:19,524][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [l_93UUz] [controller/6652] [Main.cc@109] controller (64 bit): Version 6.8.9 (Build 9e6927f4414d87) Copyright (c) 2020 Ela
    sticsearch BV[2020-06-02T17:22:19,922][DEBUG][o.e.a.ActionModule       ] [l_93UUz] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2020-06-02T17:22:20,095][INFO ][o.e.d.DiscoveryModule    ] [l_93UUz] using discovery type [zen] and host providers [settings]
    [2020-06-02T17:22:20,761][INFO ][o.e.n.Node               ] [l_93UUz] initialized
    [2020-06-02T17:22:20,761][INFO ][o.e.n.Node               ] [l_93UUz] starting ...
    [2020-06-02T17:22:20,879][INFO ][o.e.t.TransportService   ] [l_93UUz] publish_address {172.200.5.201:9300}, bound_addresses {172.200.5.201:9300}
    [2020-06-02T17:22:20,898][INFO ][o.e.b.BootstrapChecks    ] [l_93UUz] bound or publishing to a non-loopback address, enforcing bootstrap checks
    ERROR: [1] bootstrap checks failed                      #果然,问目发现有报错信息啦,这需要咱们去修改内核参数
    [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
    [2020-06-02T17:22:20,930][INFO ][o.e.n.Node               ] [l_93UUz] stopping ...
    [2020-06-02T17:22:20,956][INFO ][o.e.n.Node               ] [l_93UUz] stopped
    [2020-06-02T17:22:20,956][INFO ][o.e.n.Node               ] [l_93UUz] closing ...
    [2020-06-02T17:22:20,983][INFO ][o.e.n.Node               ] [l_93UUz] closed
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch           #先前台启动,观察能否正常启动,如果有报错就先解决掉之后再使用后台方式启动
    [root@es201.yinzhengjie.com ~]# vim /etc/security/limits.conf
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# cat /etc/security/limits.conf
    #Add by yinzhengjie
    *                soft    core               unlimited
    *                hard    core               unlimited
    *                soft    nproc              1000000
    *                hard    nproc              1000000
    *                soft    nofile             1000000
    *                hard    nofile             1000000
    *                soft    memlock            32000
    *                hard    memlock            32000
    *                soft    msgqueue           8192000
    *                hard    msgqueue           8192000
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# vim /etc/security/limits.conf
    [root@es201.yinzhengjie.com ~]# sysctl -q vm.max_map_count
    vm.max_map_count = 65530
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# sysctl -q fs.file-max
    fs.file-max = 395454
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# vim /etc/sysctl.d/es.conf
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# cat /etc/sysctl.d/es.conf
    #!/bin/bash
    
    #Add by yinzhengjie for Elasticsearch
    vm.max_map_count = 655360
    fs.file-max = 655360
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# sysctl -f /etc/sysctl.d/es.conf
    vm.max_map_count = 655360
    fs.file-max = 655360
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# sysctl -q vm.max_map_count
    vm.max_map_count = 655360
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# sysctl -q fs.file-max
    fs.file-max = 655360
    [root@es201.yinzhengjie.com ~]# 
    [root@es201.yinzhengjie.com ~]# vim /etc/sysctl.d/es.conf
    [yinzhengjie@es201.yinzhengjie.com ~]$ ss -ntl
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch -d         #后台启动ES
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ ss -ntl
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      20480                                                  172.200.5.201:9200                                                                           *:*                  
    LISTEN      0      20480                                                  172.200.5.201:9300                                                                           *:*                  
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ elasticsearch -d         #后台启动ES
    [yinzhengjie@es201.yinzhengjie.com ~]$ tail -100f /yinzhengjie/softwares/elasticstack/es/logs/elasticsearch.log
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [analysis-common]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-common]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-geoip]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-user-agent]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-expression]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-mustache]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-painless]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [mapper-extras]
    [2020-06-02T17:39:44,402][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [parent-join]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [percolator]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [rank-eval]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [reindex]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [repository-url]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [transport-netty4]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [tribe]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ccr]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-core]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-deprecation]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-graph]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ilm]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-logstash]
    [2020-06-02T17:39:44,403][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ml]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-monitoring]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-rollup]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-security]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-sql]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-upgrade]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-watcher]
    [2020-06-02T17:39:44,404][INFO ][o.e.p.PluginsService     ] [l_93UUz] no plugins loaded
    [2020-06-02T17:39:48,294][INFO ][o.e.x.s.a.s.FileRolesStore] [l_93UUz] parsed [0] roles from file [/yinzhengjie/softwares/elasticstack/es/config/roles.yml]
    [2020-06-02T17:39:48,799][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [l_93UUz] [controller/6892] [Main.cc@109] controller (64 bit): Version 6.8.9 (Build 9e6927f4414d87) Copyright (c) 2020 Ela
    sticsearch BV[2020-06-02T17:39:49,127][DEBUG][o.e.a.ActionModule       ] [l_93UUz] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2020-06-02T17:39:49,358][INFO ][o.e.d.DiscoveryModule    ] [l_93UUz] using discovery type [zen] and host providers [settings]
    [2020-06-02T17:39:50,056][INFO ][o.e.n.Node               ] [l_93UUz] initialized
    [2020-06-02T17:39:50,056][INFO ][o.e.n.Node               ] [l_93UUz] starting ...
    [2020-06-02T17:39:50,195][INFO ][o.e.t.TransportService   ] [l_93UUz] publish_address {172.200.5.201:9300}, bound_addresses {172.200.5.201:9300}
    [2020-06-02T17:39:50,217][INFO ][o.e.b.BootstrapChecks    ] [l_93UUz] bound or publishing to a non-loopback address, enforcing bootstrap checks
    [2020-06-02T17:39:53,293][INFO ][o.e.c.s.MasterService    ] [l_93UUz] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{LekqlSU7QUe8b-IUpi
    zcVQ}{es201.yinzhengjie.com}{172.200.5.201:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}[2020-06-02T17:39:53,298][INFO ][o.e.c.s.ClusterApplierService] [l_93UUz] new_master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{LekqlSU7QUe8b-IUpizcVQ}{es201.yinzhengjie.com}{172.200.5.201:9300}{ml.
    machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{LekqlSU7QUe8b-IUpizcVQ}{es201.yinzhengjie.com}{172.200.5.201:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])[2020-06-02T17:39:53,364][INFO ][o.e.h.n.Netty4HttpServerTransport] [l_93UUz] publish_address {172.200.5.201:9200}, bound_addresses {172.200.5.201:9200}
    [2020-06-02T17:39:53,364][INFO ][o.e.n.Node               ] [l_93UUz] started
    [2020-06-02T17:39:53,543][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [l_93UUz] Failed to clear cache for realms [[]]
    [2020-06-02T17:39:53,584][INFO ][o.e.l.LicenseService     ] [l_93UUz] license [474d3b12-a4b9-4c91-995e-1b4355db65cb] mode [basic] - valid
    [2020-06-02T17:39:53,591][INFO ][o.e.g.GatewayService     ] [l_93UUz] recovered [0] indices into cluster_state
    [2020-06-02T17:41:59,799][INFO ][o.e.x.m.p.NativeController] [l_93UUz] Native controller process has stopped - no new native processes can be started
    [2020-06-02T17:41:59,805][INFO ][o.e.n.Node               ] [l_93UUz] stopping ...
    [2020-06-02T17:41:59,817][INFO ][o.e.x.w.WatcherService   ] [l_93UUz] stopping watch service, reason [shutdown initiated]
    [2020-06-02T17:41:59,960][INFO ][o.e.n.Node               ] [l_93UUz] stopped
    [2020-06-02T17:41:59,960][INFO ][o.e.n.Node               ] [l_93UUz] closing ...
    [2020-06-02T17:41:59,975][INFO ][o.e.n.Node               ] [l_93UUz] closed
    [2020-06-02T17:42:20,994][INFO ][o.e.e.NodeEnvironment    ] [l_93UUz] using [1] data paths, mounts [[/yinzhengjie (/dev/mapper/centos-yinzhengjie)]], net usable_space [1.5tb], net total_spa
    ce [1.5tb], types [xfs][2020-06-02T17:42:20,997][INFO ][o.e.e.NodeEnvironment    ] [l_93UUz] heap size [1007.3mb], compressed ordinary object pointers [true]
    [2020-06-02T17:42:20,998][INFO ][o.e.n.Node               ] [l_93UUz] node name derived from node ID [l_93UUzbTyO7p8v2gi0k5g]; set [node.name] to override
    [2020-06-02T17:42:20,999][INFO ][o.e.n.Node               ] [l_93UUz] version[6.8.9], pid[7003], build[default/tar/be2c7bf/2020-05-04T17:00:34.323820Z], OS[Linux/3.10.0-957.el7.x86_64/amd64
    ], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09][2020-06-02T17:42:20,999][INFO ][o.e.n.Node               ] [l_93UUz] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOcc
    upancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-1381676436403593281, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/yinzhengjie/softwares/elasticstack/es, -Des.path.conf=/yinzhengjie/softwares/elasticstack/es/config, -Des.distribution.flavor=default, -Des.distribution.type=tar][2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [aggs-matrix-stats]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [analysis-common]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-common]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-geoip]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [ingest-user-agent]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-expression]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-mustache]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [lang-painless]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [mapper-extras]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [parent-join]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [percolator]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [rank-eval]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [reindex]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [repository-url]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [transport-netty4]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [tribe]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ccr]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-core]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-deprecation]
    [2020-06-02T17:42:22,845][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-graph]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ilm]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-logstash]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-ml]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-monitoring]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-rollup]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-security]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-sql]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-upgrade]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] loaded module [x-pack-watcher]
    [2020-06-02T17:42:22,846][INFO ][o.e.p.PluginsService     ] [l_93UUz] no plugins loaded
    [2020-06-02T17:42:26,396][INFO ][o.e.x.s.a.s.FileRolesStore] [l_93UUz] parsed [0] roles from file [/yinzhengjie/softwares/elasticstack/es/config/roles.yml]
    [2020-06-02T17:42:27,013][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [l_93UUz] [controller/7018] [Main.cc@109] controller (64 bit): Version 6.8.9 (Build 9e6927f4414d87) Copyright (c) 2020 Ela
    sticsearch BV[2020-06-02T17:42:27,363][DEBUG][o.e.a.ActionModule       ] [l_93UUz] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2020-06-02T17:42:27,541][INFO ][o.e.d.DiscoveryModule    ] [l_93UUz] using discovery type [zen] and host providers [settings]
    [2020-06-02T17:42:28,287][INFO ][o.e.n.Node               ] [l_93UUz] initialized
    [2020-06-02T17:42:28,287][INFO ][o.e.n.Node               ] [l_93UUz] starting ...
    [2020-06-02T17:42:28,437][INFO ][o.e.t.TransportService   ] [l_93UUz] publish_address {172.200.5.201:9300}, bound_addresses {172.200.5.201:9300}
    [2020-06-02T17:42:28,457][INFO ][o.e.b.BootstrapChecks    ] [l_93UUz] bound or publishing to a non-loopback address, enforcing bootstrap checks
    [2020-06-02T17:42:31,537][INFO ][o.e.c.s.MasterService    ] [l_93UUz] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{SopHB3jFQE-TUny2Yx
    LsPA}{es201.yinzhengjie.com}{172.200.5.201:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}[2020-06-02T17:42:31,540][INFO ][o.e.c.s.ClusterApplierService] [l_93UUz] new_master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{SopHB3jFQE-TUny2YxLsPA}{es201.yinzhengjie.com}{172.200.5.201:9300}{ml.
    machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {l_93UUz}{l_93UUzbTyO7p8v2gi0k5g}{SopHB3jFQE-TUny2YxLsPA}{es201.yinzhengjie.com}{172.200.5.201:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])[2020-06-02T17:42:31,610][INFO ][o.e.h.n.Netty4HttpServerTransport] [l_93UUz] publish_address {172.200.5.201:9200}, bound_addresses {172.200.5.201:9200}
    [2020-06-02T17:42:31,610][INFO ][o.e.n.Node               ] [l_93UUz] started
    [2020-06-02T17:42:31,767][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [l_93UUz] Failed to clear cache for realms [[]]
    [2020-06-02T17:42:31,807][INFO ][o.e.l.LicenseService     ] [l_93UUz] license [474d3b12-a4b9-4c91-995e-1b4355db65cb] mode [basic] - valid
    [2020-06-02T17:42:31,816][INFO ][o.e.g.GatewayService     ] [l_93UUz] recovered [0] indices into cluster_state
    [yinzhengjie@es201.yinzhengjie.com ~]$ tail -100f /yinzhengjie/softwares/elasticstack/es/logs/elasticsearch.log        #如果服务依旧启动失败,可以查看后台日志文件,根据日志的提示排错

    7>.基于WebUI访问Elasticsearch服务

    [yinzhengjie@es201.yinzhengjie.com ~]$ curl http://es201.yinzhengjie.com:9200/
    {
      "name" : "l_93UUz",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "6gzg1P3xQ4mwRkdihZ6buA",
      "version" : {
        "number" : "6.8.9",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "be2c7bf",
        "build_date" : "2020-05-04T17:00:34.323820Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.3",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }
    [yinzhengjie@es201.yinzhengjie.com ~]$ 
    [yinzhengjie@es201.yinzhengjie.com ~]$ curl http://es201.yinzhengjie.com:9200/

    三.基于RPM安装包方式部署

    1>.将下载的Elasticsearch软件包上传到指定的服务器开始安装

    [root@es202.yinzhengjie.com ~]# ll
    total 146012
    -rw-r--r-- 1 root root 149516063 Jun  1 10:03 elasticsearch-6.8.9.rpm
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# rpm -ivh elasticsearch-6.8.9.rpm 
    warning: elasticsearch-6.8.9.rpm: Header V4 RSA/SHA512 Signature, key ID d88e42b4: NOKEY
    Preparing...                          ################################# [100%]
    Creating elasticsearch group... OK
    Creating elasticsearch user... OK
    Updating / installing...
       1:elasticsearch-0:6.8.9-1          ################################# [100%]
    ### NOT starting on installation, please execute the following statements to configure elasticsearch service to start automatically using systemd
     sudo systemctl daemon-reload
     sudo systemctl enable elasticsearch.service
    ### You can start elasticsearch service by executing
     sudo systemctl start elasticsearch.service
    Created elasticsearch keystore in /etc/elasticsearch
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# rpm -ivh elasticsearch-6.8.9.rpm

    2>.启动elasticsearch服务

    [root@es202.yinzhengjie.com ~]# systemctl daemon-reload
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl enable elasticsearch.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/elasticsearch.service to /usr/lib/systemd/system/elasticsearch.service.
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl start elasticsearch.service
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl status elasticsearch.service
    ● elasticsearch.service - Elasticsearch
       Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
       Active: active (running) since Tue 2020-06-02 18:08:56 CST; 4s ago
         Docs: http://www.elastic.co
     Main PID: 5837 (java)
       CGroup: /system.slice/elasticsearch.service
               └─5837 /usr/local/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des...
    
    Jun 02 18:08:56 es202.yinzhengjie.com systemd[1]: Started Elasticsearch.
    Jun 02 18:08:56 es202.yinzhengjie.com elasticsearch[5837]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# ss -ntl
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      20480                                                      127.0.0.1:9200                                                                           *:*                  
    LISTEN      0      20480                                                      127.0.0.1:9300                                                                           *:*                  
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl status elasticsearch.service              #如果启动服务失败了也别着急,根据提示信息进行故障排除即可,下面的提示告诉找不到JAVA_HOME环境
    ● elasticsearch.service - Elasticsearch
       Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
       Active: failed (Result: exit-code) since Tue 2020-06-02 18:07:29 CST; 2s ago
         Docs: http://www.elastic.co
      Process: 5777 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
     Main PID: 5777 (code=exited, status=1/FAILURE)
    
    Jun 02 18:07:29 es202.yinzhengjie.com systemd[1]: Started Elasticsearch.
    Jun 02 18:07:29 es202.yinzhengjie.com elasticsearch[5777]: which: no java in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)      #我们发现它没有去咱们定义的PATH去找,而是去系统默认的路径找JDK环境变量啦~
    Jun 02 18:07:29 es202.yinzhengjie.com elasticsearch[5777]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
    Jun 02 18:07:29 es202.yinzhengjie.com elasticsearch[5777]: could not find java; set JAVA_HOME
    Jun 02 18:07:29 es202.yinzhengjie.com systemd[1]: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
    Jun 02 18:07:29 es202.yinzhengjie.com systemd[1]: Unit elasticsearch.service entered failed state.
    Jun 02 18:07:29 es202.yinzhengjie.com systemd[1]: elasticsearch.service failed.
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# echo ${PATH}            #实际上我们配置的有JDK环境变量
    /yinzhengjie/softwares/jdk1.8.0_201/bin:/yinzhengjie/softwares/jdk1.8.0_201/jre/bin:/yinzhengjie/softwares/jdk1.8.0_201/bin:/yinzhengjie/softwares/jdk1.8.0_201/jre/bin:/usr/local/sbin:/usr/
    local/bin:/usr/sbin:/usr/bin:/yinzhengjie/softwares/jdk1.8.0_201/bin:/root/bin
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# ln -sv /yinzhengjie/softwares/jdk1.8.0_201/bin/java /usr/local/bin/java            #根据上述的提示信息,我们将JDK链接到系统默认的PATH即可~/usr/local/bin/java’ -> ‘/yinzhengjie/softwares/jdk1.8.0_201/bin/java’
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl restart elasticsearch.service      #做完符号链接后重启服务即可
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl status elasticsearch.service       #很显然,服务启动成功啦~
    ● elasticsearch.service - Elasticsearch
       Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
       Active: active (running) since Tue 2020-06-02 18:08:56 CST; 4s ago
         Docs: http://www.elastic.co
     Main PID: 5837 (java)
       CGroup: /system.slice/elasticsearch.service
               └─5837 /usr/local/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des...
    
    Jun 02 18:08:56 es202.yinzhengjie.com systemd[1]: Started Elasticsearch.
    Jun 02 18:08:56 es202.yinzhengjie.com elasticsearch[5837]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl status elasticsearch.service              #如果启动服务失败了也别着急,根据提示信息进行故障排除即可~

    3>.验证服务是否启动成功

    [root@es202.yinzhengjie.com ~]# ss -ntl
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      20480                                                      127.0.0.1:9200                                                                           *:*                  
    LISTEN      0      20480                                                      127.0.0.1:9300                                                                           *:*                  
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# curl 127.0.0.1:9200
    {
      "name" : "TMifJaI",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "H2PtsoZBSUinttcbiqgCKg",
      "version" : {
        "number" : "6.8.9",
        "build_flavor" : "default",
        "build_type" : "rpm",
        "build_hash" : "be2c7bf",
        "build_date" : "2020-05-04T17:00:34.323820Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.3",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# curl 127.0.0.1:9200
    [root@es202.yinzhengjie.com ~]# tail -100f /var/log/elasticsearch/elasticsearch.log 
    [2020-06-02T18:09:43,056][INFO ][o.e.e.NodeEnvironment    ] [TMifJaI] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [498.1gb], net total_space [499.7gb], types [rootfs]
    [2020-06-02T18:09:43,058][INFO ][o.e.e.NodeEnvironment    ] [TMifJaI] heap size [1007.3mb], compressed ordinary object pointers [true]
    [2020-06-02T18:09:43,059][INFO ][o.e.n.Node               ] [TMifJaI] node name derived from node ID [TMifJaIOQ16On4VSPNw3GA]; set [node.name] to override
    [2020-06-02T18:09:43,059][INFO ][o.e.n.Node               ] [TMifJaI] version[6.8.9], pid[5837], build[default/rpm/be2c7bf/2020-05-04T17:00:34.323820Z], OS[Linux/3.10.0-957.el7.x86_64/amd64
    ], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09][2020-06-02T18:09:43,059][INFO ][o.e.n.Node               ] [TMifJaI] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOcc
    upancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-3542732766973306022, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=rpm][2020-06-02T18:09:44,981][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [aggs-matrix-stats]
    [2020-06-02T18:09:44,981][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [analysis-common]
    [2020-06-02T18:09:44,981][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [ingest-common]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [ingest-geoip]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [ingest-user-agent]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [lang-expression]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [lang-mustache]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [lang-painless]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [mapper-extras]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [parent-join]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [percolator]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [rank-eval]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [reindex]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [repository-url]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [transport-netty4]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [tribe]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-ccr]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-core]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-deprecation]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-graph]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-ilm]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-logstash]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-ml]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-monitoring]
    [2020-06-02T18:09:44,982][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-rollup]
    [2020-06-02T18:09:44,983][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-security]
    [2020-06-02T18:09:44,983][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-sql]
    [2020-06-02T18:09:44,983][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-upgrade]
    [2020-06-02T18:09:44,983][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-watcher]
    [2020-06-02T18:09:44,983][INFO ][o.e.p.PluginsService     ] [TMifJaI] no plugins loaded
    [2020-06-02T18:09:48,583][INFO ][o.e.x.s.a.s.FileRolesStore] [TMifJaI] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
    [2020-06-02T18:09:49,409][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [TMifJaI] [controller/5902] [Main.cc@109] controller (64 bit): Version 6.8.9 (Build 9e6927f4414d87) Copyright (c) 2020 Ela
    sticsearch BV[2020-06-02T18:09:49,876][DEBUG][o.e.a.ActionModule       ] [TMifJaI] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2020-06-02T18:09:50,103][INFO ][o.e.d.DiscoveryModule    ] [TMifJaI] using discovery type [zen] and host providers [settings]
    [2020-06-02T18:09:50,832][INFO ][o.e.n.Node               ] [TMifJaI] initialized
    [2020-06-02T18:09:50,832][INFO ][o.e.n.Node               ] [TMifJaI] starting ...
    [2020-06-02T18:10:01,616][INFO ][o.e.t.TransportService   ] [TMifJaI] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
    [2020-06-02T18:10:04,681][INFO ][o.e.c.s.MasterService    ] [TMifJaI] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {TMifJaI}{TMifJaIOQ16On4VSPNw3GA}{ZN7O7c_mQRCiB-XvbG
    epiA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}[2020-06-02T18:10:04,688][INFO ][o.e.c.s.ClusterApplierService] [TMifJaI] new_master {TMifJaI}{TMifJaIOQ16On4VSPNw3GA}{ZN7O7c_mQRCiB-XvbGepiA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4
    123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {TMifJaI}{TMifJaIOQ16On4VSPNw3GA}{ZN7O7c_mQRCiB-XvbGepiA}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])[2020-06-02T18:10:04,753][INFO ][o.e.h.n.Netty4HttpServerTransport] [TMifJaI] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
    [2020-06-02T18:10:04,753][INFO ][o.e.n.Node               ] [TMifJaI] started
    [2020-06-02T18:10:04,788][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [TMifJaI] Failed to clear cache for realms [[]]
    [2020-06-02T18:10:04,873][INFO ][o.e.g.GatewayService     ] [TMifJaI] recovered [0] indices into cluster_state
    [2020-06-02T18:10:05,196][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.watch-history-9] for index patterns [.watcher-history-9*]
    [2020-06-02T18:10:05,224][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.triggered_watches] for index patterns [.triggered_watches*]
    [2020-06-02T18:10:05,248][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.watches] for index patterns [.watches*]
    [2020-06-02T18:10:05,276][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*]
    [2020-06-02T18:10:05,324][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*]
    [2020-06-02T18:10:05,366][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*]
    [2020-06-02T18:10:05,387][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6]
    [2020-06-02T18:10:05,417][INFO ][o.e.c.m.MetaDataIndexTemplateService] [TMifJaI] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*]
    [2020-06-02T18:10:05,502][INFO ][o.e.l.LicenseService     ] [TMifJaI] license [1bea757f-5cce-4560-8a0f-e8640ebb9565] mode [basic] - valid
    [root@es202.yinzhengjie.com ~]# tail -100f /var/log/elasticsearch/elasticsearch.log       #查看启动日志

    4>.修改Elasticsearch的配置文件

    [root@es202.yinzhengjie.com ~]# cp /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml-`date +%F`          #记得先备份配置文件哟~
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# grep network.host /etc/elasticsearch/elasticsearch.yml 
    #network.host: 192.168.0.1
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# sed -r -i 's@#(network.host: )192.168.0.1@1es202.yinzhengjie.com@' /etc/elasticsearch/elasticsearch.yml 
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# grep network.host /etc/elasticsearch/elasticsearch.yml 
    network.host: es202.yinzhengjie.com
    [root@es202.yinzhengjie.com ~]# 

    5>.重启Elasticsearch服务

    [root@es202.yinzhengjie.com ~]# ss -ntl
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      20480                                                      127.0.0.1:9200                                                                           *:*                  
    LISTEN      0      20480                                                      127.0.0.1:9300                                                                           *:*                  
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl restart elasticsearch.service
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl restart elasticsearch.service 
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# ss -ntl
    State       Recv-Q Send-Q                                                 Local Address:Port                                                                Peer Address:Port              
    LISTEN      0      20480                                                  172.200.5.202:9200                                                                           *:*                  
    LISTEN      0      20480                                                  172.200.5.202:9300                                                                           *:*                  
    LISTEN      0      128                                                                *:22                                                                             *:*                  
    LISTEN      0      128                                                               :::22                                                                            :::*                  
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# systemctl restart elasticsearch.service
    [root@es202.yinzhengjie.com ~]# tail -100f /var/log/elasticsearch/elasticsearch.log 
    [2020-06-02T18:32:02,347][INFO ][o.e.n.Node               ] [TMifJaI] stopping ...
    [2020-06-02T18:32:02,362][INFO ][o.e.x.w.WatcherService   ] [TMifJaI] stopping watch service, reason [shutdown initiated]
    [2020-06-02T18:32:02,391][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [TMifJaI] [controller/5389] [Main.cc@148] Ml controller exiting
    [2020-06-02T18:32:02,392][INFO ][o.e.x.m.p.NativeController] [TMifJaI] Native controller process has stopped - no new native processes can be started
    [2020-06-02T18:32:02,402][INFO ][o.e.n.Node               ] [TMifJaI] stopped
    [2020-06-02T18:32:02,402][INFO ][o.e.n.Node               ] [TMifJaI] closing ...
    [2020-06-02T18:32:02,418][INFO ][o.e.n.Node               ] [TMifJaI] closed
    [2020-06-02T18:32:03,983][INFO ][o.e.e.NodeEnvironment    ] [TMifJaI] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [498.1gb], net total_space [499.7gb], types [rootfs]
    [2020-06-02T18:32:03,985][INFO ][o.e.e.NodeEnvironment    ] [TMifJaI] heap size [1007.3mb], compressed ordinary object pointers [true]
    [2020-06-02T18:32:03,986][INFO ][o.e.n.Node               ] [TMifJaI] node name derived from node ID [TMifJaIOQ16On4VSPNw3GA]; set [node.name] to override
    [2020-06-02T18:32:03,986][INFO ][o.e.n.Node               ] [TMifJaI] version[6.8.9], pid[5551], build[default/rpm/be2c7bf/2020-05-04T17:00:34.323820Z], OS[Linux/3.10.0-957.el7.x86_64/amd64
    ], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_201/25.201-b09][2020-06-02T18:32:03,986][INFO ][o.e.n.Node               ] [TMifJaI] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOcc
    upancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-1286223107463729407, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=/var/lib/elasticsearch, -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:/var/log/elasticsearch/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/etc/elasticsearch, -Des.distribution.flavor=default, -Des.distribution.type=rpm][2020-06-02T18:32:05,723][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [aggs-matrix-stats]
    [2020-06-02T18:32:05,723][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [analysis-common]
    [2020-06-02T18:32:05,723][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [ingest-common]
    [2020-06-02T18:32:05,723][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [ingest-geoip]
    [2020-06-02T18:32:05,723][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [ingest-user-agent]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [lang-expression]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [lang-mustache]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [lang-painless]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [mapper-extras]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [parent-join]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [percolator]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [rank-eval]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [reindex]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [repository-url]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [transport-netty4]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [tribe]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-ccr]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-core]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-deprecation]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-graph]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-ilm]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-logstash]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-ml]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-monitoring]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-rollup]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-security]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-sql]
    [2020-06-02T18:32:05,724][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-upgrade]
    [2020-06-02T18:32:05,725][INFO ][o.e.p.PluginsService     ] [TMifJaI] loaded module [x-pack-watcher]
    [2020-06-02T18:32:05,725][INFO ][o.e.p.PluginsService     ] [TMifJaI] no plugins loaded
    [2020-06-02T18:32:08,676][INFO ][o.e.x.s.a.s.FileRolesStore] [TMifJaI] parsed [0] roles from file [/etc/elasticsearch/roles.yml]
    [2020-06-02T18:32:09,330][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [TMifJaI] [controller/5615] [Main.cc@109] controller (64 bit): Version 6.8.9 (Build 9e6927f4414d87) Copyright (c) 2020 Ela
    sticsearch BV[2020-06-02T18:32:09,668][DEBUG][o.e.a.ActionModule       ] [TMifJaI] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2020-06-02T18:32:09,854][INFO ][o.e.d.DiscoveryModule    ] [TMifJaI] using discovery type [zen] and host providers [settings]
    [2020-06-02T18:32:10,555][INFO ][o.e.n.Node               ] [TMifJaI] initialized
    [2020-06-02T18:32:10,555][INFO ][o.e.n.Node               ] [TMifJaI] starting ...
    [2020-06-02T18:32:10,677][INFO ][o.e.t.TransportService   ] [TMifJaI] publish_address {172.200.5.202:9300}, bound_addresses {172.200.5.202:9300}
    [2020-06-02T18:32:10,696][INFO ][o.e.b.BootstrapChecks    ] [TMifJaI] bound or publishing to a non-loopback address, enforcing bootstrap checks
    [2020-06-02T18:32:13,765][INFO ][o.e.c.s.MasterService    ] [TMifJaI] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {TMifJaI}{TMifJaIOQ16On4VSPNw3GA}{pe2Cwr8RTqSKtiyRXN
    RjHA}{es202.yinzhengjie.com}{172.200.5.202:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}[2020-06-02T18:32:13,769][INFO ][o.e.c.s.ClusterApplierService] [TMifJaI] new_master {TMifJaI}{TMifJaIOQ16On4VSPNw3GA}{pe2Cwr8RTqSKtiyRXNRjHA}{es202.yinzhengjie.com}{172.200.5.202:9300}{ml.
    machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {TMifJaI}{TMifJaIOQ16On4VSPNw3GA}{pe2Cwr8RTqSKtiyRXNRjHA}{es202.yinzhengjie.com}{172.200.5.202:9300}{ml.machine_memory=4123009024, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])[2020-06-02T18:32:13,819][INFO ][o.e.h.n.Netty4HttpServerTransport] [TMifJaI] publish_address {172.200.5.202:9200}, bound_addresses {172.200.5.202:9200}
    [2020-06-02T18:32:13,819][INFO ][o.e.n.Node               ] [TMifJaI] started
    [2020-06-02T18:32:14,018][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [TMifJaI] Failed to clear cache for realms [[]]
    [2020-06-02T18:32:14,057][INFO ][o.e.l.LicenseService     ] [TMifJaI] license [1bea757f-5cce-4560-8a0f-e8640ebb9565] mode [basic] - valid
    [2020-06-02T18:32:14,065][INFO ][o.e.g.GatewayService     ] [TMifJaI] recovered [0] indices into cluster_state
    [root@es202.yinzhengjie.com ~]# tail -100f /var/log/elasticsearch/elasticsearch.log        #重启服务不要一直盯着终端看,建议另外开启一个终端查看日志

    6>.访问WebUI

    [root@es202.yinzhengjie.com ~]# curl http://es202.yinzhengjie.com:9200/
    {
      "name" : "TMifJaI",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "H2PtsoZBSUinttcbiqgCKg",
      "version" : {
        "number" : "6.8.9",
        "build_flavor" : "default",
        "build_type" : "rpm",
        "build_hash" : "be2c7bf",
        "build_date" : "2020-05-04T17:00:34.323820Z",
        "build_snapshot" : false,
        "lucene_version" : "7.7.3",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }
    [root@es202.yinzhengjie.com ~]# 
    [root@es202.yinzhengjie.com ~]# curl http://es202.yinzhengjie.com:9200/

  • 相关阅读:
    C++中的结构体
    C++转换
    C++常见问题解答
    hdu 1491
    hdu 1253
    [恢]hdu 2529
    [恢]hdu 2539
    hdu 1708
    [恢]hdu 2512
    [恢]hdu 2401
  • 原文地址:https://www.cnblogs.com/yinzhengjie2020/p/12940337.html
Copyright © 2011-2022 走看看