This page (revision-37) was last changed on 23-Apr-2022 17:06 by Harry Metske

This page was created on 23-Apr-2022 17:06 by unknown

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
37 23-Apr-2022 17:06 19 KB Harry Metske to previous
36 23-Apr-2022 17:06 18 KB Harry Metske to previous | to last
35 23-Apr-2022 17:06 18 KB Harry Metske to previous | to last
34 23-Apr-2022 17:06 18 KB Harry Metske to previous | to last
33 23-Apr-2022 17:06 18 KB Harry Metske to previous | to last
32 23-Apr-2022 17:06 18 KB Harry Metske to previous | to last
31 23-Apr-2022 17:06 17 KB Harry Metske to previous | to last
30 23-Apr-2022 17:06 17 KB Harry Metske to previous | to last
29 23-Apr-2022 17:06 17 KB HarryMetske to previous | to last
28 23-Apr-2022 17:06 17 KB Harry Metske to previous | to last
27 23-Apr-2022 17:06 17 KB Harry Metske to previous | to last
26 23-Apr-2022 17:06 16 KB Harry Metske to previous | to last
25 23-Apr-2022 17:06 16 KB Harry Metske to previous | to last
24 23-Apr-2022 17:06 14 KB HarryMetske to previous | to last
23 23-Apr-2022 17:06 14 KB HarryMetske to previous | to last
22 23-Apr-2022 17:06 14 KB HarryMetske to previous | to last
21 23-Apr-2022 17:06 15 KB HarryMetske to previous | to last

Page References

Incoming links Outgoing links
Apache Brooklyn...nobody

Version management

Difference between version and

At line 21 removed one line
* [Apache Proposal|https://wiki.apache.org/incubator/BrooklynProposal]
At line 92 changed one line
Which basically is a copy of the previous excercise. Note that {{172.17.0.76}} is the IP address of the second Docker container {{node1}}.
Which basically is a copy of the previous excercise. Note that {{172.17.0.76}} is the IP address of the second Docker container {{brooklyn-node1}}.
At line 108 changed one line
First we change the Docker setup a little bit, we remove all existing containers and start a bunch of nodes and one brooklyn master:
First we change the Docker setup a little bit, we remove all existing containers and start 9 nodes and one brooklyn master:
At line 110 changed 6 lines
NUM_NODES=50
for N in `seq $NUM_NODES`
do
docker run -d --publish 220${N}:22 --publish 600${N}:6000 --hostname node${N} --name node${N} brooklyn-node
linkopts="$linkopts --link node${N}:node${N}"
done
docker run -d --publish 2201:22 --publish 6001:6000 --hostname brooklyn-node1 --name brooklyn-node1 brooklyn-node
docker run -d --publish 2202:22 --publish 6002:6000 --hostname brooklyn-node2 --name brooklyn-node2 brooklyn-node
docker run -d --publish 2203:22 --publish 6003:6000 --hostname brooklyn-node3 --name brooklyn-node3 brooklyn-node
docker run -d --publish 2204:22 --publish 6004:6000 --hostname brooklyn-node4 --name brooklyn-node4 brooklyn-node
docker run -d --publish 2205:22 --publish 6005:6000 --hostname brooklyn-node5 --name brooklyn-node5 brooklyn-node
docker run -d --publish 2206:22 --publish 6006:6000 --hostname brooklyn-node6 --name brooklyn-node6 brooklyn-node
docker run -d --publish 2207:22 --publish 6007:6000 --hostname brooklyn-node7 --name brooklyn-node7 brooklyn-node
docker run -d --publish 2208:22 --publish 6008:6000 --hostname brooklyn-node8 --name brooklyn-node8 brooklyn-node
docker run -d --publish 2209:22 --publish 6009:6000 --hostname brooklyn-node9 --name brooklyn-node9 brooklyn-node
At line 117 changed one line
docker run -d --publish 2200:22 --publish 18081:8081 --hostname brooklyn-master --name brooklyn-master $linkopts brooklyn
docker run -d --publish 2200:22 --publish 18081:8081 --hostname brooklyn-master --name brooklyn-master --link brooklyn-node1:brooklyn-node1 --link brooklyn-node2:brooklyn-node2 --link brooklyn-node3:brooklyn-node3 --link brooklyn-node4:brooklyn-node4 --link brooklyn-node5:brooklyn-node5 --link brooklyn-node6:brooklyn-node6 --link brooklyn-node7:brooklyn-node7 --link brooklyn-node8:brooklyn-node8 --link brooklyn-node9:brooklyn-node9 brooklyn
At line 141 changed one line
brooklyn.location.named.dockerpool=byon:(hosts="node{1-9}")
brooklyn.location.named.dockerpool=byon:(hosts="brooklyn-node{1-9}")
At line 249 removed 3 lines
If you deploy multiple applications to the same location, they will probably end up on the same host, this usually fails with "ssh: check-running MySqlNodeImpl".\\
Mind that you will get port conflicts when running multiple (the same) applications on the same location.
You can however run the exact same application (only different name, rest the same) to a different location pool.
At line 257 removed 46 lines
That is rather easy:
%%prettify
{{{
- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: MyTC8Cluster
initialSize: 1
location: GoogleEU
brooklyn.config:
memberSpec:
$brooklyn:entitySpec:
type: brooklyn.entity.webapp.tomcat.Tomcat8Server
install.version: 8.0.26
http.port: 8001
java.sysprops:
file.encoding: UTF-8
.....
}}}
%%
! Run in multiple docker containers on multiple hosts.
The problem with Docker containers is that you can run dozens of them on a docker host, but they are all behind one IP address, you have to do portmappings to get to a specific port in your container, and you get port conflicts if you want to access different containers on the same host on the same port.\\
In that case you would need multiple IP addresses.
Especially brooklyn expects hosts on the same location to be on a unique IP (you cannot define multiple hosts with the same IP but different ports).
That's why I want to see if the following setup works:
* run multiple containers on multiple docker hosts.
* each container is ssh-reachable on a unique host:port (host1:2201,host1:2202,host2:2201,host2:2202).
* each container on one host has unique docker port mappings for each port required for brooklyn (5000,6000,8000,more...)
* only the ssh port is mapped differently for each container
Probably unclear what I say here, so a concrete example setup :
[{Image src=docker-brooklyn.png width=600}]
The containers have to be started (on each docker host) as follows :
{{{
docker run -d --publish 2201:22 --publish 5001:5001 --publish 6001:6001 --publish 8001:8001 --publish 31001:31001 --hostname node01 --name node01 brooklyn-node
docker run -d --publish 2202:22 --publish 5002:5002 --publish 6002:6002 --publish 8002:8002 --publish 31002:31002 --hostname node02 --name node02 brooklyn-node
docker run -d --publish 2203:22 --publish 5003:5003 --publish 6003:6003 --publish 8003:8003 --publish 31003:31003 --hostname node03 --name node03 brooklyn-node
}}}
At line 309 changed one line
brooklyn.location.named.dockerpool=byon:(hosts="node{1-9}")
brooklyn.location.named.dockerpool=byon:(hosts="brooklyn-node{1-9}")
At line 312 removed 10 lines
! More valid location specifications
{{{
location:
multi:
targets:
- named:node1
- named:node2
- named:node3
}}}
At line 325 changed 118 lines
# If your VM or container is rebooted/restarted, all brooklyn services are not automagically started....(to be tested, but make sure the container keeps the same IP address after restart). If you apply an AutoScaler policy you will solve this problem less or more.
# You can remove an application by selecting it in the left pane, selecting "Advanced" in the right pane, and the choose "Expunge".
# If your VM or container is rebooted/restarted, all brooklyn services are not automagically started. You can overcome this by attaching a ServiceFailureDetector, see the following sample yaml:
%%prettify
{{{
name: tomcat8Cluster
services:
- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: MyTC8Cluster
initialSize: 1
location: dockerpool3
brooklyn.config:
memberSpec:
$brooklyn:entitySpec:
type: brooklyn.entity.webapp.tomcat.Tomcat8Server
install.version: 8.0.24
brooklyn.enrichers:
- type: brooklyn.policy.ha.ServiceFailureDetector
brooklyn.config:
# wait 15s after service fails before propagating failure
serviceFailedStabilizationDelay: 10s
brooklyn.policies:
- policyType: brooklyn.policy.ha.ServiceRestarter
brooklyn.config:
# repeated failures in a time window can cause the restarter to abort,
# propagating the failure; a time window of 0 will mean it always restarts!
failOnRecurringFailuresInThisDuration: 10000
wars.named:
- https://www.computerhok.nl/tmp/JSPWiki.war
shell.env:
LANG: en_US.UTF-8
jspwiki_pageProvider: VersioningFileProvider
jspwiki_fileSystemProvider_pageDir: jspwiki-pages
jspwiki_basicAttachmentProvider_storageDir: jspwiki-pages
jspwiki_workDir: jspwiki-work
jspwiki_baseURL: http://172.17.0.246:8000/JSPWiki
brooklyn.policies:
- policyType: brooklyn.policy.autoscaling.AutoScalerPolicy
brooklyn.config:
metric: $brooklyn:sensor("brooklyn.entity.webapp.DynamicWebAppCluster", "webapp.reqs.perSec.windowed.perNode")
metricLowerBound: 3
metricUpperBound: 5
minPoolSize: 1
maxPoolSize: 4
resizeDownIterationIncrement: 1
resizeUpIterationIncrement: 1
resizeUpStabilizationDelay: 50000
resizeDownStabilizationDelay: 70000
}}} %% \\This gives the following in the log when you kill a tomcat instance:
%%small
{{{
Setting BasicApplicationImpl{id=LXPJt6vs} on-fire due to problems when expected running, up=false, not-up-indicators: {service-lifecycle-indicators-from-children-and-members=ControlledDynamicWebAppClusterImpl{id=wH5RqQDc} is not up}
Setting ControlledDynamicWebAppClusterImpl{id=wH5RqQDc} on-fire due to problems when expected running, up=false, problems: {service-lifecycle-indicators-from-children-and-members=Required entities not healthy: DynamicWebAppClusterImpl{id=a3jJ2d2e}, Tomcat8ServerImpl{id=L47viE6N}}
ServiceRestarter acting on failure detected at Tomcat8ServerImpl{id=L47viE6N} (FailureDescriptor{component=Tomcat8ServerImpl{id=L47viE6N}, description=service not up})
}}} %%
!! todo / issues / questions
! How to speed up nginx install ?
Currently an nginx is compiled from source before it is run, takes a lot of cpu and time.
! How to clean up nodes ?
After deploying/expunging nginx a couple of time, I see this on the node:
{{{
brooklyn@node01:~/brooklyn-managed-processes/apps$ pwd;ls -l
/home/brooklyn/brooklyn-managed-processes/apps
total 16
drwxr-xr-x 3 brooklyn brooklyn 4096 Sep 2 15:36 EeUq9kLO
drwxr-xr-x 3 brooklyn brooklyn 4096 Sep 2 15:32 rTvwL65I
drwxr-xr-x 3 brooklyn brooklyn 4096 Sep 2 15:27 rgx1QQjw
drwxr-xr-x 3 brooklyn brooklyn 4096 Sep 2 15:37 vK404HjY
}}}
That should be cleaned away somehow...(cron ?)
! Can I autoscale based on response time ?
I can currently scale with the ''AutoScalerPolicy'' and (for example) the metric ''webapp.reqs.perSec.windowed.perNode''. \\
But this is not a good metric, we should have something like response time, either from tomcat or from nginx.
There is a metric: __webapp.reqs.processingTime.fraction.windowed.perNode__ : ''Fraction of time spent processing reported by webserver (percentage, over time window) averaged over all nodes''
! NullPointerException: jmx port must not be null for Tomcat8ServerImpl
When I run a ControlledDynamicWebAppCluster with tomcat8 servers and the cluster is adding an additional server, this exception shows up.
Th Tomcat8 instance is ON-FIRE then, when you look at the sensors, it is indeed missing jmx stuff :
__First tomcat__:
||Name || Value
|jmx.agent.local.path |/home/brooklyn/brooklyn-managed-processes/apps/hYUOMMsL/entities/Tomcat8Server_N5oEPFyY/brooklyn-jmxmp-agent-shaded-0.8.0-incubating.jar
|jmx.context |jmxrmi
|jmx.direct.port|31003
|jmx.service.url|service:jmx:jmxmp://10.0.0.162:31003
|rmi.registry.port |1099
__Second (failed) tomcat__:
||Name ||Value
|jmx.context|jmxrmi
|rmi.registry.port|19099
The problem is intermittent.
Reported: [https://issues.apache.org/jira/browse/BROOKLYN-170]
! Runtime environments require internet access.
When you fire up a tomcat or nginx server, it (by default) downloads all binaries from the internet.
You can "work around" this, by providing tar.gz's in ~~brooklyn/.brooklyn :
{{{
/home/brooklyn/.brooklyn/repository/NginxController/1.8.0/nginx-1.8.0.tar.gz
/home/brooklyn/.brooklyn/repository/Tomcat8Server/8.0.26/apache-tomcat-8.0.26.tar.gz
}}}
But still during install it is performing apt-get updates, which will only work if you have internet access, haven't tested what happens if you run into a blocking firewall.
# If your VM or container is rebooted/restarted, all brooklyn services are not automagically started....(to be tested, but make sure the container keeps the same IP address after restart). If you apply an AutoScaler policy you will solve this probleem less or more.