Login DB and Docker operations

Login to dalco
╰─➤  ssh dalco@dalco.duckdns.org 
<password as per previous instructions>
 
creating new containers @ dalco
 
when u need a new titan run:

skonecki[7:02 PM]~/titan-deploy.sh newTitan
ssh root@newTitan
 
when u need a new aiida run:
~/aiida-deploy.sh newaiida
ssh root@newaiida
for mounting /shared there is script ~/docker-mount-dir <containerid>
but if you start containers with those scripts /shared is already mounted

skonecki[7:21 PM
 
Login to container with Titan with hbase and elasticsearch
 
─dalco@ami6c92bf092d16 ~  
╰─➤  ssh root@titan     
<no password>
-bash-4.2# 
-bash-4.2# cd /opt/titan-0.5.4-hadoop2/
-bash-4.2# bin/gremlin.sh 
 
         \,,,/
         (o o)
-----oOOo-(_)-oOOo-----
==>g = TitanFactory.open('conf/titan-hbase-es.properties')
==>titangraph[hbase:[127.0.0.1]]
gremlin> GraphOfTheGodsFactory.load(g)
==>null
 
Now  you can run some query examples from https://github.com/thinkaurelius/titan/wiki/Getting-Started
 
connecting with berkleydb
 
gremlin> g=TitanFactory.build().set("storage.backend", "berkeleyje").set("storage.directory", "/tmp/graph").open()
==>titangraph[berkeleyje:/tmp/graph]
 
connecting with cassanda
 
gremlin> g=TitanFactory.build().set("storage.backend", "cassandra").set("storage.hostname", "172.17.0.3").open()
==>titangraph[cassandra:[172.17.0.3]]
 
 
Titan
╭─dalco@ami6c92bf092d16 ~  
╰─➤  curl http://localhost:8182/graphs/graph/vertices
{"version":"2.5.0","results":[],"totalSize":0,"queryTime":52.252089}%             
 
Neo4j
╭─dalco@ami6c92bf092d16 ~  
╰─➤  curl localhost:7474   
{
 "management" : "http://localhost:7474/db/manage/",
 "data" : "http://localhost:7474/db/data/"
}%                                                                                               
Login to AiiDa + postgres instance @ dalco
─dalco@ami6c92bf092d16 /home/dalco
╰─➤  ssh root@aiida
Last login: Tue May 12 13:47:52 2015 from ::1
root@b985dae24bef:~# verdi shell
 
Sharing data between AiiDa and Titan
Use "/shared" directory that is present at AiiDa and Titan containers as well as the host dalco machine.
 
AWESOME Docker 
 
RUNNING AiiDa containers @darco
 
# if you are @ darco then run
`docker run -it --name aiidaNew -v /shared:/shared  aiida /sbin/my_init -- bash -l`
 
#you can also download prebuilt image from dockerhub
#docker run -it --name aiidaNew -v /shared:/shared  skoneka/docker-aiida /sbin/my_init -- bash -l
# there is aufs bug which sometimes pops up 
# so if this fails then you have to remove the downloaded image `docker images` `docker rmi docker-aiida-image-id`
# and build the image on your own
# `git clone https://github.com/BIGDATA2015-AIIDA-EXTENSION/AiiDA-Docker `
# `cd AiiDa-Docker; docker built -t aiida .`
 
 
# Once you have the docker container running dont C-D because it will stop the container,
# you can reattach to a running container using `docker attach <cid>`. Get CID from `docker ps` or `docker ps -a`
 
Once you are inside the container to the following steps:
- set 'PermitRootLogin yes' in /etc/ssh/sshd_config; then `service ssh restart`, test ssh root@localhost inside container
- copy dalco ~/.ssh/id_rsa.pub key to container /root/.ssh/authorized_keys
- check container IP address using ifconfig, if you are outside of container you can use `docker inspect <CID> | grep IP` to find it
 
For conveniance add the container IP address to /etc/hosts at the host machine
Try logging in with `ssh root@containerIP`
 
the ip address is going to change if you restart you container!
 
if you restart container then you also need to run `service sshd restart`
 
remember about commands: docker ps, start, stop, run, inspect
 
May Docker be with you!