You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/01/07 11:39:35 UTC

[GitHub] [iotdb] likeToDream opened a new issue #2446: iotdb内部日志时间显示不对

likeToDream opened a new issue #2446:
URL: https://github.com/apache/iotdb/issues/2446


   用docker容器部署iotdb,进入运行iotdb的docker容器,date指令查看docker时间显示正常,但是iotdb下的logs目录下的日志文件,时间显示相差8小时。
   
   
   注:iotdb的镜像是通过dockerhup上拉取的(https://hub.docker.com/r/apache/iotdb/tags?page=1&ordering=last_updated),版本是0.11.1
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] likeToDream commented on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
likeToDream commented on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-760793852


   最后我是通过重新构建镜像,来实现的,
   新建Dockerfile,在下面添加这个时区的参数
   ENV TZ=Asia/Shanghai
   RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
   最后再启动新镜像,时间对上服务器时间


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou edited a comment on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
HTHou edited a comment on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-756503307


   您好,我试了下 docker容器内的date指令和日志的时间是一致的,这两个时间跟我本机的时间相差8小时,这个是没问题的。
   
   可以再确认下测试时的date指令是在容器内查看的?
   
   <img width="903" alt="Screen Shot 2021-01-08 at 10 15 11 AM" src="https://user-images.githubusercontent.com/25913899/103966240-708c7a00-519a-11eb-8580-9782d8bf30bd.png">
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] kqkdChen commented on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
kqkdChen commented on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-760789587


   我分享以下我的docker-compose文件,容器跑了3个月,时间是没问题的,一切ok
   ```yml
   version: '3.7'
   services:
     iotdb:
       image: apache/iotdb:0.11.1
       ports:
         - 6667:6667
         - 8181:8181
         - 1883:1883
       environment:
         - TZ=Asia/Shanghai
       logging:
         driver: "json-file"
         options:
           max-size: "1g"
       volumes:
       - ./conf:/iotdb/conf
       - ./data:/iotdb/data
       # - /data/iotdb/logs:/iotdb/logs
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] likeToDream commented on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
likeToDream commented on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-756517635


   是的,docker容器内的时间与本机时间差8小时,我修改了容器时间与服务器时间同步,
   (docker exec -it -u root 容器id /bin/sh
   mkdir -p /usr/share/zoneinfo/Asia
   docker cp /usr/share/zoneinfo/Asia/Shanghai 容器ID或容器名:/usr/share/zoneinfo/Asia
   docker exec -it -u root 容器Id或容器名 bash
   执行命令 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime),修改容器时间后,
   将运行iotdb的容器重启,发现日志的时间还是与服务器时间相差8小时,请问怎样才能调整让日志时间与服务器时间同步


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] likeToDream closed issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
likeToDream closed issue #2446:
URL: https://github.com/apache/iotdb/issues/2446


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-756525753


   我是通过这两条命令修改时区的,修改完需要重启docker 镜像。
   ```shell
   echo "Asia/Shanghai" > /etc/timezone
   ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
   ```
   <img width="903" alt="Screen Shot 2021-01-08 at 11 32 04 AM" src="https://user-images.githubusercontent.com/25913899/103971419-79cf1400-51a5-11eb-81d1-8100b84aecae.png">
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] kqkdChen commented on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
kqkdChen commented on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-760793990


   > 我是通过这两条命令修改时区的,修改完需要重启docker 镜像,IoTDB才会使用修改后的时间。
   > 
   > ```shell
   > echo "Asia/Shanghai" > /etc/timezone
   > ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
   > ```
   > 
   > <img alt="Screen Shot 2021-01-08 at 11 32 04 AM" width="903" src="https://user-images.githubusercontent.com/25913899/103971419-79cf1400-51a5-11eb-81d1-8100b84aecae.png">
   
   请问以下,可以通过传递环境变量来指定root用户的密码吗?类似mysql的docker镜像一样,没有看到官网有类似的说明


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou commented on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
HTHou commented on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-756503307


   您好,我试了下 docker容器内的date指令和日志的时间是一致的。这两个时间跟我本机的时间相差8小时。
   
   可以再确认下测试时的date指令是在容器内查看的?
   
   <img width="903" alt="Screen Shot 2021-01-08 at 10 15 11 AM" src="https://user-images.githubusercontent.com/25913899/103966240-708c7a00-519a-11eb-8580-9782d8bf30bd.png">
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [iotdb] HTHou edited a comment on issue #2446: iotdb内部日志时间显示不对

Posted by GitBox <gi...@apache.org>.
HTHou edited a comment on issue #2446:
URL: https://github.com/apache/iotdb/issues/2446#issuecomment-756525753


   我是通过这两条命令修改时区的,修改完需要重启docker 镜像,IoTDB才会使用修改后的时间。
   ```shell
   echo "Asia/Shanghai" > /etc/timezone
   ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
   ```
   <img width="903" alt="Screen Shot 2021-01-08 at 11 32 04 AM" src="https://user-images.githubusercontent.com/25913899/103971419-79cf1400-51a5-11eb-81d1-8100b84aecae.png">
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org