Skip to content

Commit baa7204

Browse files
arun-guptaMano Marks
authored and
Mano Marks
committed
Updating to latest version of Docker Cloud and fixing an issue (docker#169)
* updating to the latest version of Docker Cloud * fixing docker#168
1 parent 4f3c21f commit baa7204

7 files changed

+75
-55
lines changed

developer-tools/java/chapters/ch08-cloud.adoc

+75-55
Original file line numberDiff line numberDiff line change
@@ -16,122 +16,142 @@ This chapter will show how to use TomEE Docker image and deploy it using Docker
1616

1717
=== Docker Cloud CLI
1818

19-
Install Docker Cloud CLI following the https://docs.docker.com/docker-cloud/tutorials/installing-cli/[instructions].
19+
Install Docker Cloud CLI following the https://docs.docker.com/docker-cloud/installing-cli/[instructions].
2020

2121
== Create new Docker Cloud Node
2222

2323
Create a new node cluster:
2424

2525
[source, text]
2626
----
27-
docker-cloud nodecluster create -t 1 --tag tomee tomee aws us-west-1 m3.large
27+
docker-cloud nodecluster create -t 1 --tag wildfly wildfly-node aws us-west-1 m3.large
2828
----
2929

30-
This node cluster has a single node (`-t 1`) and uses the tag "`couchbase`" (`--tag couchbase`). Last four parameters are nodecluster name (`couchbase-node`), provider (`aws`), region (`us-west-1`) and nodetype (`m3.large`).
30+
This node cluster has a single node (`-t 1`) and uses the tag "`wildfly`" (`--tag wildfly`). Last four parameters are nodecluster name (`couchbase-node`), provider (`aws`), region (`us-west-1`) and node type (`m3.large`).
3131

3232
Each node in this node cluster will be given the assigned tag. This will be used later to assign services to a specific node or node cluster.
3333

34-
Deploying a node can take up to 10 minutes.
34+
Deploying a node can take a few minutes. Current status can also be seen https://cloud.docker.com/app/arungupta/nodecluster/list/1?page_size=10[Docker Cloud dashboard]:
35+
36+
image::docker-cloud-nodecluster.png[]
3537

3638
== Create a new Docker Cloud Service
3739

3840
Create a Docker Cloud Service:
3941

4042
[source, text]
4143
----
42-
docker-cloud service create --tag tomee -p 8080:8080 tomee
43-
8d3572ae-ad9a-4092-afbc-2b99f26016bc
44+
docker-cloud service create --name wildfly --tag wildfly -p 8080:8080 jboss/wildfly
45+
124aa470-4e44-4f19-b0f0-d0c2616510a7
4446
----
4547

48+
https://cloud.docker.com/app/arungupta/service/list/1?name__icontains=wildfly&page=1&page_size=10[Docker Cloud dashboard] will look like:
49+
50+
image::docker-cloud-services.png[]
51+
4652
Start the Service:
4753

4854
[source, text]
4955
----
50-
docker-cloud service start 8d3572ae-ad9a-4092-afbc-2b99f26016bc
56+
docker-cloud service start 124aa470-4e44-4f19-b0f0-d0c2616510a7
5157
----
5258

5359
Check the service logs:
5460

5561
[source, text]
5662
----
57-
docker-cloud service logs 8d3572ae-ad9a-4092-afbc-2b99f26016bc
63+
docker-cloud service logs 124aa470-4e44-4f19-b0f0-d0c2616510a7
5864
----
5965

6066
It shows the output as:
6167

6268
[source, text]
6369
----
64-
tomee-4eb05078-1 | 2016-03-15T01:15:12.629119545Z INFO - Server version: Apache Tomcat (TomEE)/8.0.32 (7.0.0-M3)
65-
tomee-4eb05078-1 | 2016-03-15T01:15:12.629539055Z INFO - Server built: Feb 2 2016 19:34:53 UTC
66-
tomee-4eb05078-1 | 2016-03-15T01:15:12.629896543Z INFO - Server number: 8.0.32.0
67-
tomee-4eb05078-1 | 2016-03-15T01:15:12.630188415Z INFO - OS Name: Linux
68-
tomee-4eb05078-1 | 2016-03-15T01:15:12.630430719Z INFO - OS Version: 3.13.0-61-generic
69-
tomee-4eb05078-1 | 2016-03-15T01:15:12.630779071Z INFO - Architecture: amd64
70-
tomee-4eb05078-1 | 2016-03-15T01:15:12.631063161Z INFO - Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
70+
wildfly-1 | 2017-02-04T00:00:22.752881989Z =========================================================================
71+
wildfly-1 | 2017-02-04T00:00:22.752982683Z
72+
wildfly-1 | 2017-02-04T00:00:22.753058247Z JBoss Bootstrap Environment
73+
wildfly-1 | 2017-02-04T00:00:22.753149954Z
74+
wildfly-1 | 2017-02-04T00:00:22.753228180Z JBOSS_HOME: /opt/jboss/wildfly
75+
wildfly-1 | 2017-02-04T00:00:22.753313935Z
76+
wildfly-1 | 2017-02-04T00:00:22.753385039Z JAVA: /usr/lib/jvm/java/bin/java
77+
wildfly-1 | 2017-02-04T00:00:22.753537123Z
78+
wildfly-1 | 2017-02-04T00:00:22.753926931Z JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
7179
7280
. . .
7381
74-
tomee-4eb05078-1 | 2016-03-15T01:15:15.283837628Z INFO - Assembling app: /usr/local/tomee/webapps/docs
75-
tomee-4eb05078-1 | 2016-03-15T01:15:15.291932146Z INFO - Deployed Application(path=/usr/local/tomee/webapps/docs)
76-
tomee-4eb05078-1 | 2016-03-15T01:15:15.311051364Z INFO - At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
77-
tomee-4eb05078-1 | 2016-03-15T01:15:15.336165182Z INFO - Deployment of web application directory /usr/local/tomee/webapps/docs has finished in 76 ms
78-
tomee-4eb05078-1 | 2016-03-15T01:15:15.341409256Z INFO - Starting ProtocolHandler ["http-nio-8080"]
79-
tomee-4eb05078-1 | 2016-03-15T01:15:15.348118092Z INFO - Starting ProtocolHandler ["ajp-nio-8009"]
80-
tomee-4eb05078-1 | 2016-03-15T01:15:15.349340425Z INFO - Server startup in 1162 ms
82+
wildfly-1 | 2017-02-04T00:00:28.062486850Z 00:00:28,062 INFO [org.jboss.ws.common.management] (MSC service thread 1-2) JBWS022052: Starting JBossWS 5.1.5.Final (Apache CXF 3.1.6)
83+
wildfly-1 | 2017-02-04T00:00:28.360806943Z 00:00:28,359 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
84+
wildfly-1 | 2017-02-04T00:00:28.361466490Z 00:00:28,360 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
85+
wildfly-1 | 2017-02-04T00:00:28.362342136Z 00:00:28,361 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) started in 5505ms - Started 331 of 577 services (393 services are lazy, passive or on-demand)
8186
----
8287

83-
== Access Couchbase Server in Docker Cloud
88+
== Access WildFly Server in Docker Cloud
8489

8590
Inspect the Docker Cloud service for the exposed container ports:
8691

87-
[source, text]
88-
----
89-
docker-cloud service inspect 8d3572ae-ad9a-4092-afbc-2b99f26016bc | jq ".container_ports"
90-
----
92+
```
93+
docker-cloud service inspect 124aa470-4e44-4f19-b0f0-d0c2616510a7 | jq ".container_ports"
94+
```
9195

92-
To be more specific, exact URI for the http://tomee.apache.org/apache-tomee.html[TomEE] main page can be obtained as:
96+
This shows the output as:
9397

94-
[source, text]
95-
----
96-
docker-cloud service inspect 8d3572ae-ad9a-4092-afbc-2b99f26016bc | jq ".container_ports[0].endpoint_uri" | sed 's/tcp/http/g'
97-
"http://tomee-4eb05078.8d3572ae.svc.dockerapp.io:8080/"
98-
----
98+
```
99+
[
100+
{
101+
"protocol": "tcp",
102+
"outer_port": 8080,
103+
"inner_port": 8080,
104+
"port_name": "http-alt",
105+
"published": true,
106+
"endpoint_uri": "http://wildfly.124aa470.svc.dockerapp.io:8080/"
107+
}
108+
]
109+
```
99110

100-
Access the main page of TomEE at http://tomee-4eb05078.8d3572ae.svc.dockerapp.io:8080/ to see:
111+
Access the main page of TomEE at http://wildfly.124aa470.svc.dockerapp.io:8080/ to see:
101112

102-
image::docker-cloud-tomee-landing-page.png[]
113+
image::docker-cloud-wildfly.png[]
103114

104115
== Terminate the Docker Cloud Service and Node
105116

106-
Check the list of Docker Cloud services running:
117+
Check the list of Docker Cloud services running using the command `docker-cloud service ps`:
107118

108-
[source, text]
109-
----
110-
docker-cloud service ps
111-
NAME UUID STATUS #CONTAINERS IMAGE DEPLOYED PUBLIC DNS STACK
112-
tomee-4eb05078 8d3572ae ▶ Running 1 tomee:latest 4 minutes ago tomee-4eb05078.8d3572ae.svc.dockerapp.io
113-
----
119+
```
120+
NAME UUID STATUS #CONTAINERS IMAGE DEPLOYED PUBLIC DNS STACK
121+
wildfly 124aa470 ▶ Running 1 jboss/wildfly:latest 7 minutes ago wildfly.124aa470.svc.dockerapp.io
122+
```
114123

115-
Terminate the service:
124+
Use the UUID to terminate the service:
116125

117126
[source, text]
118127
----
119-
docker-cloud service terminate tomee-4eb05078
128+
docker-cloud service terminate 124aa470
120129
----
121130

122-
Check the list of nodes:
131+
Check the list of nodes using `docker-cloud node ls` command:
123132

124-
[source, text]
125-
----
126-
docker-cloud node ls
127-
UUID FQDN LASTSEEN STATUS CLUSTER DOCKER_VER
128-
31572d65 31572d65-5cca-4389-bc4d-4fd473f80b09.node.dockerapp.io 15 seconds ago ▶ Deployed tomee-cluster 1.9.1-cs2
129-
----
133+
```
134+
UUID FQDN LASTSEEN STATUS CLUSTER DOCKER_VER
135+
0240951d 0240951d-27b6-4295-8ff8-ea443d668765.node.dockerapp.io 28 seconds ago ▶ Deployed wildfly-node 1.11.2-cs5
136+
```
130137

131138
Terminate the node as:
132139

133-
[source, text]
134-
----
135-
docker-cloud node rm 31572d65
136-
----
140+
```
141+
docker-cloud node rm 0240951d
142+
```
143+
144+
Check the list of nodecluster using `docker-cloud nodecluster ls` command:
145+
146+
```
147+
NAME UUID REGION TYPE DEPLOYED STATUS CURRENT#NODES TARGET#NODES
148+
wildfly-node fb2f6292 us-west-1 m3.large 23 minutes ago Empty cluster 0 0
149+
```
150+
151+
Remove the nodecluster as:
152+
153+
```
154+
docker-cloud nodecluster rm wildfly-node
155+
```
156+
137157

Loading
Loading
Binary file not shown.
Loading

slides/docker-introduction.key

-1.19 KB
Binary file not shown.

slides/docker-introduction.pdf

13 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)