Fork me on GitHub
#datomic
<
2021-12-23
>
jdkealy00:12:38

Can a datomic transactor run as a kubernetes pod?

Drew Verlee05:12:45

I'm guessing that's not a good fit. A pod doesn't persist state between failure. The guess here is that a transactor needs to hold state.

Drew Verlee05:12:55

give you can run two transactors to provide HA then maybe a pod is fine, and you could get HA by using datomic pro.

Drew Verlee05:12:15

I'm reeling at the idea of trying to make that work vs just using datomic cloud though.

thumbnail11:12:51

I'm pretty sure the transactor state is persisted in the underlying storage

thumbnail12:12:34

For development we run both the transactor and the peer in docker containers. It seems to work; but it's not a production environment at all.

Joe Lane13:12:59

I’ve seen transactors run in pods in production.

jdkealy13:12:51

Cool, thanks y'all... I think the only concern is probably ensuring that it gets enough RAM. To me it sounds perfectly suited for a pod. You have failover, it doesn't persist to disk, and if you're already on kubernetes, it greatly simplifies deployments between environments.

Joe Lane15:12:42

Well, the transactor certainly writes to disk if you're using any fulltext attributes OR if you're using Valcache with the transactor. You may be able to configure a pod to have an ephemeral NVMe SSD for Valcache, I'm not sure.

jdkealy17:12:19

Why would I be getting Error communicating with HOST datomic-service on PORT 4334 My kubernetes transactor pod is connecting to postgres and writing its location to storage, in the cluster the service address is datomic-service.

jdkealy18:12:05

port 4334 is exposed

root@lms-app-65bf78f8db-q5z95:/usr/src/app# telnet datomic-service 4334
Trying 10.100.252.126...
telnet: Unable to connect to remote host: Connection refused
root@lms-app-65bf78f8db-q5z95:/usr/src/app# telnet datomic-service 4330
Trying 10.100.252.126...

favila18:12:59

Is the peer in the cluster too?

favila18:12:19

peers communicate with storage independently (not via the transactor)

favila18:12:45

so datomic-service needs to resolve to postgres for peers, or else you can add alt-host= with an alternative hostname

jdkealy18:12:48

yes the peer is in the cluster

favila18:12:16

host= is also the bind address for the transactor. What does datomic-service resolve to on the transactor? Did the transactor start up correctly?

jdkealy18:12:40

the transactor started correctly

jdkealy18:12:23

datomic-service resolves to itself on the transactor

jdkealy18:12:37

Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50
Starting datomic:sql://<DB-NAME>?jdbc:, you may need to change the user and password parameters to work with your jdbc driver ...
System started datomic:sql://<DB-NAME>?jdbc:, you may need to change the user and password parameters to work with your jdbc driver

favila18:12:19

is “resolves to itself” specifically what IP address? The exact same one: 10.100.252.126?

favila18:12:35

or maybe some internal address? or loopback, or…

jdkealy18:12:57

telnet: can't connect to remote host (10.100.252.126): Connection refused

jdkealy18:12:07

this is on the transactor

jdkealy18:12:45

so yes, they're the same IP

favila18:12:24

I guess check with netstat

jdkealy18:12:58

the transactor is just showing connections to postgres

jdkealy18:12:20

the peer also shows a connection to postgres

jdkealy18:12:17

this was all working before i attempted to put it in kubernetes. Same DB, which i wiped and reconnected.

jdkealy18:12:48

when re-connected, it correctly updated the host url