Hi Matt,

Please find attached my Dockerfile and docker-compose file. Also included is 
the "conf" directory I am mounting inside the container to configure ActiveMQ. 
Hopefully you should be able to reproduce the problem.

Here is the full log when I run docker-compose up​😒

$ docker-compose up
Creating network "ark_activemq_default" with the default driver
Creating ark_activemq_activemq_1 ... done
Attaching to ark_activemq_activemq_1
activemq_1  | INFO: Using default configuration
activemq_1  |       Configurations are loaded in the following order: 
/etc/default/activemq /app/home/.activemqrc /app/activemq/bin/env
activemq_1  |
activemq_1  | INFO: Using java '/usr/local/openjdk-11/bin/java'
activemq_1  | INFO: Starting in foreground, this is just for debugging purposes 
(stop process by pressing CTRL+C)
activemq_1  | INFO: Creating pidfile /app/data/activemq.pid
activemq_1  | Java Runtime: Oracle Corporation 11.0.11 /usr/local/openjdk-11
activemq_1  |   Heap sizes: current=260096k  free=258119k  max=4098048k
activemq_1  |     JVM args: -Djava.util.logging.config.file=logging.properties 
-Djava.security.auth.login.config=/app/conf/login.config 
-Djava.awt.headless=true -Djava.io.tmpdir=/app/tmp 
--add-reads=java.xml=java.logging 
--add-opens=java.base/java.security=ALL-UNNAMED 
--add-opens=java.base/java.net=ALL-UNNAMED 
--add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.util=ALL-UNNAMED 
--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED 
--add-opens=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED 
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED 
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED 
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED 
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED 
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED 
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED 
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED 
-Dactivemq.classpath=/app/conf:/app/activemq/../lib/: 
-Dactivemq.home=/app/activemq -Dactivemq.base=/app/activemq 
-Dactivemq.conf=/app/conf -Dactivemq.data=/app/data
activemq_1  | Extensions classpath:
activemq_1  |   
[/app/activemq/lib,/app/activemq/lib/camel,/app/activemq/lib/optional,/app/activemq/lib/web,/app/activemq/lib/extra]
activemq_1  | ACTIVEMQ_HOME: /app/activemq
activemq_1  | ACTIVEMQ_BASE: /app/activemq
activemq_1  | ACTIVEMQ_CONF: /app/conf
activemq_1  | ACTIVEMQ_DATA: /app/data
activemq_1  | Loading message broker from: xbean:activemq.xml
activemq_1  |  INFO | Refreshing 
org.apache.activemq.xbean.XBeanBrokerFactory$1@8646db9: startup date [Tue Jun 
22 19:25:11 UTC 2021]; root of context hierarchy
activemq_1  |  INFO | Using Persistence Adapter: 
KahaDBPersistenceAdapter[/app/${activemq.data}/kahadb]
activemq_1  |  INFO | Database ${activemq.data}/kahadb/lock is locked by 
another server. This broker is now in slave mode waiting a lock to be acquired

After that, nothing gets logged any more.

Thanks a lot for your help!

  Fabrice

________________________________
From: Matt Pavlovich <mattr...@gmail.com>
Sent: 22 June 2021 18:23
To: users@activemq.apache.org <users@activemq.apache.org>
Subject: Re: Roundup of the configuration files

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


Flying blind here.. without more detailed logs or information there isn’t 
enough information to point to a root cause.

I can confirm that people have run ActiveMQ in Docker containers for years, so 
I do not suspect you are running into a bug at this point.

I’d look into this line next--  "${activemq.data}/kahadb/lock”.  I would expect 
the log line to expand the value of vs output the literal macro expression 
“${activemq.data}”.

-Matt Pavlovich

> On Jun 22, 2021, at 11:46 AM, Fabrice Triboix <fabrice.trib...@armedia.com> 
> wrote:
>
> Hi Matt,
>
> No, I am not using a volume at the moment.
>
> The data directory that I am using is /app/data​ and is owned by the 
> activemq​ user and activemq​ group with 755 permissions. ActiveMQ runs as the 
> activemq​ user. ActiveMQ clearly can create files there:
>
> activemq@7a5313d69a74:/app/data$ ls -al
> total 20
> drwxr-xr-x 1 activemq activemq 4096 Jun 22 16:44 .
> drwxr-xr-x 1 root     root     4096 Jun 22 16:38 ..
> -rw-r--r-- 1 activemq activemq  610 Jun 22 16:44 activemq.log
> -rw-r--r-- 1 activemq activemq    2 Jun 22 16:44 activemq.pid
> -rw-r--r-- 1 activemq activemq    0 Jun 22 16:44 audit.log
>
> Cheers,
>
>  Fabrice
>
>
> ________________________________
> From: Matt Pavlovich <mattr...@gmail.com>
> Sent: 22 June 2021 16:54
> To: users@activemq.apache.org <users@activemq.apache.org>
> Subject: Re: Roundup of the configuration files
>
> CAUTION: This email originated from outside of the organization. Do not click 
> links or open attachments unless you recognize the sender and know the 
> content is safe.
>
>
> Are you using a volume? Could be permissions related that ActiveMQ is unable 
> to get a lock on the filesystem.
>
>> On Jun 22, 2021, at 8:57 AM, Fabrice Triboix <fabrice.trib...@armedia.com> 
>> wrote:
>>
>> Hi Matt,
>>
>> I am running ActiveMQ as a Docker container, so I am positively certain that 
>> (1) there are no other ActiveMQ processes and (2) the "data" directory is 
>> empty at startup. Additionally, when I add back all the other configuration 
>> files (i.e. the files in the conf​ directory of the official tarball), this 
>> problem goes away.
>>
>> Cheers,
>>
>> Fabrice
>>
>> ________________________________
>> From: Matt Pavlovich <mattr...@gmail.com>
>> Sent: 22 June 2021 13:54
>> To: users@activemq.apache.org <users@activemq.apache.org>
>> Subject: Re: Roundup of the configuration files
>>
>> CAUTION: This email originated from outside of the organization. Do not 
>> click links or open attachments unless you recognize the sender and know the 
>> content is safe.
>>
>>
>> The filesystem locking is simply delegated to the OS. Double check you do 
>> not have a second ActiveMQ process that was left running unintentionally 
>> during the config testing.
>>
>> If it is on Linux, you can use the ‘lsof’ command to look for the process 
>> that has the kahadb/lock file locked.
>>
>> -Matt Pavlovich
>>
>>> On Jun 22, 2021, at 6:30 AM, Fabrice Triboix <fabrice.trib...@armedia.com> 
>>> wrote:
>>>
>>> Hello Matt,
>>>
>>> I am using a subset of the configuration files found in the the conf​ 
>>> directory of the official ActiveMQ release available here: 
>>> https://archive.apache.org/dist/activemq/5.16.2/apache-activemq-5.16.2-bin.tar.gz
>>>
>>> The configuration files I kept are:
>>>
>>> *   activemq.xml
>>> *   jetty.xml
>>> *   log4j.properties
>>> *   logging.properties
>>>
>>> Indeed, activemq.xml​ referenced credentials.properties​. I commented out 
>>> that reference, and ActiveMQ works a bit better. It does show the following 
>>> message which is not looking good:
>>>
>>> ​INFO | Database ${activemq.data}/kahadb/lock is locked by another server. 
>>> This broker is now in slave mode waiting a lock to be acquired
>>>
>>> This is very odd because there is only one ActiveMQ broker running...
>>>
>>> Any idea about what is going on?
>>>
>>> Many thanks,
>>>
>>> Fabrice
>>>
>>> ________________________________
>>> From: Matt Pavlovich <mattr...@gmail.com>
>>> Sent: 21 June 2021 15:43
>>> To: users@activemq.apache.org <users@activemq.apache.org>
>>> Subject: Re: Roundup of the configuration files
>>>
>>> CAUTION: This email originated from outside of the organization. Do not 
>>> click links or open attachments unless you recognize the sender and know 
>>> the content is safe.
>>>
>>>
>>> Hello Fabrice-
>>>
>>> Please be mindful that is difficult to troubleshoot over an email thread 
>>> without seeing the changes you are making on your end. I suspect the top of 
>>> your conf/activemq.xml has the Properties file entry referencing the 
>>> conf/credentials.properties. Try removing that section from your 
>>> conf/activemq.xml and the broker should start up.
>>>
>>> -Matt Pavlovich
>>>
>>>> On Jun 19, 2021, at 1:35 AM, Fabrice Triboix <fabrice.trib...@armedia.com> 
>>>> wrote:
>>>>
>>>> Hi Matt,
>>>>
>>>> All right, thanks a lot for these details.
>>>>
>>>> ActiveMQ crashes for me, there is a stack trace with the following error:
>>>>
>>>> Caused by: java.io.FileNotFoundException: /app/conf/credentials.properties 
>>>> (No such file or directory)
>>>>
>>>> Also, I am not sure why I need to repeat the users/groups/passwords 
>>>> information in the login.config​, groups.properties, and users.properties​ 
>>>> files... This information is already available in the activemq.xml​ file, 
>>>> isn't it? (I am using the simple authentication plugin)
>>>>
>>>> Thanks a lot for your help!
>>>>
>>>> Fabrice
>>>>
>>>> ________________________________
>>>> From: Matt Pavlovich <mattr...@gmail.com>
>>>> Sent: 18 June 2021 22:38
>>>> To: users@activemq.apache.org <users@activemq.apache.org>
>>>> Subject: Re: Roundup of the configuration files
>>>>
>>>> CAUTION: This email originated from outside of the organization. Do not 
>>>> click links or open attachments unless you recognize the sender and know 
>>>> the content is safe.
>>>>
>>>>
>>>> Hi Fabrice-
>>>>
>>>> The simple authentication plugin stores usernames and passwords in the 
>>>> conf/activemq.xml (it is generally used for embedded brokers or unit 
>>>> testing). If you use that, you won’t need the files below in the Messaging 
>>>> services section.
>>>>
>>>> Most general setups using running stand alone brokers with the Apache 
>>>> ActiveMQ distribution:
>>>>
>>>> Messaging services (JMS, MQTT, STOMP, etc):
>>>>
>>>> conf/login.config           <— defines what to use
>>>> conf/groups.properties <— group-to-user mappings
>>>> conf/users.properties   <— user and passwords
>>>>
>>>> Management (JMX):
>>>>
>>>> bin/env
>>>> conf/jmx.password
>>>> conf/jmx.access
>>>>
>>>> Web Console:
>>>>
>>>> conf/jetty.xml
>>>>
>>>> ref: https://activemq.apache.org/security
>>>>
>>>>
>>>> Hope this helps!
>>>>
>>>> -Matt Pavlovich
>>>>
>>>>
>>>>> On Jun 18, 2021, at 1:46 PM, Fabrice Triboix 
>>>>> <fabrice.trib...@armedia.com> wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> Could somebody please provide me with an answer to my question below?
>>>>>
>>>>> Thank you very much for any help,
>>>>>
>>>>> Fabrice
>>>>>
>>>>> ________________________________
>>>>> From: Fabrice Triboix <fabrice.trib...@armedia.com>
>>>>> Sent: 12 June 2021 15:50
>>>>> To: users@activemq.apache.org <users@activemq.apache.org>
>>>>> Subject: Re: Roundup of the configuration files
>>>>>
>>>>> CAUTION: This email originated from outside of the organization. Do not 
>>>>> click links or open attachments unless you recognize the sender and know 
>>>>> the content is safe.
>>>>>
>>>>>
>>>>> Hi Jean-Baptiste,
>>>>>
>>>>> Thanks a lot for your answer.
>>>>>
>>>>> Our ActiveMQ installation won't use any TLS, but will have authentication 
>>>>> (using the simple authentication plugin) and authorization. Which 
>>>>> additional configuration files would be required in such a setup?
>>>>>
>>>>> Thanks a lot for your help!
>>>>>
>>>>> Fabrice
>>>>>
>>>>> ________________________________
>>>>> From: Jean-Baptiste Onofre <j...@nanthrax.net>
>>>>> Sent: 12 June 2021 05:37
>>>>> To: users@activemq.apache.org <users@activemq.apache.org>
>>>>> Subject: Re: Roundup of the configuration files
>>>>>
>>>>> CAUTION: This email originated from outside of the organization. Do not 
>>>>> click links or open attachments unless you recognize the sender and know 
>>>>> the content is safe.
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> Basically, for a simple bin/activemq console start, by default (without 
>>>>> authentication), you just need
>>>>>
>>>>> - activemq.xml (broker config)
>>>>> - jetty.xml (jetty container used by admin web console)
>>>>> - log4j.properties (for logging config)
>>>>> - logging.properties (can be removed if you don’t use JUL)
>>>>>
>>>>> All the rest is used when SSL is enabled, when authentication is enabled.
>>>>>
>>>>> I’ve started some cleanup for 5.17.0 having dedicated folders per "use".
>>>>>
>>>>> Regards
>>>>> JB
>>>>>
>>>>>> Le 11 juin 2021 à 18:20, Fabrice Triboix <fabrice.trib...@armedia.com> a 
>>>>>> écrit :
>>>>>>
>>>>>> Hello everyone,
>>>>>>
>>>>>> I am looking at the official ActiveMQ tarball 
>>>>>> (https://archive.apache.org/dist/activemq/5.16.2/apache-activemq-5.16.2-bin.tar.gz)
>>>>>>  and I would like to understand how ActiveMQ is configured.
>>>>>>
>>>>>> In the "conf" directory, I can see the following files:
>>>>>>
>>>>>> *   activemq.xml
>>>>>> *   broker.ks
>>>>>> *   broker-localhost.cert
>>>>>> *   broker.ts
>>>>>> *   client.ks
>>>>>> *   client.ts
>>>>>> *   credentials-enc.properties
>>>>>> *   credentials.properties
>>>>>> *   groups.properties
>>>>>> *   java.security
>>>>>> *   jetty-realm.properties
>>>>>> *   jetty.xml
>>>>>> *   jmx.access
>>>>>> *   jmx.password
>>>>>> *   log4j.properties
>>>>>> *   logging.properties
>>>>>> *   login.config
>>>>>> *   users.properties
>>>>>>
>>>>>> I would like to know what each of these configuration files do, and 
>>>>>> whether they are required or not.
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Fabrice
>>>>>
>>>>
>>>
>>
>

Attachment: conf.tgz
Description: conf.tgz

Attachment: docker-compose.yml
Description: docker-compose.yml

Reply via email to