Installing Elasticsearch 6.8.15 on Apple-M1 Macbook issues - apple-m1

I am trying to download elasticsearch 6.8.15 for my current project. I am on a 2020 Macbook air with the M1 chip and have tried download using brew and a docker image but whenever I try to get elasticsearch to run I get a few issues.
First it appears some of the java settings are adjusted due to the M1 chip and this warning is shown:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
OpenJDK 64-Bit Server VM warning: UseAVX=2 is not supported on this CPU, setting it to UseAVX=0
Then I get this output which appears to be a mix of java and elasticsearch errors:
[WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Cannot run program "/usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller": error=0, Failed to exec spawn helper: pid: 129, exit value: 1 at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.18.jar:6.8.18] at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.18.jar:6.8.18] Caused by: org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Cannot run program "/usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller": error=0, Failed to exec spawn helper: pid: 129, exit value: 1 at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.18.jar:6.8.18] ... 6 more Caused by: java.io.IOException: Cannot run program "/usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller": error=0, Failed to exec spawn helper: pid: 129, exit value: 1 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1142) ~[?:?] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1073) ~[?:?] at org.elasticsearch.bootstrap.Spawner.spawnNativeController(Spawner.java:118) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Spawner.spawnNativeControllers(Spawner.java:86) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:165) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.18.jar:6.8.18] ... 6 more Caused by: java.io.IOException: error=0, Failed to exec spawn helper: pid: 129, exit value: 1 at java.lang.ProcessImpl.forkAndExec(Native Method) ~[?:?] at java.lang.ProcessImpl.<init>(ProcessImpl.java:313) ~[?:?] at java.lang.ProcessImpl.start(ProcessImpl.java:244) ~[?:?] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1109) ~[?:?] at java.lang.ProcessBuilder.start(ProcessBuilder.java:1073) ~[?:?] at org.elasticsearch.bootstrap.Spawner.spawnNativeController(Spawner.java:118) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Spawner.spawnNativeControllers(Spawner.java:86) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:165) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.18.jar:6.8.18] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.18.jar:6.8.18] ... 6 more
I have spoken with a few people on my team that have a macbook with the M1 chip and were able to install and run elasticsearch using brew. The commands they ran were:
$ brew cask install homebrew/cask-versions/adoptopenjdk8
$ brew install elasticsearch#6
$ brew services start elasticsearch#6
These commands worked fine on their machines but when I run this command I get this message:
Error: elasticsearch#6: no bottle available!
You can try to install from source with:
brew install --build-from-source elasticsearch#6
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

Found a solution with elasticsearch 7.
brew tap elastic/tap
brew install elastic/tap/elasticsearch-full
Source: https://github.com/Homebrew/discussions/discussions/925#discussioncomment-943622

elasticsearch#6 is a homebrew-core package. It depends_on "openjdk", the jdk dependency is limited to openjdk distributed by homebrew-core as well. Installing JDK outside homebrew has not effect at all.
The problem is openjdk from homebrew-core had not been built for arm64 yet. But it seems when I answer the question, the openjdk has been supported.
brew install elasticsearch#6 should work now.
Extended Reading
For anyone looking for elasticsearch 7.x. Things haven't been changed in 2021.
Homebrew stops distributing newer version of elasticsearch, and kibana, although you can still get outdated versions in homebrew-core.
It's because Homebrew defers to the OSI's open source licence definition, and the new license used by elastic softwares is not compatible with it. So, elastic begins to distribute these software with its own custom tap.
# tap maintained by elastic organization
# https://github.com/elastic/homebrew-tap
brew tap elastic/tap
brew install elastic/tap/elasticsearch-full
# brew install elastic/tap/kibina-full
# brew install elastic/tap/logstash-full

Related

Cmake on macOS error: Could not find MySQL headers

When running the cmake command in order to compile AzerothCore on macOS Mojave, I'm using the parameteres:
-DMYSQL_ADD_INCLUDE_PATH=/usr/local/include
-DMYSQL_LIBRARY=/usr/local/lib/libmysqlclient_r.dylib
however the cmake fails with the following error:
CMake Error at src/cmake/macros/FindMySQL.cmake:179 (message): Could
not find MySQL headers! Please install the development libraries and
headers Call Stack (most recent call first): CMakeLists.txt:93
(find_package)
I solved by installing and linking mysql56 with brew:
brew install mysql56
brew link mysql56 --force

Installation failed trying to install MySQL ODBC connector on macOS High Sierra

I'm trying to install this mysql odbc connector on my macOS High Sierra machine, but I get this error:
I tried installing it using installer in the hopes of getting information about what went wrong:
➜ ~ sudo installer -pkg Desktop/mysql-connector-odbc-5.3.9-macos10.12-x86-64bit.pkg -target / -verbose
installer: Package name is MySQL Connector/Odbc 5.3.9
installer: Installing at base path /
installer: Preparing for installation….....
installer: Preparing the disk….....
installer: Preparing MySQL Connector/Odbc 5.3.9….....
installer: Waiting for other installations to complete….....
installer: Configuring the installation….....
installer:
#
installer: Validating packages….....
#
installer: The install failed (The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.)
But that doesn't help. Do you have any tips on how I can debug this and get the connector installed? Thanks.
I just noticed this:
on this page: https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-installation-binary-osx.html
After installing iODBC (http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads) it was able to install the connector.
I know I'm reviving an old thread, but having just had this exact problem/issue, and not solving with the iodbc installation, I thought I'd post the solution that worked for me. Use the commmand line... open terminal and run...
pip install mysql-connector-python
or
pip install mysql-connector
For those on an Apple Silicone Mac, this might be caused by having the wrong version of iODBC installed. Make sure to install the one labeled arm64 from iODBS website

Play a video using JavaFX on Raspberry Pi

I need to run a JavaFX project on Raspberry Pi (RASPBIAN JESSIE). The project includes usage of WebView and MediaView/MediaPlayer. Since Oracle does not support JavaFX on ARM platforms, I tried JavaFX port by Gluon (JavaFX Embedded SDK 8.60.8). WebView works almost perfectly. However, when I want to play a video using MediaPlayer/MediaView, I get the exception:
Error in GstPipelineFactory: can't find element for factory named qtdemux
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
at zirro.App.start(App.java:21)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
... 1 more
Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:224)
at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:104)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
... 10 more
Any ideas how to successfully run a JavaFX application with WebView and MediaView/MediaPlayer on Raspberry Pi?
WebView and Media were never part of the JavaFX ARM distribution, but Gluon recently added it to the embedded SDK that can be downloaded from here and installed with a recent JDK for ARM, available here.
Media requires a few extra steps as it depends in the native drivers that usually are not fully installed on a regular Jessie distribution.
First install these drivers:
sudo apt-get install gstreamer0.10-plugins-good
sudo apt-get install gstreamer0.10-plugins-bad
Now edit /etc/apt/sources.list and add at the end:
deb http://ftp.uk.debian.org/debian/ wheezy main
deb-src http://ftp.uk.debian.org/debian/ wheezy main
Save the file (Ctrl+O, Ctrl+X).
Finally update and install the drivers:
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-alsa
Now you can try to run again your JavaFX application.
If you find again the same exception (MediaException: UNKNOWN), check if it shows this message: Error in GstPipelineFactory, notice the driver that is missing, and try to install it.
I wanted to updated the correct anwser from José Pereda.
The repository for the gstreamer is not up to date. Thats the way I get it to work.
Update the /etc/apt/sources.list
deb [trusted=yes] http://archive.debian.org/debian wheezy main
deb-src [trusted=yes] http://archive.debian.org/debian/ wheezy main
And then install the dependencies.
sudo apt-get install libtag1-vanilla
sudo apt-get install libtag1-rusxmms
sudo apt-get install libtag1c2a
sudo apt-get install gstreamer0.10-plugins-good
sudo apt-get install gstreamer0.10-plugins-bad
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-alsa

Is there a way to play media (.mp4) on a Raspberry Pi 3 in a JavaFX application [duplicate]

I need to run a JavaFX project on Raspberry Pi (RASPBIAN JESSIE). The project includes usage of WebView and MediaView/MediaPlayer. Since Oracle does not support JavaFX on ARM platforms, I tried JavaFX port by Gluon (JavaFX Embedded SDK 8.60.8). WebView works almost perfectly. However, when I want to play a video using MediaPlayer/MediaView, I get the exception:
Error in GstPipelineFactory: can't find element for factory named qtdemux
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: MediaException: UNKNOWN : com.sun.media.jfxmedia.MediaException: Could not create player! : com.sun.media.jfxmedia.MediaException: Could not create player!
at javafx.scene.media.MediaException.exceptionToMediaException(MediaException.java:146)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:511)
at javafx.scene.media.MediaPlayer.<init>(MediaPlayer.java:414)
at zirro.App.start(App.java:21)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
at com.sun.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:92)
at com.sun.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:51)
... 1 more
Caused by: com.sun.media.jfxmedia.MediaException: Could not create player!
at com.sun.media.jfxmediaimpl.NativeMediaManager.getPlayer(NativeMediaManager.java:224)
at com.sun.media.jfxmedia.MediaManager.getPlayer(MediaManager.java:104)
at javafx.scene.media.MediaPlayer.init(MediaPlayer.java:467)
... 10 more
Any ideas how to successfully run a JavaFX application with WebView and MediaView/MediaPlayer on Raspberry Pi?
WebView and Media were never part of the JavaFX ARM distribution, but Gluon recently added it to the embedded SDK that can be downloaded from here and installed with a recent JDK for ARM, available here.
Media requires a few extra steps as it depends in the native drivers that usually are not fully installed on a regular Jessie distribution.
First install these drivers:
sudo apt-get install gstreamer0.10-plugins-good
sudo apt-get install gstreamer0.10-plugins-bad
Now edit /etc/apt/sources.list and add at the end:
deb http://ftp.uk.debian.org/debian/ wheezy main
deb-src http://ftp.uk.debian.org/debian/ wheezy main
Save the file (Ctrl+O, Ctrl+X).
Finally update and install the drivers:
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-alsa
Now you can try to run again your JavaFX application.
If you find again the same exception (MediaException: UNKNOWN), check if it shows this message: Error in GstPipelineFactory, notice the driver that is missing, and try to install it.
I wanted to updated the correct anwser from José Pereda.
The repository for the gstreamer is not up to date. Thats the way I get it to work.
Update the /etc/apt/sources.list
deb [trusted=yes] http://archive.debian.org/debian wheezy main
deb-src [trusted=yes] http://archive.debian.org/debian/ wheezy main
And then install the dependencies.
sudo apt-get install libtag1-vanilla
sudo apt-get install libtag1-rusxmms
sudo apt-get install libtag1c2a
sudo apt-get install gstreamer0.10-plugins-good
sudo apt-get install gstreamer0.10-plugins-bad
sudo apt-get install gstreamer0.10-ffmpeg
sudo apt-get install gstreamer0.10-alsa

Aptana Studio 3 as plugin fails to startup

I have installed Eclipse 3.7.2 via PPA on Ubuntu 12.04 and subsequently I have clicked on Add New Software and the link to 64Bit Aptana studio 3.
It found the plugin and installed it correctly.
Now when I startup the Eclipse I get this error:
An internal error has occurred.
No more handlesNative code library failed to load. (java.lang.UnsatisfiedLinkError: /home/xxx/.eclipse/org.eclipse.platform_3.7.0_155965261/plugins/com.aptana.swt.webkitbrowser.linux.x86_64_1.0.0.1295409059/os/linux/x86_64/libcefjni.so: libjpeg.so.62: cannot open shared object file: No such file or directory)
UPDATE:
I wonder could it be because I am using jdk 7 from Oracle rather than Sun jdk 6 ?
This is the log file of Eclipse
!SESSION 2012-04-30 07:48:06.985 -----------------------------------------------
eclipse.buildId=I20110613-1736
java.version=1.7.0_04
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.osgi 4 0 2012-04-30 07:48:07.951
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-gtk-3740 in java.library.path
no swt-gtk in java.library.path
Can't load library: /home/xxx/.swt/lib/linux/x86_64/libswt-gtk-3740.so
Can't load library: /home/xxx/.swt/lib/linux/x86_64/libswt-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:695)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:161)
I have found the solution:
The library libjpeg62 is required otherwise the java.lang.UnsatisfiedLinkError shows up.
If using OpenJDK try this:
sudo apt-get install openjdk-7-jdk libjpeg62 libwebkitgtk-1.0-0 git-core
if using Oracle (sun) Java try this:
sudo apt-get install libjpeg62 libwebkitgtk-1.0-0 git-core
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
source
Here is a complete guide on how to install Aptana Studio 3 on Ubuntu 12.04 LTS (Precise Pangolin). The same error you encountered is mentioned with the same solution. But might be helpful for people who want to do the full installation.
http://www.samclarke.com/2012/04/how-to-install-aptana-studio-3-on-ubuntu-12-04-lts-precise-pangolin/

Resources