How could I install Elasticsearch 1.2.1 with homebrew - elasticsearch

I need old Elasticsearch for my work. but I couldn't install Elasticsearch 1.2.1 with brew
Development environment
$ brew --version
Homebrew 0.9.5 (git revision 567b; last commit 2015-12-23)
The procedure I tried
I tried the following process
$ brew search elasticsearch
elasticsearch ✔ homebrew/versions/elasticsearch20
homebrew/versions/elasticsearch17 ✔
There is no elasticsearch10.
So, I tracked down this guidance.
Homebrew install specific version of formula?
And typed this command.
$ brew info elasticsearch
elasticsearch: stable 2.1.1, HEAD
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
/usr/local/Cellar/elasticsearch/2.1.1 (52 files, 31M)
Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/elasticsearch.rb
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_kent/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_kent.log
Plugins: /usr/local/Cellar/elasticsearch/2.1.1/libexec/plugins/
Config: /usr/local/etc/elasticsearch/
To have launchd start elasticsearch at login:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Then to load elasticsearch now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Or, if you don't want/need launchctl, you can just run:
elasticsearch
And also typed this command, however couldn't find out a key to installing elasticsearch version 1.2.1
$ brew versions elasticsearch
Error: The `versions` command is no longer supported.
You can use the homebrew-versions tap instead:
https://github.com/Homebrew/homebrew-versions
Or use `brew log` to browse the git history.
I need some help to bridge myself to installing elasticsearch 1.2.1 with brew.
Could you steer my steps?

If you're just trying to do this for local development, then it's probably easier to just download and untar Elasticsearch into a directory.
$ cd /path/to/install/at
$ wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.2.1.tar.gz
$ tar -xf elasticsearch-1.2.1.tar.gz
$ cd elasticsearch-1.2.1
Once untarred, you can optionally delete the tarball:
$ rm elasticsearch-1.2.1.tar.gz
From there, it's just a matter of configuring (as desired) and starting Elasticsearch.
$ vi config/elasticsearch.yml
$ bin/elasticsearch
Note: Elasticsearch 1.2.1 is an extremely old version. I strongly recommend that you upgrade to a more recent release to gain reliability and security. For example, ES 1.2.1 uses MVEL scripting, which is bad at best.
For your production scenario (after New Years, of course), you can easily perform a rolling restart from ES 1.2.1 to ES 1.7.4 to gain a lot of features and stability without much risk. If you have dedicated master nodes, then I recommend starting with them first to get a few extra benefits upfront.

Related

Elasticsearch failed to start on macos

I've installed Elasticsearch using brew on macos Monterey
brew install elasticsearch
But I can't start the service
brew services start elasticsearch
brew info elasticsearch
This are the log
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release
Exception in thread "main" java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
at java.base/java.lang.System.setSecurityManager(System.java:416)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82)
If you run:
brew info elasticsearch
You will see:
Deprecated because it is switching to an incompatible license. Check out opensearch instead!
So you should either use opensearch, which is:
a community-driven, open source search and analytics suite derived from Apache 2.0 licensed Elasticsearch 7.10.2 & Kibana 7.10.2.
or if you want to stay with Elasticsearch use the official installation method for macOS which consists of using a tar.gz:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz.sha512
shasum -a 512 -c elasticsearch-8.1.2-linux-x86_64.tar.gz.sha512
tar -xzf elasticsearch-8.1.2-linux-x86_64.tar.gz
cd elasticsearch-8.1.2/
alternatively you can use an official Docker image.
Just adding something which might be useful for someone.
If you're running elastic on a Mac M1 architecture, depending on how you run elastic, you might need to setup this property:
xpack.ml.enabled=- false
For Mac Users
System Settings > Privacy & Security > Developer Tools
Check/Add the terminal and start the elastic search from the terminal.

Elasticsearch failed to install multiple plugins in one command

As stated in documentation, plugins can be installed through the following command:
$ sudo bin/elasticsearch-plugin install analysis-icu
However, when installing with more than one plugins, the system prompted the followings
$ sudo bin/elasticsearch-plugin install analysis-icu repository-s3
ERROR: Found multiple arguments for option [arguments], but you asked for only one
https://github.com/elastic/elasticsearch/blob/master/docs/plugins/plugin-script.asciidoc
As of the latest version ES 7.5.2, you can only install one plugin at a time.
The ability to install multiple plugins at once has been added very recently and will only be available from ES 7.6 onwards, which has not yet been released. 7.6 should be coming out anytime now since there are only 2 issues and 4 PRs left open. Stay tuned...

Use specific version of Elasticsearch

I've installed Elastichsearch 1.7 via Homebrew, which is now "keg-only". I don't fully understand this, but it means that I can't run it simply using elasticsearch like I used to, but I still need to. My Node.js app only works with this version. Is there anything I can do to symlink it or whatever is necessary for other tools to detect it? Any help would be really appreciated.
Homebrew info:
elasticsearch#1.7: stable 1.7.6 [keg-only]
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
/usr/local/Cellar/elasticsearch#1.7/1.7.6_1 (38 files, 29.7M)
Built from source on 2017-02-09 at 17:45:23
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/elasticsearch#1.7.rb
==> Requirements
Required: java >= 1.7 ✔
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_ourcore/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_ourcore.log
Plugins: /usr/local/var/lib/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/
This formula is keg-only, which means it was not symlinked into /usr/local.
This is an alternate version of another formula.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/elasticsearch#1.7/bin:$PATH"' >> ~/.zshrc
To have launchd start elasticsearch#1.7 now and restart at login:
brew services start elasticsearch#1.7
Or, if you don't want/need a background service you can just run:
elasticsearch --config=/usr/local/opt/elasticsearch#1.7/config/elasticsearch.yml

Install elasticsearch 1.1 using brew

When I'm installing elasticsearch using brew it auto defaults to version 0.90.5. Is there a way that I can tell brew to install version 1.1?
brew update to update your brew
brew doctor optional if you want to check if all good with your system
and then:
brew upgrade elasticsearch to upgrade
or brew install elasticsearch
Finally brew info elasticsearch to check your system. My case:
$ brew info elasticsearch
elasticsearch: stable 1.1.0, HEAD
http://www.elasticsearch.org
/usr/local/Cellar/elasticsearch/1.0.0 (471 files, 78M)
Built from source
/usr/local/Cellar/elasticsearch/1.0.1 (363 files, 79M)
Built from source
/usr/local/Cellar/elasticsearch/1.1.0 (31 files, 21M) *
Built from source
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/elasticsearch.rb
==> Caveats
Data: /usr/local/var/elasticsearch/elasticsearch_dionysis_lorentzos/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_dionysis_lorentzos.log
Plugins: /usr/local/var/lib/elasticsearch/plugins/
To have launchd start elasticsearch at login:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Then to load elasticsearch now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Or, if you don't want/need launchctl, you can just run:
elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
There is a possibility that you run via LaunchAgents the 90.5 That means that on user login ES starts running on the background. So the above should say something like:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
I have deleted that file btw.
Then run and check the version & the IP:
$ elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
[2014-04-13 17:13:18,006][INFO ][node] [Archie Corrigan] version[1.1.0], pid[8108], build[2181e11/2014-03-25T15:59:51Z]
<<other lines here>>
[2014-04-13 17:13:27,269][INFO ][http ] [Archie Corrigan] bound_address {inet[/127.0.0.1:9200]}, publish_address {inet[/127.0.0.1:9200]}
If you run the above and see that the port is 9201 that means that you run two instances of ES in your mac. The second instance tried to start but the 9200 was already fulfilled so ES tried the next available 9201. You probably need to unload the first instance.
When upgrading you need to copy your configuration.
I think that's all you need about ES & brew.
$ brew search elasticsearch
…then you'll see something like…
elasticsearch
homebrew/versions/elasticsearch17 homebrew/versions/elasticsearch2
…then…
$ brew install elasticsearch17
brew update
brew doctor
And than
brew install elasticsearch
Or brew upgrade elasticsearch

Installing Elasticsearch on OSX Mavericks

I'm trying to install Elasticsearch 1.1.0 on OSX Mavericks but i got the following errors when i'm trying to start:
:> ./elasticsearch
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.Version
at org.elasticsearch.bootstrap.Bootstrap.buildErrorMessage(Bootstrap.java:252)
at org.elasticsearch.bootstrap.Bootstrap.main(Bootstrap.java:236)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:32)
Also when i'm executing the same command with -v arg, i got this error:
:> ./elasticsearch -v
Exception in thread "main" java.lang.NoSuchFieldError: LUCENE_36
at org.elasticsearch.Version.<clinit>(Version.java:42)
Here's my environment:
Java version
>: java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
Instalation path (downloaded .tar.gz archive from elasticsearch download page and extracted here):
/usr/local/elasticsearch-1.1.0
ENV vars:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
CLASSPATH=/usr/local/elasticsearch-1.1.0/lib/*.jar:/usr/local/elasticsearch-1.1.0/lib/sigar/*.jar
UPDATE
i finally make it working, unfortunally not sure how because i tried a lot of changes :). But here's a list of changes i made that can help:
i removed jdk and jre and reinstalled on a clean env.
http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html#A1096855
i deleted all the cache dirs.I suppose this can be the 'cause' for that it's working now
~/Library/Caches
/Library/Caches
i removed CLASSPATH env var.
ES_PATH and ES_HOME env vars are not set either, but i think this is not so important.
Note: now it's working also if i'm installing with brew.
Thanks.
You should really consider using brew. It's a great tool that will take care of dependencies, version control and much more.
To install Elasticsearch using brew, simply:
brew update
brew install elasticsearch
Boom! Done.
After that follow Elasticsearch instructions :
To have launchd start Elasticsearch at login:
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
Then to load Elasticsearch now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Or, if you don't want/need launchctl, you can just run:
elasticsearch
As there are not very good instructions for actually "installing" it onto a Mac:
Short Version:
Install Java (prefer latest supported release)
Set JAVA_HOME environment variable.
Download Elasticsearch version (tar or zip).
Extract Elasticsearch from the downloaded file.
Run bin/elasticsearch from the extracted directory.
Long version:
Download Java
Only need the JRE if you will not be writing code on the same machine.
I assume that you are getting the latest JDK, which is currently JDK 8 (as you appear to have, and I have installed working on my machine).
Download and extract Elasticsearch and extract it into some directory.
For example: mkdir -p ~/dev/elasticsearch
Optionally move the downloaded file to there:
mv Downloads/elasticsearch* ~/dev/elasticsearch
Extract the downloaded file:
cd ~/dev/elasticsearch (if you moved it in step 2)
If it's the zip, then unzip elasticsearch-1.1.0.zip (or if you don't want to cd into the directory, then just run unzip elasticsearch-1.1.0.zip -d ~/dev/elasticsearch)
If it's the tar, then tar -xvf elasticsearch-1.1.0.tar.gz (or if you don't want to cd into the directory, then just run tar -xvf elasticsearch-1.1.0.tar.gz -C ~/dev/elasticsearch)
Cleanup (if you want) by removing the downloaded file:
rm elasticsearch-1.1.0.*
Open your .bash_profile file for your bash profile settings:
vi ~/.bash_profile
In the file, export your environment variable(s)
export ES_HOME=~/dev/elasticsearch/elasticsearch-1.1.0
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home
export PATH=$ES_HOME/bin:$JAVA_HOME/bin:$PATH
Close and re-open your Terminal OR
Run source ~/.bash_profile to update the environment variables
Run Elasticsearch:
elasticsearch
The more traditional way to run it is to do pretty much all of the above, but not add $ES_HOME/bin to the PATH. Then, just go to ES_PATH (cd $ES_PATH, then bin/elasticsearch) or run $ES_PATH/bin/elasticsearch.
Note: Do not setup your CLASSPATH without a very good reason. The scripts will do that for you.
You should try to using brew with last update:
brew update
And install Cask java:
brew cask install java
After that you can install elasticsearch:
brew install elasticsearch
And to have launched start elasticsearch now use:
brew services start elasticsearch
Or you can just run:
elasticsearch
To update ElasticSearch, just run brew upgrade elasticsearch
Update your java
brew update
brew cask install java
Install it with homebrew
brew install elasticsearch
install gpg &&
install java or jdk
1-Import the repository’s GPG key:
wget -qO - https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
2-this is code repository elasticserach in linux for download
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
3-link download elasticsearch
https://www.elastic.co/downloads/elasticsearch
if error
"Job for elasticsearch.service failed because a timeout was exceeded.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details."
solution:
1-sudo journalctl -f
2-sudo systemctl enable elasticsearch.service
3-sudo systemctl start elasticsearch

Resources