This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-12
Channels
- # announcements (1)
- # aws (1)
- # babashka (63)
- # beginners (108)
- # calva (12)
- # cider (6)
- # cljdoc (2)
- # cljsrn (33)
- # clojure (150)
- # clojure-europe (28)
- # clojure-nl (13)
- # clojure-spain (1)
- # clojure-spec (8)
- # clojure-uk (25)
- # clojurescript (16)
- # conjure (7)
- # cursive (7)
- # datomic (15)
- # duct (2)
- # eastwood (2)
- # figwheel (1)
- # figwheel-main (1)
- # fulcro (6)
- # graalvm (1)
- # graalvm-mobile (1)
- # helix (6)
- # honeysql (23)
- # integrant (6)
- # introduce-yourself (4)
- # jobs (10)
- # lsp (132)
- # malli (4)
- # meander (1)
- # membrane (1)
- # off-topic (223)
- # pathom (23)
- # pedestal (3)
- # re-frame (18)
- # reagent (13)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (68)
- # tools-deps (217)
- # vim (19)
- # xtdb (79)
I’m trying to run Datomic https://github.com/alexanderkiel/datomic-free and my clojure server as two services using docker compose locally, and this is my compose file:
version: '3'
services:
datomic:
image: akiel/datomic-free
environment:
- ADMIN_PASSWORD="admin"
- DATOMIC_PASSWORD="datomic"
web:
build: .
ports:
- "3001:3000"
This was working without docker where I was running the transactor on the machine directly using the local dev instructions on the datomic website, but using docker compose, I get the following error when making a request to my server that involves a database transaction:
https://gist.github.com/zendevil/ce069eb7375ede709c2e4ebbd3c2ef3b
Relevant code:
(def db-uri "datomic:")
(def *conn
"Get shared connection."
(delay (d/connect db-uri)))
(defn install-schema
"This function expected to be called at system start up.
Datomic schema migrations or db preinstalled data can be put into 'migrations/schema.edn'
Every txes will be executed exactly once no matter how many times system restart."
[]
(prn "installing schema")
(let [schema-map (read-string (slurp "resources/migrations/schema.edn"))]
(prn "schema map" schema-map)
@(d/transact (force *conn) (:creator-schema schema-map))
@(d/transact (force *conn) (:creation-schema schema-map))
))
(defn init-db [_]
(prn "database created " (d/create-database db-uri))
(try (install-schema)
(catch Exception e (prn "installing schema" e)))
(r/response "ok")
)
The http request calls init-dbthe error is saying the jdbc client cant reach mysql. So somehow that address is wrong.
maybe its supposed to be datomic:4335?
based off these docs https://docs.docker.com/compose/networking/
try
(def db-uri "datomic:")
insteadthat gives: Caused by: org.h2.jdbc.JdbcSQLException: Wrong user name or password [28000-171]
well it connected, so the next step is to give it the right username and password.
do you see anywhere here to give a username or password? https://github.com/alexanderkiel/datomic-free
it's currently passed in the db-url or at least the password is
what your passing looks correct in that it matches the grammar of the string on the githubpage
security is a PITA because it's not specific about whats wrong. e.g password or user (of course it can't know, but it also doesnt want to share)
(def db-uri "datomic:")
maybe?If I'm using dynamodb in prod, can i also use dynamodb locally? Should I be? Is it seamless to restore a dynamo db into local if the storage engines are different ?
Ah i see the dynamodb local storage. I didn't know that was an option. Is that recommended ?
Using Datomic on-prem https://docs.datomic.com/on-prem/operation/backup.html to move across storages is a great feature of backup and restore. However for https://docs.datomic.com/on-prem/operation/backup.html#other-storages we recommend running with all system processes down, run the restore, then start the transactor and peers.