zoukankan      html  css  js  c++  java
  • linux安装6.5.3版本elastic search

      到官网https://www.elastic.co/cn/downloads/elasticsearch下载压缩包,目前最新的版本是7.3.2,我想下6.5.3,点击下面的past release链接到历史版本:

      找到Elasticsearch 6.5.3后,点击右边Download,在下载页面点击Linux链接开始下载。下完后通过rz上传至wlf用户的soft目录,返回上一层目录解压:

    $ cd ..
    $ rz -y
    rz waiting to receive.
    开始 zmodem 传输。  按 Ctrl+C 取消。
      100%  110679 KB 5825 KB/s 00:00:19       0 Errorss
    
    $ cd ..
    $ tar xzvf soft/elasticsearch-6.5.3.tar.gz

      进入解压后目录,启动elasticsearch:

    $ cd elasticsearch-6.5.3/
    $ bin/elasticsearch

      这时会出现启动日志:

    [2019-09-26T15:14:01,844][INFO ][o.e.e.NodeEnvironment    ] [E1zoynp] using [1] data paths, mounts [[/home (/dev/sdc2)]], net usable_space [123gb], net total_space [147.5gb], types [ext3]
    [2019-09-26T15:14:01,848][INFO ][o.e.e.NodeEnvironment    ] [E1zoynp] heap size [989.8mb], compressed ordinary object pointers [true]
    [2019-09-26T15:14:01,850][INFO ][o.e.n.Node               ] [E1zoynp] node name derived from node ID [E1zoynp1TQaPj3a3MALUsA]; set [node.name] to override
    [2019-09-26T15:14:01,850][INFO ][o.e.n.Node               ] [E1zoynp] version[6.5.3], pid[29289], build[default/tar/159a78a/2018-12-06T20:11:28.826501Z], OS[Linux/3.10.0-514.el7.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_221/25.221-b11]
    [2019-09-26T15:14:01,851][INFO ][o.e.n.Node               ] [E1zoynp] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -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.Qae6xuDZ, -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=/home/wlf/elasticsearch-6.5.3, -Des.path.conf=/home/wlf/elasticsearch-6.5.3/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
    [2019-09-26T15:14:04,454][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [aggs-matrix-stats]
    [2019-09-26T15:14:04,454][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [analysis-common]
    [2019-09-26T15:14:04,454][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [ingest-common]
    [2019-09-26T15:14:04,454][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [lang-expression]
    [2019-09-26T15:14:04,454][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [lang-mustache]
    [2019-09-26T15:14:04,455][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [lang-painless]
    [2019-09-26T15:14:04,455][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [mapper-extras]
    [2019-09-26T15:14:04,455][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [parent-join]
    [2019-09-26T15:14:04,455][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [percolator]
    [2019-09-26T15:14:04,455][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [rank-eval]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [reindex]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [repository-url]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [transport-netty4]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [tribe]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-ccr]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-core]
    [2019-09-26T15:14:04,456][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-deprecation]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-graph]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-logstash]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-ml]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-monitoring]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-rollup]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-security]
    [2019-09-26T15:14:04,457][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-sql]
    [2019-09-26T15:14:04,458][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-upgrade]
    [2019-09-26T15:14:04,458][INFO ][o.e.p.PluginsService     ] [E1zoynp] loaded module [x-pack-watcher]
    [2019-09-26T15:14:04,458][INFO ][o.e.p.PluginsService     ] [E1zoynp] no plugins loaded
    [2019-09-26T15:14:10,006][INFO ][o.e.x.s.a.s.FileRolesStore] [E1zoynp] parsed [0] roles from file [/home/wlf/elasticsearch-6.5.3/config/roles.yml]
    [2019-09-26T15:14:10,601][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [E1zoynp] [controller/29371] [Main.cc@109] controller (64 bit): Version 6.5.3 (Build f418a701d70c6e) Copyright (c) 2018 Elasticsearch BV
    [2019-09-26T15:14:11,166][DEBUG][o.e.a.ActionModule       ] [E1zoynp] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
    [2019-09-26T15:14:11,465][INFO ][o.e.d.DiscoveryModule    ] [E1zoynp] using discovery type [zen] and host providers [settings]
    [2019-09-26T15:14:12,528][INFO ][o.e.n.Node               ] [E1zoynp] initialized
    [2019-09-26T15:14:12,528][INFO ][o.e.n.Node               ] [E1zoynp] starting ...
    [2019-09-26T15:14:12,727][INFO ][o.e.t.TransportService   ] [E1zoynp] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
    [2019-09-26T15:14:12,748][WARN ][o.e.b.BootstrapChecks    ] [E1zoynp] max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
    [2019-09-26T15:14:15,805][INFO ][o.e.c.s.MasterService    ] [E1zoynp] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {E1zoynp}{E1zoynp1TQaPj3a3MALUsA}{qt-wUtPfR5qXa80mnt5mqQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=25112506368, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
    [2019-09-26T15:14:15,812][INFO ][o.e.c.s.ClusterApplierService] [E1zoynp] new_master {E1zoynp}{E1zoynp1TQaPj3a3MALUsA}{qt-wUtPfR5qXa80mnt5mqQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=25112506368, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {E1zoynp}{E1zoynp1TQaPj3a3MALUsA}{qt-wUtPfR5qXa80mnt5mqQ}{127.0.0.1}{127.0.0.1:9300}{ml.machine_memory=25112506368, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
    [2019-09-26T15:14:15,836][INFO ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [E1zoynp] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
    [2019-09-26T15:14:15,837][INFO ][o.e.n.Node               ] [E1zoynp] started
    [2019-09-26T15:14:15,911][WARN ][o.e.x.s.a.s.m.NativeRoleMappingStore] [E1zoynp] Failed to clear cache for realms [[]]
    [2019-09-26T15:14:15,974][INFO ][o.e.g.GatewayService     ] [E1zoynp] recovered [0] indices into cluster_state
    [2019-09-26T15:14:16,150][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.triggered_watches] for index patterns [.triggered_watches*]
    [2019-09-26T15:14:16,321][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.watches] for index patterns [.watches*]
    [2019-09-26T15:14:16,416][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.watch-history-9] for index patterns [.watcher-history-9*]
    [2019-09-26T15:14:16,493][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.monitoring-logstash] for index patterns [.monitoring-logstash-6-*]
    [2019-09-26T15:14:16,580][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.monitoring-es] for index patterns [.monitoring-es-6-*]
    [2019-09-26T15:14:16,673][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.monitoring-beats] for index patterns [.monitoring-beats-6-*]
    [2019-09-26T15:14:16,752][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.monitoring-alerts] for index patterns [.monitoring-alerts-6]
    [2019-09-26T15:14:16,858][INFO ][o.e.c.m.MetaDataIndexTemplateService] [E1zoynp] adding template [.monitoring-kibana] for index patterns [.monitoring-kibana-6-*]
    [2019-09-26T15:14:17,093][INFO ][o.e.l.LicenseService     ] [E1zoynp] license [73b3cfc0-8f81-44ac-bff0-3bbbfff109f4] mode [basic] - valid

      可以看到,默认端口为9300,我们克隆会话,进入wlf用户访问下它:

    $ curl http://localhost:9200
    {
      "name" : "E1zoynp",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "ygHI0wjdSfy6dCDQitBcvQ",
      "version" : {
        "number" : "6.5.3",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "159a78a",
        "build_date" : "2018-12-06T20:11:28.826501Z",
        "build_snapshot" : false,
        "lucene_version" : "7.5.0",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }

       给本机访问是没问题了,但往往我们需要开放端口提供远程访问,这时我们需要通过vi修改配置文件config/elasticsearch.yml,将ip指定为部署机器的ip或者直接设置4个0:

    # Make sure that the heap size is set to about half the memory available
    # on the system and that the owner of the process is allowed to use this
    # limit.
    #
    # Elasticsearch performs poorly when the system is swapping the memory.
    #
    # ---------------------------------- Network -----------------------------------
    #
    # Set the bind address to a specific IP (IPv4 or IPv6):
    #
    network.host: 0.0.0.0

      以上修改保存还有两个地方要改下,此时不得不使用root用户了,因为要修改的东西在etc目录下,我们先备份sysctl.conf,再通过vi编辑:

    # cd /etc
    # cp sysctl.conf sysctl.conf.bak
    # vi sysctl.conf

      新增配置:

    vm.max_map_count=655360

      最后执行sysctl -p生效:

    # sysctl -p

      接着进入etc/security目录修改limit.conf,同样先备份再修改:

    # cd /etc/security
    # cp limit.conf limit.conf.bak
    # vi limit.conf

      新增配置:

    * soft nofile 65536
    * hard nofile 131072
    * soft nproc 2048
    * hard nproc 4096

      保存后需要先退出当前用户wlf,重新登陆才能生效。重新登陆后我们使用后台启动elasticsearch:

    $ elasticsearch-6.5.3
    $ nohup bin/elasticsearch &

      现在可以指定ip访问9200了:

  • 相关阅读:
    杭电acm1517
    杭电acm1228
    杭电acm1859
    杭电acm1124
    杭电acm1327
    CPP Templates 之 template 关键字的用法技巧
    malloc与calloc区别
    CPP Templates 之 类模板的继承
    CPP Templates 之 模板演绎的注意事项
    CPP Templates 之 局部类模板特化
  • 原文地址:https://www.cnblogs.com/wuxun1997/p/11592021.html
Copyright © 2011-2022 走看看