Fork me on GitHub
#datomic
<
2017-06-02
>
robert-stuttaford04:06:56

@jdkealy each peer gets one queue.

stuartsierra13:06:25

@jdkealy Each peer process gets one queue: Every peer will see every message. Within a peer process, there is only one queue, so if there are multiple threads reading from the queue each thread will see only some of the messages.

rustam.gilaztdinov22:06:21

hello, guys! i’m little bit of frustrated trying to launching server with postgres, executed all sql scripts in bin/sql/

postgres-db.sql ->> postgres-table.sql ->> postgres-user.sql
After that run transactor
bin/transactor my-transactor.properties
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 ...
In my-transactor.properties
protocol=sql
host=localhost
port=4334
license-key=+-A...
sql-url=jdbc:
sql-user=datomic
sql-password=datomic
I don’t understand — what is <DB-NAME>? Where is place in template which build this db-uri and <DB-NAME>? directly? datomic:sql://<DB-NAME>?jdbc: Many thx!

favila22:06:15

@rustam.gilaztdinov <DB-NAME> is a placeholder for whatever datomic database you create

favila22:06:39

(d/create-database "datomic:) for example

favila22:06:53

creates a datomic database called my-database

rustam.gilaztdinov22:06:38

So, first needed to be create database in repl And then start transactor?

favila22:06:51

you started the transactor

favila22:06:21

the transactor is telling you the uri "template" by which you can create databases on the storage the transactor has control over

favila22:06:40

you need a transactor to create a database

favila22:06:24

this template may not be correct if your peer is somewhere else on the network, uses a jdbc arg, etc

favila22:06:54

but in the common case you just substitute <DB-NAME> with a name and it works

rustam.gilaztdinov22:06:56

And where I can substitute <DB-NAME> ? In which file?

favila22:06:10

there is no file

favila22:06:15

in your code

favila22:06:42

(d/create-database "datomic:) is an eg of clojure code

rustam.gilaztdinov22:06:31

But how can I execute this code, if I can not to run my transactor? 😃

favila22:06:39

you execute it in a peer

favila22:06:38

(let [conn-uri "datomic:]
  (when (d/create-database conn-uri)
    (d/connect conn-uri)))

favila22:06:26

eg, that will create the database "my-database", and if it is newly created return the connection object

favila22:06:48

datomic peers connect to storage first, and an entry in storage (written by the transactor) tells them how to connect to the transactor

favila22:06:17

so the connection uri for a database is always datomic:<STORAGE-TYPE>://<DATOMIC-DATABASE-NAME>?<STORAGE-SPECIFIC-STUFF>

favila22:06:32

and transactor.properties host= and alt-host= are hostnames the peer should be able to use to get to the transactor (not storage)

favila22:06:01

host=localhost means essentially that peers and transactors are always on the same box