Description
Spin up a running Datomic Free box from the commandline. Done.
The default box is a 1GB Ubuntu box on EC2 running openjdk Java version 7 but all this can be configured.
Usage
Let's deploy a datomic box to EC2!
$ git clone [email protected]:cldwalker/datomic-box.git; cd datomic-box
# add EC2 credentials
$ lein pallet add-service aws aws-ec2 ACCESS_KEY_ID SECRET_ACCESS_KEY
# Create the box and install all packages
$ lein pallet up --phases configure,install
# To see how it's progressing tail the log file e.g. tail -f logs/target-IP-ADDR.log
# Manual steps that I hope to automate
$ ssh user@IP-ADDR
# On the box
$ sudo initctl start datomic
You know have a datomic-free transactor running as an upstart job!
At this point, there are multiple paths you could take:
- For just a personal app, you could connect to the transactor from your computer.
- To run the personal app on EC2, run it on the same box.
- For a more robust setup, you could hook this transactor up to other EC2 peers as discussed on this thread. You may want to consider using (CloudFormation)[http://docs.datomic.com/aws.html) and Datomic Pro.
Connect to Public Transactor
To open up datomic ports for use from your machine:
- Select the datomic-box security group under the Security Groups section of your EC2 dashboard.
- On the Inbound tab, create a new TCP rule for ports 4334-4336.
- Use Source 0.0.0.0/0 to have it available to anyone. To just allow your computer, put your IP in this format: IP-ADDR/32
- Click 'Apply Rule Changes'
- Verify the ports are open:
telnet IP-ADDR PORT
You should now be able to access your transactor with uri:
datomic:free://IP-ADDR-OR-DOMAIN/DATABASE
Run a Public Datomic App
TODO
Configuration
Since this is all based on pallet, refer to its documentation frequently.
To configure the following, modify src/datomic_box/core.clj on your fork:
datomic
- modify datomic-crate options map passed todatomic/datomic
java
- modify java-crate options map passed tojava/server-spec
OS, instance size, etc.
- modify node options ondefault-node-spec
provider
- Uselein pallet providers
to see available providers. Uselein pallet add-service
to add your own.
Credits
None of this would be possible without pallet and the datomic-crate.
Bugs/Issues
Please report them on github.
License
See LICENSE.TXT
TODO
- Provide a lein command to generate a pallet.clj in a project.
- Create a datomic box with
lein pallet up
. - Open up configs of all crates