apache pulsar с помощью docker-compose не работает (/pulsar/conf/standalone.conf (нет такого файла или каталога))

#docker #docker-compose #apache-pulsar

#docker #docker-compose #apache-pulsar

Вопрос:

Я могу запустить Apache Pulsar с помощью этой команды docker:

 docker run -it 
  -p 6650:6650 
  -p 8080:8080 
  --mount source=pulsardata,target=/pulsar/data 
  --mount source=pulsarconf,target=/pulsar/conf 
  apachepulsar/pulsar:2.6.0 
  bin/pulsar standalone
  

Я пытаюсь преобразовать это в docker-compose и использую файл docker-compose.yml ниже. Когда я запускаю команду:

Docker-compose.yaml:

   pulsar:
    container_name: pulsar
    hostname: pulsar
    image: apachepulsar/pulsar:2.5.0
    restart: always
    ports:
      - 6650:6650
      - 8080:8080
    command: >
      /bin/bash -c "bin/pulsar standalone"
    volumes:
      - ./pulsardata/:/pulsar/data
      - ./pulsarconf/:/pulsar/conf
  

Ошибка:

  [AppClassLoader@18b4aac2] info register aspect org.apache.pulsar.broker.zookeeper.aspectj.ClientCnxnAspect
    [AppClassLoader@18b4aac2] info register aspect org.apache.pulsar.zookeeper.FinalRequestProcessorAspect
    [AppClassLoader@18b4aac2] info register aspect org.apache.pulsar.zookeeper.ZooKeeperServerAspect
    ERROR StatusLogger File not found in file system or classpath: log4j2.yaml
    ERROR StatusLogger Reconfiguration failed: No configuration found for '18b4aac2' at 'null' in 'null'
    Exception in thread "main" java.io.FileNotFoundException: /pulsar/conf/standalone.conf (No such file or directory)
        at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:195)
        at java.io.FileInputStream.<init>(FileInputStream.java:138)
        at java.io.FileInputStream.<init>(FileInputStream.java:93)
        at org.apache.pulsar.PulsarStandaloneStarter.<init>(PulsarStandaloneStarter.java:60)
        at org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:117)
    [AppClassLoader@18b4aac2] info AspectJ Weaver Version 1.9.2 built on Wednesday Oct 24, 2018 at 15:43:33 GMT
    [AppClassLoader@18b4aac2] info register classloader sun.misc.Launcher$AppClassLoader@18b4aac2
    [AppClassLoader@18b4aac2] info using configuration file:/pulsar/lib/org.apache.pulsar-pulsar-zookeeper-utils-2.5.0.jar!/META-INF/aop.xml
    [AppClassLoader@18b4aac2] info using configuration file:/pulsar/lib/org.apache.pulsar-pulsar-zookeeper-2.5.0.jar!/META-INF/aop.xml
    [AppClassLoader@18b4aac2] info register aspect org.apache.pulsar.broker.zookeeper.aspectj.ClientCnxnAspect
  

Есть предложения по исправлению этого?

Ответ №1:

Он работает без монтирования конфигурации.

 pulsar:
    container_name: pulsar
    hostname: pulsar
    image: apachepulsar/pulsar:2.5.0
    restart: always
    ports:
      - 6650:6650
      - 8080:8080
    command: >
      /bin/bash -c "bin/pulsar standalone"
    volumes:
      - ./pulsardata/:/pulsar/data