Closed fernandohackbart closed 7 years ago
zypper install -y java java-1_8_0-openjdk java-1_8_0-openjdk-devel
mkdir /opt/sbt/stage
cd /opt/sbt/stage
wget https://cocl.us/sbt01316tgz
tar xvzf sbt01316tg
mv sbt/* ..
mv /etc/inputrc /etc/inputrc-ignore
cat >> /root/.bash_profile <<EOF
export PATH=/opt/sbt/bin:\$PATH
EOF
docker run --name jenkins -d -p 8080:8080 -p 50000:50000 -v /opt/docker/jenkins/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
docker stop jenkins
docker start jenkins
docker pull sameersbn/bind
docker run --name bind -d --restart=always --network bikeride-network --ip 172.18.0.100 -p 53:53/tcp -p 53:53/udp -p 10000:10000/tcp --volume /opt/docker/bind:/data sameersbn/bind
docker stop bind
docker start bind
# docker inspect bind|grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",
cat /etc/resolv.conf
nameserver 172.17.0.2
nameserver 192.168.1.1
docker:/opt/docker/bind/bind # dig cassandra.bikeride.com @172.17.0.2
; <<>> DiG 9.10.4-P5 <<>> cassandra.bikeride.com @172.17.0.2
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47500
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;cassandra.bikeride.com. IN A
;; ANSWER SECTION:
cassandra.bikeride.com. 38400 IN A 172.18.0.3
;; AUTHORITY SECTION:
bikeride.com. 38400 IN NS c7cbd54d5f7e.
;; Query time: 0 msec
;; SERVER: 172.17.0.2#53(172.17.0.2)
;; WHEN: Sat Oct 07 07:50:38 CEST 2017
;; MSG SIZE rcvd: 93
To create
docker network ls
docker network create --driver bridge --subnet=172.18.0.0/16 bikeride-network
To remove
docker network rm bikeride-network
docker pull cassandra
docker run -d --name cassandra --network bikeride-network --ip 172.18.0.3 -p 9042:9042 -i cassandra
docker start cassandra
docker attach cassandra
docker stop cassandra
docker pull spotify/kafka
docker run -d --name kafka --network bikeride-network --ip 172.18.0.4 -p 9094:9094 -i spotify/kafka
docker start kafka
docker attach kafka
docker stop kafka
From ouside the host
docker run -it --name cassandra-cqlsh --rm cassandra sh -c 'exec cqlsh "192.168.1.200"'
From inside the host
docker run -it --name cassandra-cqlsh --link cassandra --network bikeride-network --ip 172.18.0.5 --rm cassandra sh -c 'exec cqlsh "172.18.0.3"'
select * from biker.bikers;
select * from biker.biker_email;
select * from track.tracks;
select * from track.trackwaypoints;
Using the hostname should work
docker:/opt/docker/bind/bind # docker run -it --name cassandra-cqlsh --link cassandra --network bikeride-network --ip 172.18.0.5 --rm cassandra sh -c 'exec cqlsh "cassandra.bikeride.com"'
Traceback (most recent call last):
File "/usr/bin/cqlsh.py", line 2428, in <module>
main(*read_options(sys.argv[1:], os.environ))
File "/usr/bin/cqlsh.py", line 2407, in main
encoding=options.encoding)
File "/usr/bin/cqlsh.py", line 479, in __init__
load_balancing_policy=WhiteListRoundRobinPolicy([self.hostname]),
File "/usr/share/cassandra/lib/cassandra-driver-internal-only-3.10.zip/cassandra-driver-3.10/cassandra/policies.py", line 417, in __init__
socket.gaierror: [Errno -2] Name or service not known
If needed to clean some brtfs volumes lost
docker:/var/lib/docker # btrfs subvolume delete btrfs/subvolumes/*
If need to inspect the network
docker network inspect bridge
docker network inspect bikeride-network
Install openSuSE
docker: 192.168.1.200
Install Docker package
zypper install -y Docker