09-26-2020 11:20 AM
Hi
my alfresco and share containers running by default in GMT. Which is causing some timestamp specific custom jobs run at wrong timings that required time.
how can i make it running in ET zone?
09-26-2020 08:41 PM
volumes: - /etc/localtime:/etc/localtime
09-30-2020 07:31 AM
So there are two things. One- synchronize the time/timezone etc. with host machine to containers. Two - Set the timezone for containers. In the first case, whatever time/timezone is set on host machine, it will be synchronized to containers.
In second case, you can use different timezone on host machine but can set a specific time zone for containers.
In case of synchronization, we bind mount host machine's localtime file. Which is true for linux but for windows it may not work.
In case of setting time zone, it is independent of host machine, whether it is windows or linux.
Try below settings and see if it works for you on "developer system" and "ubuntu dev server" both as reported by you.
For EDT timezone: environment: TZ: "America/New_York" or
environment: - TZ=America/New_York
A service level example:
alfresco: build: dockerfile: ./Dockerfile context: ./configs-to-override/alfresco mem_limit: 8g environment: JAVA_OPTS: " -Ddb.driver=org.postgresql.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://postgres:5432/alfresco -Dsolr.host=solr6 -Dsolr.port=8983 -Dsolr.secureComms=none -Dsolr.base.url=/solr -Dindex.subsystem.name=solr6 -Dshare.host=127.0.0.1 -Dshare.port=7080 -Dalfresco.host=localhost -Dalfresco.port=7080 -Daos.baseUrlOverwrite=http://localhost:7080/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" -Ddeployment.method=DOCKER_COMPOSE -DlocalTransform.core-aio.url=http://transform-core-aio:8090/ -Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/ -Djodconverter.url=http://transform-core-aio:8090/ -Dimg.url=http://transform-core-aio:8090/ -Dtika.url=http://transform-core-aio:8090/ -Dtransform.misc.url=http://transform-core-aio:8090/ -Dcsrf.filter.enabled=false -Xms8g -Xmx8g " TZ: "America/New_York" volumes: - ./alfresco/alf_data:/usr/local/tomcat/alf_data
Second e.g.
postgres: image: postgres:11.7 mem_limit: 1g environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco - POSTGRES_DB=alfresco - TZ=America/New_York command: postgres -c max_connections=300 -c log_min_messages=LOG ports: - 5432:5432 volumes: - ./postgres/data:/var/lib/postgresql/data
09-26-2020 08:41 PM
volumes: - /etc/localtime:/etc/localtime
09-28-2020 05:57 PM
Tx @kaynezhang , I tried adding the instructions in docker compose for acs service. And when i launching containers, acs is failing without any trace of errors. in docker ps result i am not seeing acs. Not seeing any log why failing. when i am removing the instructions, it is starting fine.
I try on our ubuntu dev server. I will update results
09-28-2020 07:39 PM
There maybe something wrong with your docker compose file ,please paste it here
09-29-2020 09:54 AM
hi @kaynezhang
So when tried on ubuntu server it worked but not working on developer system. We are using docker desktop on developer system.
find the compose file :
services: alfresco: build: dockerfile: ./Dockerfile context: ./configs-to-override/alfresco mem_limit: 8g environment: JAVA_OPTS: " -Ddb.driver=org.postgresql.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://postgres:5432/alfresco -Dsolr.host=solr6 -Dsolr.port=8983 -Dsolr.secureComms=none -Dsolr.base.url=/solr -Dindex.subsystem.name=solr6 -Dshare.host=127.0.0.1 -Dshare.port=7080 -Dalfresco.host=localhost -Dalfresco.port=7080 -Daos.baseUrlOverwrite=http://localhost:7080/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" -Ddeployment.method=DOCKER_COMPOSE -DlocalTransform.core-aio.url=http://transform-core-aio:8090/ -Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/ -Djodconverter.url=http://transform-core-aio:8090/ -Dimg.url=http://transform-core-aio:8090/ -Dtika.url=http://transform-core-aio:8090/ -Dtransform.misc.url=http://transform-core-aio:8090/ -Dcsrf.filter.enabled=false -Xms8g -Xmx8g " volumes: - ./alfresco/alf_data:/usr/local/tomcat/alf_data - /etc/localtime:/etc/localtime transform-core-aio: image: alfresco/alfresco-transform-core-aio:2.3.4 mem_limit: 1536m environment: JAVA_OPTS: " -Xms256m -Xmx1536m" ports: - 8090:8090 share: build: dockerfile: ./Dockerfile context: ./configs-to-override/share mem_limit: 2g environment: REPO_HOST: "alfresco" REPO_PORT: "7080" JAVA_OPTS: " -Xms2g -Xmx2g -Dalfresco.host=localhost -Dalfresco.port=7080 -Dalfresco.context=alfresco -Dalfresco.protocol=http " postgres: image: postgres:11.7 mem_limit: 1g environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco - POSTGRES_DB=alfresco command: postgres -c max_connections=300 -c log_min_messages=LOG ports: - 5432:5432 volumes: - ./postgres/data:/var/lib/postgresql/data solr6: image: alfresco/alfresco-search-services:1.4.2.2 mem_limit: 2g environment: #Solr needs to know how to register itself with Alfresco - SOLR_ALFRESCO_HOST=alfresco - SOLR_ALFRESCO_PORT=7080 #Alfresco needs to know how to call solr - SOLR_SOLR_HOST=solr6 - SOLR_SOLR_PORT=8983 #Create the default alfresco and archive cores - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive #HTTP by default - ALFRESCO_SECURE_COMMS=none - "SOLR_JAVA_MEM=-Xms2g -Xmx2g" ports: - 8083:8983 #Browser port volumes: - ./solr6/contentstore:/opt/alfresco-search-services/contentstore - ./solr6/data:/opt/alfresco-search-services/data activemq: image: alfresco/alfresco-activemq:5.15.8 mem_limit: 1g ports: - 8161:8161 # Web Console - 5672:5672 # AMQP - 61616:61616 # OpenWire - 61613:61613 # STOMP proxy: build: dockerfile: ./Dockerfile context: ./configs-to-override/proxy mem_limit: 256m depends_on: - alfresco ports: - 7080:7080 links: - alfresco - share
09-29-2020 10:52 AM
I am not sure what you mean by not working on developer system, what is your developer system environment?
09-30-2020 06:59 AM
i mean to say developer system is using docker desktop on windows. It is still not working. Shared the compose file above. Working fine on ubuntu dev server.
09-30-2020 07:22 AM
It dose not work on windows because there is no /etc/timezone on Windows
09-30-2020 07:31 AM
So there are two things. One- synchronize the time/timezone etc. with host machine to containers. Two - Set the timezone for containers. In the first case, whatever time/timezone is set on host machine, it will be synchronized to containers.
In second case, you can use different timezone on host machine but can set a specific time zone for containers.
In case of synchronization, we bind mount host machine's localtime file. Which is true for linux but for windows it may not work.
In case of setting time zone, it is independent of host machine, whether it is windows or linux.
Try below settings and see if it works for you on "developer system" and "ubuntu dev server" both as reported by you.
For EDT timezone: environment: TZ: "America/New_York" or
environment: - TZ=America/New_York
A service level example:
alfresco: build: dockerfile: ./Dockerfile context: ./configs-to-override/alfresco mem_limit: 8g environment: JAVA_OPTS: " -Ddb.driver=org.postgresql.Driver -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.url=jdbc:postgresql://postgres:5432/alfresco -Dsolr.host=solr6 -Dsolr.port=8983 -Dsolr.secureComms=none -Dsolr.base.url=/solr -Dindex.subsystem.name=solr6 -Dshare.host=127.0.0.1 -Dshare.port=7080 -Dalfresco.host=localhost -Dalfresco.port=7080 -Daos.baseUrlOverwrite=http://localhost:7080/alfresco/aos -Dmessaging.broker.url=\"failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true\" -Ddeployment.method=DOCKER_COMPOSE -DlocalTransform.core-aio.url=http://transform-core-aio:8090/ -Dalfresco-pdf-renderer.url=http://transform-core-aio:8090/ -Djodconverter.url=http://transform-core-aio:8090/ -Dimg.url=http://transform-core-aio:8090/ -Dtika.url=http://transform-core-aio:8090/ -Dtransform.misc.url=http://transform-core-aio:8090/ -Dcsrf.filter.enabled=false -Xms8g -Xmx8g " TZ: "America/New_York" volumes: - ./alfresco/alf_data:/usr/local/tomcat/alf_data
Second e.g.
postgres: image: postgres:11.7 mem_limit: 1g environment: - POSTGRES_PASSWORD=alfresco - POSTGRES_USER=alfresco - POSTGRES_DB=alfresco - TZ=America/New_York command: postgres -c max_connections=300 -c log_min_messages=LOG ports: - 5432:5432 volumes: - ./postgres/data:/var/lib/postgresql/data
10-01-2020 06:45 AM
Worked!! I tried today on developer system docker desktop and ubuntu dev sever both.
@abhinavmishra14 Thnx for great explanation.
Explore our Alfresco products with the links below. Use labels to filter content by product module.