본문 바로가기
IT/Etc

MacOS Silicon CPU에서 Trino를 도커로 설치

by 조병희 2025. 3. 6.

맥미니 M4에서 Trino를 도커로 설치할 경우 오류가 발생합니다.

(base) bhjo0930@Mac-mini-M4 ~ % docker run -p 8080:8080 --name trino trinodb/trino

+ launcher_opts=(--etc-dir /etc/trino)

+ grep -s -q node.id /etc/trino/node.properties

+ launcher_opts+=("-Dnode.id=${HOSTNAME}")

+ exec /usr/lib/trino/bin/launcher run --etc-dir /etc/trino -Dnode.id=b3255d9221ac

ERROR: could not exec java to determine jvm version: signal: aborted

원인은 docker image 내 java 가 리눅스용이라는거.

sh-5.1$ java -version

#

# A fatal error has been detected by the Java Runtime Environment:

#

#  SIGILL (0x4) at pc=0x0000ffff6b9401a8, pid=21, tid=22

#

# JRE version:  (23.0.2+7) (build )

# Java VM: OpenJDK 64-Bit Server VM (23.0.2+7, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)

# Problematic frame:

# j  java.lang.System.registerNatives()V+0 java.base@23.0.2

#

# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

# An error report file with more information is saved as:

# /tmp/hs_err_pid21.log

[0.022s][warning][os] Loading hsdis library failed

#

# The crash happened outside the Java Virtual Machine in native code.

# See problematic frame for where to report the bug.

#

Aborted

강제로 플랫폼을 지정하여 설치하면 

(base) bhjo0930@Mac-mini-M4 ~ % docker run -d --name trino --platform linux/amd64 -p 8080:8080 trinodb/trino:latest
Unable to find image 'trinodb/trino:latest' locally
latest: Pulling from trinodb/trino
08660cb4abb5: Download complete 
6c5c08141294: Download complete 
8e51050e2311: Download complete 
66695f31e16f: Download complete 
b4df254cf09a: Download complete 
57801bb4975f: Download complete 
28590e3290f6: Download complete 
38f50e2e7b92: Download complete 
eab6731ed321: Download complete 
63dea1bee099: Download complete 
Digest: sha256:cc9cab2afd71637176e94c729a05862d1b2d07f5b13b109f1ae041d3e78428dd
Status: Downloaded newer image for trinodb/trino:latest
d6c200d32346f4e65a51a2fdff0b7d2faedfb894291c01ea2f97a470fe449a4f
(base) bhjo0930@Mac-mini-M4 ~ %

성공.

만약 다른 프로그램을 컨테이너로 올릴 때 동일한 오류가 난다면 

_JAVA_OPTIONS: -XX:UseSVE=0

"_JAVA_OPTIONS=-XX:UseSVE=0" Docker Compose에서 실행되는 Java 프로세스가 SVE(Scalable Vector Extension)를 사용하지 않도록 설정하는 역할을 한다고 합니다. 뭔말인지 모르겠으나 elasticsearch 의 경우에는 이걸로 오류를 해결 했습니다.

  elasticsearch:
    build:
      context: elasticsearch/
      args:
        ELASTIC_VERSION: ${ELASTIC_VERSION}
    volumes:
      - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,Z
      - elasticsearch:/usr/share/elasticsearch/data:Z
    ports:
      - 9200:9200
      - 9300:9300
    environment:
      node.name: elasticsearch
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      # Bootstrap password.
      # Used to initialize the keystore during the initial startup of
      # Elasticsearch. Ignored on subsequent runs.
      ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-}
      # Use single node discovery in order to disable production mode and avoid bootstrap checks.
      # see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
      discovery.type: single-node
      _JAVA_OPTIONS: -XX:UseSVE=0
    networks:
      - elk
    restart: unless-stopped

 

댓글