This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-16
Channels
- # announcements (22)
- # beginners (4)
- # biff (4)
- # cider (5)
- # clerk (3)
- # clojure (28)
- # clojure-chennai (1)
- # clojure-europe (23)
- # clojure-gamedev (7)
- # clojure-korea (5)
- # clojure-madison (3)
- # clojure-my (1)
- # clojure-nl (1)
- # clojure-norway (49)
- # clojure-sweden (7)
- # clojure-uk (4)
- # clojuredesign-podcast (14)
- # clojurescript (10)
- # clr (5)
- # cursive (4)
- # datascript (17)
- # datomic (2)
- # events (1)
- # garden (1)
- # introduce-yourself (2)
- # jobs-discuss (14)
- # lsp (23)
- # malli (14)
- # missionary (9)
- # off-topic (109)
- # overtone (7)
- # polylith (5)
- # releases (5)
- # shadow-cljs (7)
- # sql (13)
- # testing (30)
- # xtdb (10)
- # yamlscript (44)
How might one go about starting an XTDB v2 HTTP server locally, which can be interacted with from a separate client project (also running locally)?
So far, I have deps.edn
as:
{:paths ["src"]
:mvn/repos {"sonatype-snapshots" {:url ""}}
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
com.xtdb/xtdb-core {:mvn/version "2.0.0-SNAPSHOT"}
com.xtdb/xtdb-api {:mvn/version "2.0.0-SNAPSHOT"}
com.xtdb/xtdb-http-server {:mvn/version "2.0.0-SNAPSHOT"}} ; fixed, was specified as com.xtdb/xtdb-server, which does not exist and caused the error
:aliases {:xtdb {:jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
"-Dio.netty.tryReflectionSetAccessible=true"]}}}
When starting the REPL with
clojure \
-Sdeps '{:deps {nrepl/nrepl {:mvn/version,"1.0.0"},
cider/cider-nrepl {:mvn/version,"0.28.5"}}}' \
-M:xtdb -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
I encounter the following error:
Error building classpath. Could not find artifact com.xtdb:xtdb-server:jar:2.0.0-SNAPSHOT in central (https://repo1.maven.org/maven2/)
The alternative repository is specified under :mvn/repos
. Not sure what might cause the error.Hey @U03CPPKDXBL that seems odd, can't see an obvious explanation. Can you access the repository URL in your browser okay? https://s01.oss.sonatype.org/content/repositories/snapshots (i.e. maybe it's getting blocked somehow?)
Ah! Typo in the XTDB server dependency specification. com.xtdb/xtdb-server
should be com.xtdb/xtdb-http-server
.
(Checked the https://docs.xtdb.com/config/modules/http-server.)
ah! well spotted. Do you remember if you copy-pasted that from somewhere that I might need to hunt down and fix? π
Continuing on from the initial entry in the thread, xtdb.edn
can be specified in the project root:
;; ./xtdn.edn
{:log [:local {:path "/tmp/xtdb2/tx-log"}]
:storage [:local {:path "/var/lib/xtdb2/storage"}]
:http-server {:port 3000}}
The server can be started from the command line via clojure -M:xtdb -m xtdb.main
.
This server can be interacted with as described in the https://docs.xtdb.com/drivers/clojure/getting-started#_connecting_through_http.