You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sv...@apache.org on 2016/04/21 15:19:21 UTC

[1/4] brooklyn-docs git commit: Initial OSGi docs

Repository: brooklyn-docs
Updated Branches:
  refs/heads/master de490ed2e -> eb98ffd89


Initial OSGi docs


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/1533b0d7
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/1533b0d7
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/1533b0d7

Branch: refs/heads/master
Commit: 1533b0d72e7d6f79d49f01a651e576abf81b7951
Parents: 6f8c37b
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Mon Apr 11 12:23:34 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Mon Apr 11 12:23:34 2016 +0300

----------------------------------------------------------------------
 guide/index.md     |  1 +
 guide/misc/osgi.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/1533b0d7/guide/index.md
----------------------------------------------------------------------
diff --git a/guide/index.md b/guide/index.md
index cdb3b46..62c52c6 100644
--- a/guide/index.md
+++ b/guide/index.md
@@ -11,6 +11,7 @@ children:
 - { path: /guide/yaml/index.md }
 - { path: /guide/java/index.md }
 - { path: /guide/ops/index.md }
+- { path: /guide/misc/osgi.md }
 - { path: /guide/misc/index.md }
 ---
 

http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/1533b0d7/guide/misc/osgi.md
----------------------------------------------------------------------
diff --git a/guide/misc/osgi.md b/guide/misc/osgi.md
new file mode 100644
index 0000000..4c4f6c7
--- /dev/null
+++ b/guide/misc/osgi.md
@@ -0,0 +1,63 @@
+---
+title: FAQ
+layout: website-normal
+---
+
+# Running Apache Brooklin inside Karaf container
+
+The Apache Brooklyn Karaf based distribution lives in brooklyn-server/karaf/apache-brooklyn folder.
+
+## Building
+
+{% highlight bash %}
+cd brooklyn-server
+mvn clean install
+cd karaf/apache-brooklyn/target
+tar -zxvf apache-brooklyn-{{ site.brooklyn-version }}.tar.gz
+cd apache-brooklyn-{{ site.brooklyn-version }}
+{% endhighlight %}
+
+## Running
+
+Start the instance using the following command
+
+{% highlight bash %}
+bin/karaf
+{% endhighlight %}
+
+To start in debug mode use
+
+{% highlight bash %}
+bin/karaf debug
+{% endhighlight %}
+
+and connect to port 5005 using your debugger.
+
+To pause startup until the debugger is connected you can use
+
+{% highlight bash %}
+JAVA_DEBUG_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005' bin/karaf debug
+{% endhighlight %}
+
+## Configuring
+
+You can use the standard ~/.brooklyn/brooklyn.properties file to configure Brooklyn. Alternatively
+create etc/brooklyn.cfg inside the distribution folder (same file format). The keys in the former override
+those in the latter.
+
+Web console related configuration is done through the corresponding Karaf mechanisms:
+  * The port is set in etc/org.ops4j.pax.web.cfg, key org.osgi.service.http.port.
+  * For authentication the JAAS realm "webconsole" is used; by default it will use any
+    SecurityProvider implementations configured in Brooklyn falling back to auto generating
+    the password. To configure a custom JAAS realm see the jetty.xml file in "brooklyn-server/karaf/jetty-config/src/main/resources"
+    and override it by creating a custom one in "etc" folder. Point the "webconsole" login service
+    to the JAAS realm you would like to use.
+   * For other Jetty related configuration consult the Karaf and pax-web docs.
+
+
+## Caveats
+
+In the OSGi world specifying class names by string in Brooklyn's configuraiton will work only
+for classes living in Brooklyn's core modules. Raise an issue or ping us on IRC if you find
+a case where this doesn't work for you. For custom SecurityProvider implementations refer to the
+documentation of BrooklynLoginModule.


[4/4] brooklyn-docs git commit: Closes #44

Posted by sv...@apache.org.
Closes #44

Initial OSGi docs


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/eb98ffd8
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/eb98ffd8
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/eb98ffd8

Branch: refs/heads/master
Commit: eb98ffd899d8c69065e7bd63a10b352b0346b565
Parents: de490ed dcbbc56
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Thu Apr 21 14:19:11 2016 +0100
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Thu Apr 21 14:19:11 2016 +0100

----------------------------------------------------------------------
 guide/index.md     |   1 +
 guide/misc/osgi.md | 131 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 132 insertions(+)
----------------------------------------------------------------------



[3/4] brooklyn-docs git commit: Add documentation about how to control the catalog with Brooklyn in Karaf

Posted by sv...@apache.org.
Add documentation about how to control the catalog with Brooklyn in Karaf

Closes #46
Merging changes from https://github.com/apache/brooklyn-docs/pull/46


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/dcbbc566
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/dcbbc566
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/dcbbc566

Branch: refs/heads/master
Commit: dcbbc566899cd5a606f5cfdd863fcf6ab522b5c3
Parents: 9e1f1c1
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Thu Apr 21 14:18:27 2016 +0100
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Thu Apr 21 14:18:27 2016 +0100

----------------------------------------------------------------------
 guide/misc/osgi.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/dcbbc566/guide/misc/osgi.md
----------------------------------------------------------------------
diff --git a/guide/misc/osgi.md b/guide/misc/osgi.md
index 5482481..2af842e 100644
--- a/guide/misc/osgi.md
+++ b/guide/misc/osgi.md
@@ -71,9 +71,61 @@ Web console related configuration is done through the corresponding Karaf mechan
    * For other Jetty related configuration consult the Karaf and pax-web docs.
 
 
+## Catalog in Karaf
+
+
+With the traditional launcher, Brooklyn loads the initial contents of the catalog from a `default.catalog.bom` file
+as described in the section on [installation](/guide/ops/production-installation.html). Brooklyn finds Java 
+implementations to provide for certain things in blueprints (entities, enrichers etc.) by scanning the classpath. 
+
+In the OSGI world this approach is not used, as each bundle only has visibility of its own and its imported Java packages. 
+Instead, in Karaf, each bundle can declare its own `catalog.bom` file, in the root of the bundle,
+with the catalog declarations for any entities etc. that the bundle contains.
+
+For example, the `catalog.bom` file for Brooklyn's Webapp bundle looks like (abbreviated):
+
+    brooklyn.catalog:
+        version: ...
+        items:
+        - id: org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService
+          item:
+            type: org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService
+            name: Node.JS Application
+        ...
+        - id: resilient-bash-web-cluster-template
+          itemType: template
+          name: "Template: Resilient Load-Balanced Bash Web Cluster with Sensors"
+          description: |
+            Sample YAML to provision a cluster of the bash/python web server nodes,
+            with sensors configured, and a load balancer pointing at them,
+            and resilience policies for node replacement and scaling
+          item:
+            name: Resilient Load-Balanced Bash Web Cluster (Brooklyn Example)
+
+In the above YAML the first item declares that the bundle provides an entity whose type is
+`org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService`, and whose name is 'Node.JS Application'.  The second
+item declares that the bundle provides a template application, with id  `resilient-bash-web-cluster-template`, and
+includes a description for what this is.
+
+## Configuring the applications in the Catalog
+
+When running some particular deployment of Brooklyn it may not be desirable for the sample applications to appear in
+the catalog (for clarity, "application" here in the sense of an item with `itemType: template`).
+For example, if you have developed
+some bundle with your own application and added it to Karaf then you might want only your own application to appear in
+the catalog.
+
+Brooklyn contains a mechanism to allow you to configure what bundles will add their applications to the catalog.
+The Karaf configuration file `/etc/org.apache.brooklyn.core.catalog.bomscanner.cfg` contains two properties,
+one `whitelist` and the other `blacklist`, that bundles must satisfy for their applications to be added to the catalog.
+Each property value is a comma-separated list of regular expressions.  The symbolic id of the bundle must match one of
+the regular expressions on the whitelist, and not match any expression on the blacklist, if its applications
+are to be added to the bundle.  The default values of these properties are to admit all bundles, and forbid none.
+
 ## Caveats
 
 In the OSGi world specifying class names by string in Brooklyn's configuration will work only
 for classes living in Brooklyn's core modules. Raise an issue or ping us on IRC if you find
 a case where this doesn't work for you. For custom SecurityProvider implementations refer to the
 documentation of BrooklynLoginModule.
+


[2/4] brooklyn-docs git commit: Address review comments

Posted by sv...@apache.org.
Address review comments


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/9e1f1c14
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/9e1f1c14
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/9e1f1c14

Branch: refs/heads/master
Commit: 9e1f1c14611e61acd3504b904ea18009a1f840d0
Parents: 1533b0d
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Wed Apr 13 09:34:05 2016 +0300
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Wed Apr 13 09:51:20 2016 +0300

----------------------------------------------------------------------
 guide/misc/osgi.md | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/9e1f1c14/guide/misc/osgi.md
----------------------------------------------------------------------
diff --git a/guide/misc/osgi.md b/guide/misc/osgi.md
index 4c4f6c7..5482481 100644
--- a/guide/misc/osgi.md
+++ b/guide/misc/osgi.md
@@ -1,11 +1,13 @@
 ---
-title: FAQ
+title: OSGi Distribution
 layout: website-normal
 ---
 
-# Running Apache Brooklin inside Karaf container
+# Running Apache Brooklyn inside Karaf container
 
 The Apache Brooklyn Karaf based distribution lives in brooklyn-server/karaf/apache-brooklyn folder.
+It's still in a testing stage so some features might not work as expected. Do reach out if you
+find any problems.
 
 ## Building
 
@@ -25,6 +27,10 @@ Start the instance using the following command
 bin/karaf
 {% endhighlight %}
 
+This will launch the [Karaf console](https://karaf.apache.org/manual/latest/users-guide/console.html)
+where you can interact with the running instance. Note that Brooklyn has already started at this point
+and is reachable at the usual web console url.
+
 To start in debug mode use
 
 {% highlight bash %}
@@ -39,13 +45,23 @@ To pause startup until the debugger is connected you can use
 JAVA_DEBUG_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005' bin/karaf debug
 {% endhighlight %}
 
+The Karaf container will keep state like installed bundles and configuration between restarts.
+To reset any changes add **clean** to the cli arguments.
+
 ## Configuring
 
+To configure the Brooklyn runtime create an **etc/brooklyn.cfg** file, following the standard **brooklyn.properties**
+file format. Values can be viewed and managed dynamically via the OSGI configuration admin commands in Karaf,
+e.g. config:property-set. The global **~/.brooklyn/brooklyn.properties** is still supported and has higher
+priority for duplicate keys, but it's values can't be manipulated with the Karaf commands, so its use is
+discouraged.
+
 You can use the standard ~/.brooklyn/brooklyn.properties file to configure Brooklyn. Alternatively
 create etc/brooklyn.cfg inside the distribution folder (same file format). The keys in the former override
 those in the latter.
 
 Web console related configuration is done through the corresponding Karaf mechanisms:
+
   * The port is set in etc/org.ops4j.pax.web.cfg, key org.osgi.service.http.port.
   * For authentication the JAAS realm "webconsole" is used; by default it will use any
     SecurityProvider implementations configured in Brooklyn falling back to auto generating
@@ -57,7 +73,7 @@ Web console related configuration is done through the corresponding Karaf mechan
 
 ## Caveats
 
-In the OSGi world specifying class names by string in Brooklyn's configuraiton will work only
+In the OSGi world specifying class names by string in Brooklyn's configuration will work only
 for classes living in Brooklyn's core modules. Raise an issue or ping us on IRC if you find
 a case where this doesn't work for you. For custom SecurityProvider implementations refer to the
 documentation of BrooklynLoginModule.