Fork me on GitHub
#xtdb
<
2021-01-27
>
chromalchemy00:01:04

I am trying to get Crux running with RockDB persistence and running into an errors:

(ns gbd.crux
  (:require
    [crux.api :as crux]
    [crux.rocksdb]))

(def system
  (crux/start-node
    {:crux/tx-log
       {:kv-store
          {:crux/module crux.rocksdb/->kv-store
           :db-dir "tx-log"}}
     :crux/document-store
       {:kv-store
          {:crux/module crux.rocksdb/->kv-store
           :db-dir "docs"}}
     :crux/index-store
       {:kv-store
          {:crux/module crux.rocksdb/->kv-store
           :db-dir "indexes"}}}))
Using Cursive on Windows with Lein.

R.A. Porter01:01:57

What version of Crux are you running?

refset09:01:57

It looks like you're missing the quotes for the crux.rocksdb/->kv-store symbols, did you already try that?

chromalchemy19:01:50

I am running the latest version. I got it running with a later-posted code block. Thanks for the feedback though. For this version though, do you mean a quoted symbol like 'crux.rocksdb/->kv-store ?

refset18:01:18

great & yep that's what I meant 🙂

chromalchemy00:01:04

Folder Structure

chromalchemy00:01:31

error:

Execution error (ClassCastException) at crux.rocksdb/->kv-store$fn (rocksdb.clj:158).
class java.lang.String cannot be cast to class java.nio.file.Path (java.lang.String and java.nio.file.Path are in module java.base of loader 'bootstrap')

chromalchemy00:01:56

also getting:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
but not sure if that's critical

refset09:01:27

This is pretty normal, and definitely not related, though a little annoying!

chromalchemy19:01:16

[com.fzakaria/slf4j-timbre "0.3.20"]
Silenced it.

👌 3
chromalchemy00:01:53

I am loading this namespace into the repl, on demand...

chromalchemy00:01:45

(crux/start-node {})
seems to work

chromalchemy00:01:15

Any help would be greatly appreciated. Thanks.

Steven Deobald01:01:47

@chromalchemy You probably want a Crux config something like this:

(defn kv-store [dir]
            {:kv-store {:crux/module 'crux.rocksdb/->kv-store
                        :db-dir      (io/file dir)
                        :sync?       true}})
(crux/start-node
     {:crux/tx-log              (kv-store "tx-log")
      :crux/document-store      (kv-store "docs")
      :crux/index-store         (kv-store "indexes")})

🎉 3
chromalchemy19:01:47

This is working!!!! I guess I need to have http://clojure.java.io reqired. Thank you for the elaboration. Requiring:

[com.fzakaria/slf4j-timbre "0.3.20"]
Silenced the SLF4J warnings.

Adrian Smith19:01:33

hey is there an alternative for this repo: https://github.com/crux-labs/crux-console?

refset19:01:12

Hey 🙂 we actually built a different iteration of the console UI directly on top of the existing crux-http-server routes - so just add that module to your deps + config and run start-node as usual, then you can open up the URLs in your browser to see HTML (as well as use curl to get json or edn)

Steven Deobald19:01:52

Docs are here: https://www.opencrux.com/reference/http.html — though that should probably be [juxt/crux-http-server "21.01-1.14.0-alpha"]

Adrian Smith12:01:25

cool thank you