Fork me on GitHub
#datomic
<
2023-10-20
>
Mateusz Mazurczak00:10:43

Hi, I'm using now 1.0.7021 but tried also 1.0.7010. I'm trying to setup transactor in a docker image, deploy it and connect from peer, but I keep getting AMQ219007 I've deployed storage to postgresql (working as intended). I'm creating dockerfile that is running bin/transactor with properties as defined in sql config example. Where host is an ip of a pod. I've also added sql-driver-params as suggested in documentation troubleshooting. I'm running the transactor inside a docker with: docker run -p 4334:4334 -p 4335:4335 --net=host --detach [docker-image] And I get connection it runs without error. But when I try to connect to it from my repl

(deps: 
com.datomic/peer {:mvn/version "1.0.7021"}
        org.postgresql/postgresql {:mvn/version "42.5.1"})
(require '[datomic.api :as d])

  (def db-uri "datomic:")

  (d/create-database db-uri)
I get the message:
Caused by org.apache.activemq.artemis.api.core.ActiveMQNotConnectedException
   AMQ219007: Cannot connect to server(s). Tried with all available servers.
Any idea what may be causing this?

Mateusz Mazurczak01:10:40

I've tried java 11 and 17

favila01:10:08

Error suggests the peer could connect to Postgres but could not connect to the transactor. Does the transactor.properties have a host or alt-host that the peer can route to?

Mateusz Mazurczak01:10:12

Properties:

###################################################################

protocol=sql
host=[pod-ip]
port=4334
alt-host=localhost

###################################################################

sql-url=jdbc:postgresql://[db-data]

sql-user=[user]
sql-password=[pass]

## The Postgres driver is included with Datomic. For other SQL
## databases, you will need to install the driver on the
## transactor classpath, by copying the file into lib/,
## and place the driver on your peer's classpath.
sql-driver-class=org.postgresql.Driver

## Driver specified params, as semicolon-separated pairs.
sql-driver-params=ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory;

## The query used to validate JDBC connection.
# Optional
sql-validation-query=select 1

# Recommended settings for -Xmx1g usage, e.g. dev laptops.
memory-index-threshold=32m
memory-index-max=256m
object-cache-max=128m

Mateusz Mazurczak01:10:28

My dockerimage if interesting:

FROM clojure:temurin-17-tools-deps-1.11.1.1413-alpine

RUN apk --no-cache add --upgrade curl

ENV DATOMIC_VERSION 1.0.7021
ENV DATOMIC_HOME /opt/datomic-pro-$DATOMIC_VERSION

RUN curl -SL \
     -o /tmp/datomic.zip \
&& unzip /tmp/datomic.zip -d /opt \
&& rm -rf /tmp/datomic.zip

ADD config $DATOMIC_HOME/config

WORKDIR $DATOMIC_HOME

ENTRYPOINT ["./bin/transactor"]

EXPOSE 4334 4335 4336

CMD ["config/psqltransactor.properties"]

Mateusz Mazurczak01:10:09

I was wondering if the running command is the issue docker run -p 4334:4334 -p 4335:4335 --net=host --detach [docker-image] Since it gives me warning: WARNING: Published ports are discarded when using host network mode

Mateusz Mazurczak01:10:30

But when I do curl [pod-ip]:4334

Mateusz Mazurczak01:10:44

I get Empty reply from server

Mateusz Mazurczak01:10:49

which means it's running and is accessible (I think so)

Mateusz Mazurczak01:10:56

I've been trying to figure it out, why it may not work, but have no idea, I was trying it already on clever cloud and digital ocean 🤷

Michael Pham02:10:38

hi When i open it, it’s encrypt (https://prnt.sc/xEKFqIGaW1iq) I need a file like this https://github.com/sharetribe/datomic-docker-free/blob/master/transactor.properties.example so i can get host and alt-host to access datomic db. do u know how to decrypt it?

Michael Pham02:10:54

I hear that we need to check host and al-host … but when i check aws secret manager, it’s encrypt

Michael Pham02:10:16

does anyone know how to decode it