[Bug 288653] textproc/elasticsearch8: Update to recent version

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 17 Sep 2025 19:17:54 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288653

--- Comment #4 from Saro <web@saromedia.com> ---
An update: I have moved my repository to a GitHub organization as I plan to
upload a few more port projects, such as Elastic's machine learning (ml-cpp)
library.

New location: https://github.com/portsbuild/elasticsearch

Currently, the 8.19.3 distribution is tagged and a binary artifact is readily
available (built via GitHub Actions). It's understandable if one does not wish
to download an unknown binary, so I will provide the building steps and a port
Makefile in a follow-up comment (or see:
https://github.com/sarog/freebsd-ports/tree/main/textproc/elasticsearch8).

While I have successfully upgraded my ES nodes from 8.15.5 to 8.19.3, I
strongly recommend testing this release before rolling out into production!

Please note: if you are using Kibana, you may also need to update it to 8.19.x.
The port is available here if you want to try it:
https://github.com/sarog/freebsd-ports/tree/main/textproc/kibana8

Building Elasticsearch
----------------------

First, please review the code changes:

https://github.com/elastic/elasticsearch/compare/v8.19.3...portsbuild:elasticsearch:v8.19.3

Once reviewed, you can build the FreeBSD package on any OS of your choice. When
building on FreeBSD, I had to install java/openjdk versions 17 to 23
(inclusive). Running ES 8.19.3 requires openjdk 21+.

**NOTE**: the following will build Elasticsearch with a TEST public key (the
"license.key" property in the build command below). This means if you have a
valid ES (e.g. Enterprise) license key, it will not work with this build. The
solution is to build the package with Elastic's production public key, which is
easily extracted from a 8.19.3 release (re: x-pack-core-8.19.3.jar). I will
apply this change once I can confirm the build works.

## Install the necessary JDKs
$ pkg install java/openjdk17 java/openjdk19 java/openjdk20 java/openjdk21
java/openjdk22 java/openjdk23

$ git clone --depth 1 --branch v8.19.3
https://github.com/portsbuild/elasticsearch elasticsearch-8.19.3
$ cd elasticsearch-8.19.3
$ ./gradlew distribution:archives:freebsd-tar:assemble -D"build.snapshot=false"
-D"license.key=x-pack/license-tools/src/test/resources/public.key"
-Porg.gradle.java.installations.paths=/usr/local/openjdk21,/usr/local/openjdk17,/usr/local/openjdk19,/usr/local/openjdk20,/usr/local/openjdk22,/usr/local/openjdk23
$ mv
distribution/archives/freebsd-tar/build/distributions/elasticsearch-8.19.3-freebsd-x86_64.tar.gz
/usr/ports/distfiles/

## Apply the port patch (supplied in a follow-up comment).
## You may want to create a /usr/local/ports and extract the port patch there
to avoid conflicts.
$ cd /usr/ports/textproc/elasticsearch8
$ make makesum
$ make reinstall clean

If you are upgrading from a previous version, do not forget to update
jvm.options with the properties mentioned in the previous post. On new
installs, the port includes the necessary patches to update jvm.options for
you.

Update rc.conf with the following so ES uses JDK 21:
elasticsearch_java_home="/usr/local/openjdk21"

Upgrade docs from Elastic:
https://www.elastic.co/docs/deploy-manage/upgrade/deployment-or-cluster/self-managed

Next up: updating sysutils/beats8 and sysutils/logstash8

-- 
You are receiving this mail because:
You are the assignee for the bug.