Dhis2 eks

Hello,

I’m trying to setup DHIS2 on Elastic Kubernetes Service (AWS). Does anyone have any idea how we can run DHIS2.

Thanks,
Josh.

Welcome to the community @josh99 ! Thank you for sharing, are you facing any difficulty? Could you add more details? For what purpose are you setting it up? Development, implementation…?

Thank you!

Gassim

Hi Gassim,

I’m trying to implement/run DHIS2 docker image using EKS. So, technically I’m consuming it.

I’m having an issue while deploying DHIS image on the EKS cluster.

I tried using configmap of kubernetes to mount dhis.conf to the container from the eks node but doesn’t see to be working. Below is the yaml deployment file I have been using,

Blockquote
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: dhis
name: dhis-deployment
spec:
replicas: 2
selector:
matchLabels:
app: dhis
template:
metadata:
labels:
app: dhis
spec:
containers:
- image: “dhis2/core:2.34.2-tomcat-9.0.27-jdk11-openjdk-slim”
name: dhis
ports:
- containerPort: 8080
volumeMounts:
- name: dhis-config2
mountPath: /DHIS2_home/dhis.conf
subPath: dhis.conf
volumes:
- name: dhis-config2
configMap:
name: dhis-config2

Blockquote

and the issue I’m facing is shown below,

not really sure how Read-Only File System can be solved on the container level. Any help is appreciated.

Thanks,
Josh.

Clearly it showing the privilege issue.

Hi Roshan,

Thanks for the response. So, how do I fix it?

Josh.

If the system is deployed then chown the permission of the file dhis.conf

I did fix the permission issue. but, ran into another issue,

any clue why it is unable to connect to postgres, the firewall is opened on the host to db(which is outside the cluster)

WARN 2021-05-17 18:51:57,615 Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@7cb375af is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. (Slf4jMLog.java [C3P0PooledConnectionPoolManager[identityToken->1br8kt2ahyb03iozwiwbk|c582932]-HelperThread-#0])

  • WARN 2021-05-17 18:52:06,574 com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@26ab08ff – Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: (Slf4jMLog.java [C3P0PooledConnectionPoolManager[identityToken->1br8kt2ahyb03iozwiwbk|c582932]-HelperThread-#2])
    org.postgresql.util.PSQLException: The connection attempt failed.
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292)
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
    at org.postgresql.jdbc.PgConnection.(PgConnection.java:195)
    at org.postgresql.Driver.makeConnection(Driver.java:454)
    at org.postgresql.Driver.connect(Driver.java:256)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
    at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)
    Caused by: java.net.SocketTimeoutException: connect timed out
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at org.postgresql.core.PGStream.(PGStream.java:70)
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:91)
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)

Manoj

Dear Sir,
It seems all the connection resource has been used and stack overflow, if you can make s changes required on psql configuration for [max number of connection], please increase the max number of connection and then try again

Hello @josh99,

Did you solve your issue?

I currently have a version of DHIS2 running on EKS.

I’ll gladly help you debug. Please let me know if you need any support.

Best regards,
Andreas

1 Like

Hi Andreas,

Can you walk me through on how you setup dhis2 on EKS. what are the challenges you faced? How did you manage to run the application. etc

Thanks,
Josh.

@Andreas that’s really great of you to offer support on your first post in the community! The community will benefit from your expertise. :pray: