ElasticSearch之安装

参照Installing Elasticsearch,完成验证集群的部署。

操作步骤

  • 下载软件包和摘要文件。

    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.11.1-linux-x86_64.tar.gz
    wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.11.1-linux-x86_64.tar.gz.sha512
    
  • 校验压缩包的完整性。

    shasum -a 512 -c elasticsearch-8.11.1-linux-x86_64.tar.gz.sha512
    
  • 解压软件包。

    tar -xzf elasticsearch-8.11.1-linux-x86_64.tar.gz
    
  • 启动elasticsearch服务。

    cd elasticsearch-8.11.1/
    export ELASTIC_PASSWORD="espass"
    ./bin/elasticsearch
    
  • 修改口令。注意需要新开一个shell命令行窗口。

    ./bin/elasticsearch-reset-password -u elastic
    

    命令的输出如下:

    This tool will reset the password of the [elastic] user to an autogenerated value.
    The password will be printed in the console.
    Please confirm that you would like to continue [y/N]y
    
    
    Password for the [elastic] user successfully reset.
    New value: ohCxPH=QBE+s5=*lo7F9
    

    得到新的口令为ohCxPH=QBE+s5=*lo7F9

  • 检查服务是否可用。

    export ES_HOME=~/elasticsearch-8.11.1
    curl --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9" https://localhost:9200
    

    输出如下:

    {
    "name" : "jackie-ubuntu",
    "cluster_name" : "elasticsearch",
    "cluster_uuid" : "BH48zgLGR9S0mjjShrpyFA",
    "version" : {
        "number" : "8.11.1",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "6f9ff581fbcde658e6f69d6ce03050f060d1fd0c",
        "build_date" : "2023-11-11T10:05:59.421038163Z",
        "build_snapshot" : false,
        "lucene_version" : "9.8.0",
        "minimum_wire_compatibility_version" : "7.17.0",
        "minimum_index_compatibility_version" : "7.0.0"
    },
    "tagline" : "You Know, for Search"
    }
    

相关资料

  • Elasticsearch8重置elastic用户密码

你可能感兴趣的:(elasticsearch,linux)