<optgroup id="gajtf"></optgroup>
  • <meter id="gajtf"></meter>
    <mark id="gajtf"><ruby id="gajtf"></ruby></mark>

  • <small id="gajtf"><strong id="gajtf"></strong></small>
  • <mark id="gajtf"><button id="gajtf"></button></mark>
    <listing id="gajtf"><dfn id="gajtf"><s id="gajtf"></s></dfn></listing><label id="gajtf"><ruby id="gajtf"></ruby></label>
    <mark id="gajtf"></mark>

    centos7安裝運行Elasticsearch7.1

    centos7安裝運行Elasticsearch7.1,centos7 安裝es7,centos安裝elk
    [root@guangzhou src]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.1.1-linux-x86_64.tar.gz
    
    [root@guangzhou src]# mv elasticsearch-7.1.1 elasticsearch && mv elasticsearch /usr/local/elasticsearch
    
    [root@guangzhou src]# cd /usr/local/elasticsearch
    
    
    
    #編輯配置信息
    
    [root@guangzhou elasticsearch]# vim config/elasticsearch.yml
    
    #單機模式,取消注釋
    
    node.name: node-1
    
    #數據存儲路徑
    
    path.data: /usr/local/elasticsearch/data
    
    #日志存放路徑
    
    path.logs: /usr/local/elasticsearch/logs
    
    #指定主節點
    
    cluster.initial_master_nodes: ["127.0.0.1:9300"]
    
    #發現模塊
    
    discovery.seed_hosts: ["127.0.0.1", "[::1]"]
    
    #取消IP限制
    
    network.host: 0.0.0.0
    
    #訪問端口
    
    http.port: 9200
    
    
    
    #更改jvm相關配置
    
    [elk@guangzhou elasticsearch]$ vim config/jvm.options
    
    -Xms512m
    
    Xmx512m


    啟動es:

    [root@guangzhou bin]# ./elasticsearch
    [2020-02-07T16:08:40,816][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] 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-7.1.1.jar:7.1.1]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.1.1.jar:7.1.1]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.1.1.jar:7.1.1]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-7.1.1.jar:7.1.1]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.1.1.jar:7.1.1]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.1.1.jar:7.1.1]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.1.1.jar:7.1.1]
    Caused by: java.lang.RuntimeException: can not run elasticsearch as root
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:102) ~[elasticsearch-7.1.1.jar:7.1.1]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:169) ~[elasticsearch-7.1.1.jar:7.1.1]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:325) ~[elasticsearch-7.1.1.jar:7.1.1]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.1.1.jar:7.1.1]
        ... 6 more
    
    #錯誤顯示的不能以root運行elasticsearh,考慮到后面會搭建elk,新建用戶名elk來運行elasticsearch
    [root@guangzhou bin]# groupadd elk
    [root@guangzhou bin]# useradd -g elk elk
    [root@guangzhou bin]# chown -R elk:elk /usr/local/elasticsearch/
    
    #再次運行
    [root@guangzhou bin]# su elk
    [elk@guangzhou bin]$ ./elasticsearch
    ...
    
    #新開窗口輸入以下命令看結果知道啟動成功
    [root@guangzhou bin]# curl http://127.0.0.1:9200
    {
      "name" : "node-1",
      "cluster_name" : "elasticsearch",
      "cluster_uuid" : "_na_",
      "version" : {
        "number" : "7.1.1",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "7a013de",
        "build_date" : "2019-05-23T14:04:00.380842Z",
        "build_snapshot" : false,
        "lucene_version" : "8.0.0",
        "minimum_wire_compatibility_version" : "6.8.0",
        "minimum_index_compatibility_version" : "6.0.0-beta1"
      },
      "tagline" : "You Know, for Search"
    }
    • 發表于 2020-06-12 11:38
    • 閱讀 ( 478 )
    • 分類:linux

    0 條評論

    請先 登錄 后評論
    不寫代碼的碼農
    威猛的小站長

    119 篇文章

    作家榜 ?

    1. 威猛的小站長 119 文章
    2. Jonny 65 文章
    3. 江南煙雨 33 文章
    4. - Nightmare 33 文章
    5. doublechina 31 文章
    6. HJ社區-肖峰 29 文章
    7. 偽攝影 20 文章
    8. Alan 14 文章
    小喜通天报