gpt4 book ai didi

elasticsearch - 从/usr/local/var卸载elasticsearch并在MacOSX上安装另一个版本

转载 作者:行者123 更新时间:2023-12-02 23:12:28 24 4
gpt4 key购买 nike

我试图在Mac机器上将elasticsearch从6.8.4降级到5.6。但是以某种方式我弄乱了6.8.4的现有安装,现在既无法修复当前安装的版本,也无法安装5.6

细节:

我已经在系统上正确安装了6.8.4,并且能够成功访问http://localhost:9200/端口并查看版本信息和所有其他详细信息。但是由于依赖性,我不得不将版本降级到5.6

我遵循了本指南https://gist.github.com/govindpatel/0660b33a343b807664972b53c3b12ca0,并通过删除plist条目和其他详细信息来弄乱6.8.4的安装。现在,当我尝试通过键入$ elasticsearch来启动Elasticsearch服务时,我得到:-bash: elasticsearch: command not found$ brew service restart elasticsearch给了我Error: Unknown command: service
但是,当我执行以下命令时,仍然可以看到6.8.4:

$ brew info elasticsearch
elasticsearch: stable 6.8.4, HEAD
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch.rb
==> Requirements
Required: java = 1.8 ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
Data: /usr/local/var/lib/elasticsearch/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_Puneet.log
Plugins: /usr/local/var/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/


To have launchd start elasticsearch now and restart at login:
brew services start elasticsearch
Or, if you don't want/need a background service you can just run:
elasticsearch
==> Analytics
install: 8,690 (30 days), 23,748 (90 days), 122,267 (365 days)
install_on_request: 8,233 (30 days), 22,565 (90 days), 114,157 (365 days)
build_error: 0 (30 days)

我什至尝试安装5.6(通过Homebrew)- brew install elasticsearch@5.6,并将 PATH设置为 ~/.bash_profile的第一位,但是没有运气! :(

请提供帮助和建议:
  • 如何修复现有的6.8.4版本和
  • 我如何系统地降级(由于现有的conf,数据位于/ usr / local文件夹下)

  • 当前详细信息:查看elasticsearch是否正在运行: $ launchctl list | grep elasticsearch,我正在获取: - 1 homebrew.mxcl.elasticsearch@5.6,但我当前未安装此文件(已附加o / p)- $ brew uninstall elasticsearch@5.6〜> Error: No such keg: /usr/local/Cellar/elasticsearch@5.6
    [UPDATE-1]

    发布此内容后,我尝试再次运行ES安装命令: brew install elasticsearch
    Updating Homebrew...
    ==> Auto-updated Homebrew!
    Updated 2 taps (homebrew/core and homebrew/cask).
    No changes to formulae.

    ==> Downloading
    https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.8.4.tar.gz
    Already downloaded: /Library/Caches/Homebrew/downloads/elasticsearch-oss-6.8.4.tar.gz
    ==> Caveats
    Data: /usr/local/var/lib/elasticsearch/
    Logs: /usr/local/var/log/elasticsearch/elasticsearch_Puneet.log
    Plugins: /usr/local/var/elasticsearch/plugins/
    Config: /usr/local/etc/elasticsearch/

    To have launchd start elasticsearch now and restart at login:
    brew services start elasticsearch
    Or, if you don't want/need a background service you can just run:
    elasticsearch
    ==> Summary
    🍺 /usr/local/Cellar/elasticsearch/6.8.4: 133 files, 103.2MB, built in 6 seconds

    然后启动服务 $ brew services start elasticsearch〜> ==> Successfully started elasticsearch (label: homebrew.mxcl.elasticsearch)。现在,当我尝试访问端口: http://localhost:9200时,它正在工作(虽然从0开始安装,但已修复了该问题!)
    {
    "name" : "DwQRyf7",
    "cluster_name" : "elasticsearch_Puneet",
    "cluster_uuid" : "hLAu9onQSiuQHOpm_e9IKw",
    "version" : {
    "number" : "6.8.4",
    "build_flavor" : "oss",
    "build_type" : "tar",
    "build_hash" : "bca0c8d",
    "build_date" : "2019-10-16T06:19:49.319352Z",
    "build_snapshot" : false,
    "lucene_version" : "7.7.2",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
    },
    "tagline" : "You Know, for Search"
    }

    现在唯一剩下的问题是,我如何系统地对其进行降级?

    [UPDATE-2]

    现在我有了6.8.4,我已经使用 brew search elasticsearch检查了其他版本,并得到5.6。然后我用 brew install elasticsearch@5.6安装了5.6
    Updating Homebrew...
    ==> Auto-updated Homebrew!
    Updated 1 tap (homebrew/cask).
    No changes to formulae.
    ==> Downloading https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.16.tar.gz
    Already downloaded: /Library/Caches/Homebrew/downloads/3d7cc028f605699065bd403b0a2383db8d7413c570df57e26fc87a735126c96c--elasticsearch-5.6.16.tar.gz
    ==> Caveats
    Data: /usr/local/var/elasticsearch/elasticsearch_Puneet/
    Logs: /usr/local/var/log/elasticsearch/elasticsearch_Puneet.log
    Plugins: /usr/local/opt/elasticsearch@5.6/libexec/plugins/
    Config: /usr/local/etc/elasticsearch/
    plugin script: /usr/local/opt/elasticsearch@5.6/libexec/bin/elasticsearch-plugin

    elasticsearch@5.6 is keg-only, which means it was not symlinked into /usr/local,
    because this is an alternate version of another formula.

    If you need to have elasticsearch@5.6 first in your PATH run:
    echo 'export PATH="/usr/local/opt/elasticsearch@5.6/bin:$PATH"' >> ~/.bash_profile


    To have launchd start elasticsearch@5.6 now and restart at login:
    brew services start elasticsearch@5.6
    Or, if you don't want/need a background service you can just run:
    /usr/local/opt/elasticsearch@5.6/bin/elasticsearch
    ==> Summary
    🍺 /usr/local/Cellar/elasticsearch@5.6/5.6.16: 106 files, 36.0MB, built in 6 seconds

    然后我将5.6添加到 $PATH。现在,当我尝试使用 brew switch elasticsearch 5.6切换elasticsearch版本时,我得到了:
    Error: elasticsearch does not have a version "5.6" in the Cellar.
    elasticsearch installed versions: 6.8.4

    知道我在这里缺少什么吗?

    最佳答案

    经过一段时间的故障排除后,我似乎找到了解决方案。

    为了在开发机器上维护elasticsearch的多个版本,您需要执行以下操作:

    假设我已经安装了6.8.4,并且我还想要另一个版本。为了同时维护这两个版本,请首先输入以下命令检查系统(mac)的所有版本:brew search elasticsearch,并且我的系统支持ES的3个版本:

  • elasticsearch-最新且稳定(已安装)的
  • elasticsearch@2.4
  • elasticsearch@5.6

  • 为了拥有2.4,这是您必须做的:
    $ brew install elasticsearch@2.4
    # After installation type:
    $ brew services stop elasticsearch
    # above command will stop elasticsearch (lastest stable) service
    # add 2.4 to $PATH
    $ echo 'export PATH="/usr/local/opt/elasticsearch@2.4/bin:$PATH"' >> ~/.bash_profile
    # start the service of 2.4
    $ brew services start elasticsearch@2.4
    # check for the service/installation
    $ launchctl list | grep elasticsearch
    # above command should show you a port

    现在您可以在浏览器中点击 http://localhost:9200,它应该显示2.4

    切换回最新的稳定版本:
    $ brew services stop elasticsearch
    # remove entry from $PATH variable
    $ brew services start elasticsearch

    在我看来 brew switch elasticsearch [VERSION]不起作用

    关于elasticsearch - 从/usr/local/var卸载elasticsearch并在MacOSX上安装另一个版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58813042/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com