使用Docker设置timezone环境变量无效(timezone not working in elasticsearch on docker)

经过我的测试发现,>=7.15.2 版本无法使用TZ设置时区,例如:7.17.1、8.1.0
After my test, I found that the time zone cannot be set with TZ in version > = 7.15.2, such as 7.17.1 and 8.1.0。

docker run -d -e "TZ=Asia/Shanghai" -e "discovery.type=single-node" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" --name es2 docker.elastic.co/elasticsearch/elasticsearch:7.15.2

你所提到的都不是一回事。TZ环境变量是针对Linux的,它设置的是系统的时区。Elasticsearch基于UTC构建,内部应用是不能修改的,这也是为什么Elasticsearch的date类型有指定时区的功能

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.