ma2*_*a2s 6 clojure datomic heroku-postgres
我无法使用Heroku Postgres设置Datomic.首先,我成功安装了这个
[com.datomic/datomic-pro "0.9.5206" :exclusions [joda-time]]
Run Code Online (Sandbox Code Playgroud)
我的sql-transactor.properties
文件看起来像这样:
protocol=sql
host=localhost
port=4334
license-key=<MY_LICENSE_KEY>
sql-url=jdbc:postgresql://ec2-54-204-3-200.compute-1.amazonaws.com:5432/<MY_HEROKU_DB_NAME>
sql-user=<MY_USER>
sql-password=<MY_PASS>
sql-driver-params=ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory
Run Code Online (Sandbox Code Playgroud)
当我尝试从下载的datomic-pro文件夹运行transactor时:
bin/transactor /path/to/folder/sql-transactor.properties
它给出了以下输出:
Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50
Starting datomic:sql://<DB-NAME>?jdbc:postgresql://ec2-54-204-3-200.compute-1.amazonaws.com:5432/<MY_HEROKU_DB_NAME>?user=<MY_USER>&password=<MY_PASS>&ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory, you may need to change the user and password parameters to work with your jdbc driver ...
System started datomic:sql://<DB-NAME>?jdbc:postgresql://ec2-54-204-3-200.compute-1.amazonaws.com:5432/<MY_HEROKU_DB_NAME>?user=<MY_USER>&password=<MY_PASS>&ssl=true;sslfactory=org.postgresql.ssl.NonValidatingFactory, you may need to change the user and password parameters to work with your jdbc driver
Run Code Online (Sandbox Code Playgroud)
注:该<DB-NAME>
输出是字面上<DB-NAME>
.这不是我的占位符.我认为这可能是个错误.
现在当我尝试clojure时:
(def uri "datomic:sql://<MY_HEROKU_DB_NAME>?jdbc:postgresql://localhost:5432/<MY_HEROKU_DB_NAME>")
(def conn (datomic.api/connect uri))
Run Code Online (Sandbox Code Playgroud)
它给出了错误:
java.net.ConnectException: Connection refused
org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
clojure.lang.Compiler$CompilerException: java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections., compiling:(server.clj:40:11)
Run Code Online (Sandbox Code Playgroud)
有人有什么想法吗?
编辑:我忘了提到我已经从http://docs.datomic.com/storage.html上做了关于bin/sql/postgres-table
脚本的步骤