Docker runs Java applications, application log time and container time inconsistencies

Source: Internet
Author: User

    1. Docker runs ACTIVEMQ, log time and container time as follows:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/F4/wKioL1ZyPt-S8Yg9AAMaJK5fMJk997.png "title=" amq_ Time.png "alt=" Wkiol1zypt-s8yg9aamajk5fmjk997.png "/>d me to execute the date command a few minutes, from time to find the exact difference of 8 hours, suspected or time zone reasons.



2. Doubts

A friend said that the host's/etc/locatime mounted in the container will resolve the problem. But the result is still.



3. Inquire about the information, ask the great God, get the result

Before the Java app starts, add the parameter-duser.timezone=gmt+08


4. My Java application is ACTIVEMQ Message Queuing, editing ACTIVEMQ startup scripts

vi/opt/activemq/bin/activemq# uncomment to enable audit loggingactivemq_opts= "$ACTIVEMQ _opts- Dorg.apache.activemq.audit=true-dfile.encoding=utf8-duser.timezone=gmt+08 "


Finally, thanks for the help of the great God.















This article from the "Do not ask for the best, only better" blog, please be sure to keep this source http://yujianglei.blog.51cto.com/7215578/1725620

Docker runs Java applications, application log time and container time inconsistencies

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.