我正在尝试在 docker 容器中运行 Apache Atlas。
Dockerfile
FROM ubuntu:20.04
ARG VERSION=2.1.0-rc3
ARG VERSION_WITHOUT_RC=2.1.0
RUN apt-get update \
&& apt-get -y upgrade \
&& apt-get -y install apt-utils \
&& apt-get -y install \
maven \
wget \
git \
python \
openjdk-8-jdk-headless \
patch \
unzip \
&& cd /tmp \
&& wget https://github.com/apache/atlas/archive/refs/tags/release-${VERSION}.tar.gz \
&& mkdir -p /opt/gremlin \
&& mkdir -p /tmp/atlas-src \
&& tar --strip 1 -xzvf release-${VERSION}.tar.gz -C /tmp/atlas-src \
&& rm release-${VERSION}.tar.gz \
&& cd /tmp/atlas-src \
&& export MAVEN_OPTS="-Xms2g -Xmx2g" \
&& export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" \
&& mvn clean -Dmaven.repo.local=/tmp/.mvn-repo -Dhttps.protocols=TLSv1.2 -DskipTests package -Pdist \
&& tar -xzvf /tmp/atlas-src/distro/target/apache-atlas-${VERSION_WITHOUT_RC}-server.tar.gz -C /opt \
&& rm -Rf /tmp/atlas-src \
&& rm -Rf /tmp/.mvn-repo \
&& apt-get -y --purge remove \
maven \
git \
&& apt-get -y remove openjdk-11-jre-headless \
&& apt-get -y autoremove \
&& apt-get -y clean
COPY atlas-application.properties /opt/apache-atlas-${VERSION_WITHOUT_RC}/conf
EXPOSE 21000
#Non Root User Configuration
RUN adduser --system --uid 10000 --group --shell /sbin/nologin --home /opt/app/ app \
&& chown -R 10000 /opt/apache-atlas-${VERSION_WITHOUT_RC}
USER 10000
ENTRYPOINT ["/opt/apache-atlas-2.1.0/bin/atlas_start.py"]
“atlas-application.properties”文件包含 cassandra 和弹性搜索特定配置。
图像构建成功,但在启动应用程序时出现以下错误。
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.janusgraph.diskstorage.es.rest.RestElasticSearchClient
at org.janusgraph.diskstorage.es.rest.RestClientSetup.getElasticSearchClient(RestClientSetup.java:107)
at org.janusgraph.diskstorage.es.rest.RestClientSetup.connect(RestClientSetup.java:75)
at org.janusgraph.diskstorage.es.ElasticSearchSetup$1.connect(ElasticSearchSetup.java:51)
at org.janusgraph.diskstorage.es.ElasticSearchIndex.interfaceConfiguration(ElasticSearchIndex.java:437)
at org.janusgraph.diskstorage.es.ElasticSearchIndex.<init>(ElasticSearchIndex.java:324)
... 102 more
但是当我登录到容器时,我可以看到下面的 janus jars。
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-lucene-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/atlas-janusgraph-hbase2-2.1.0.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-es-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-solr-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-cql-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/atlas-graphdb-janus-2.1.0.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-cassandra-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-server-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-berkeleyje-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-driver-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-hbase-0.5.1.jar
./opt/apache-atlas-2.1.0/server/webapp/atlas/WEB-INF/lib/janusgraph-core-0.5.1.jar