You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sj...@apache.org on 2015/07/14 12:46:11 UTC

[1/4] incubator-brooklyn git commit: Changes launch command to redirect nohup to /dev/null

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 076bf52ee -> 3e36892f7


Changes launch command to redirect nohup to /dev/null


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

Branch: refs/heads/master
Commit: 12d996dc5b9bc228e90737bed08843648b23433b
Parents: b2d3f33
Author: Martin Harris <gi...@nakomis.com>
Authored: Wed Jul 8 14:36:47 2015 +0100
Committer: Martin Harris <gi...@nakomis.com>
Committed: Wed Jul 8 14:36:47 2015 +0100

----------------------------------------------------------------------
 docs/guide/ops/launch.md | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/12d996dc/docs/guide/ops/launch.md
----------------------------------------------------------------------
diff --git a/docs/guide/ops/launch.md b/docs/guide/ops/launch.md
index 45d67bd..bdfa47d 100644
--- a/docs/guide/ops/launch.md
+++ b/docs/guide/ops/launch.md
@@ -8,12 +8,15 @@ layout: website-normal
 To launch Brooklyn, from the directory where Brooklyn is unpacked, run:
 
 {% highlight bash %}
-% nohup bin/brooklyn launch &
+% nohup bin/brooklyn launch > /dev/null 2&>1 &
 {% endhighlight %}
 
 With no configuration, this will launch the Brooklyn web console and REST API on [`http://localhost:8081/`](http://localhost:8081/).
 No password is set, but the server is listening only on the loopback network interface for security.
 Once [security is configured](brooklyn_properties.html), Brooklyn will listen on all network interfaces by default.
+By default, Brooklyn will write log messages at the INFO level or above to `brooklyn.info.log` and messgages at the
+DEBUG level or above to `brooklyn.debug.log`. Redirecting the output to `/dev/null` prevents the default console output
+being written to `nohup.out`.
 
 You may wish to [add Brooklyn to your path](#path-setup);
 assuming you've done this, to get information the supported CLI options 
@@ -195,4 +198,4 @@ nohup brooklyn launch --app brooklyn.demo.SingleWebServerExample --location loca
 {% endhighlight %}
 
 
-  
\ No newline at end of file
+  


[2/4] incubator-brooklyn git commit: This closes #739

Posted by sj...@apache.org.
This closes #739


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

Branch: refs/heads/master
Commit: e5e1adccad4326f13a99cb3d270a8aa5b4d94784
Parents: 076bf52 12d996d
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Tue Jul 14 11:24:48 2015 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Tue Jul 14 11:24:48 2015 +0100

----------------------------------------------------------------------
 docs/guide/ops/launch.md | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[4/4] incubator-brooklyn git commit: This closes #615

Posted by sj...@apache.org.
This closes #615


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

Branch: refs/heads/master
Commit: 3e36892f7e70be142156a8147b78effa0ef9a443
Parents: e5e1adc 3a80997
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Tue Jul 14 11:46:02 2015 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Tue Jul 14 11:46:02 2015 +0100

----------------------------------------------------------------------
 .../brooklyn/entity/nosql/riak/RiakNode.java    | 18 ++++++++--
 .../entity/nosql/riak/RiakNodeImpl.java         | 21 ++++++++++--
 .../entity/nosql/riak/RiakNodeSshDriver.java    | 17 ++++++++--
 .../nosql/riak/riak-cluster-with-solr.yaml      | 35 ++++++++++++++++++++
 .../brooklyn/entity/nosql/riak/riak.conf        |  2 +-
 5 files changed, 85 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[3/4] incubator-brooklyn git commit: Add Solr support

Posted by sj...@apache.org.
Add Solr support


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

Branch: refs/heads/master
Commit: 3a80997965e8f3eb10714a082e059731312b5d14
Parents: 076bf52
Author: Valentin Aitken <va...@cloudsoftcorp.com>
Authored: Tue May 12 02:17:02 2015 +0300
Committer: Valentin Aitken <va...@cloudsoftcorp.com>
Committed: Tue Jul 14 11:27:07 2015 +0100

----------------------------------------------------------------------
 .../brooklyn/entity/nosql/riak/RiakNode.java    | 18 ++++++++--
 .../entity/nosql/riak/RiakNodeImpl.java         | 21 ++++++++++--
 .../entity/nosql/riak/RiakNodeSshDriver.java    | 17 ++++++++--
 .../nosql/riak/riak-cluster-with-solr.yaml      | 35 ++++++++++++++++++++
 .../brooklyn/entity/nosql/riak/riak.conf        |  2 +-
 5 files changed, 85 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3a809979/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
index 1f29366..ae897ad 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNode.java
@@ -29,6 +29,7 @@ import brooklyn.entity.basic.Attributes;
 import brooklyn.entity.basic.ConfigKeys;
 import brooklyn.entity.basic.MethodEffector;
 import brooklyn.entity.basic.SoftwareProcess;
+import brooklyn.entity.java.UsesJava;
 import brooklyn.entity.proxying.ImplementedBy;
 import brooklyn.event.AttributeSensor;
 import brooklyn.event.basic.AttributeSensorAndConfigKey;
@@ -42,7 +43,7 @@ import com.google.common.reflect.TypeToken;
 @Catalog(name="Riak Node", description="Riak is a distributed NoSQL key-value data store that offers "
         + "extremely high availability, fault tolerance, operational simplicity and scalability.")
 @ImplementedBy(RiakNodeImpl.class)
-public interface RiakNode extends SoftwareProcess {
+public interface RiakNode extends SoftwareProcess, UsesJava {
 
     @SetFromFlag("version")
     ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION,
@@ -123,8 +124,17 @@ public interface RiakNode extends SoftwareProcess {
     PortAttributeSensorAndConfigKey EPMD_LISTENER_PORT = new PortAttributeSensorAndConfigKey("epmdListenerPort", "Erlang Port Mapper Daemon Listener Port", "4369");
     PortAttributeSensorAndConfigKey ERLANG_PORT_RANGE_START = new PortAttributeSensorAndConfigKey("erlangPortRangeStart", "Erlang Port Range Start", "6000+");
     PortAttributeSensorAndConfigKey ERLANG_PORT_RANGE_END = new PortAttributeSensorAndConfigKey("erlangPortRangeEnd", "Erlang Port Range End", "7999+");
-    PortAttributeSensorAndConfigKey SEARCH_SOLR_PORT = new PortAttributeSensorAndConfigKey("search.solr.port", "Solr port", "8093+");
-    PortAttributeSensorAndConfigKey SEARCH_SOLR_JMX_PORT = new PortAttributeSensorAndConfigKey("search.solr.jmx_port", "Solr port", "8985+");
+
+    @SetFromFlag("searchEnabled")
+    ConfigKey<Boolean> SEARCH_ENABLED = ConfigKeys.newBooleanConfigKey("riak.search", "Deploy Solr and configure Riak to use it", false);
+
+    /**
+     * http://docs.basho.com/riak/latest/dev/using/search/
+     * Solr is powered by Riak's Yokozuna engine and it is used through the riak webport
+     * So SEARCH_SOLR_PORT shouldn't be exposed
+     */
+    ConfigKey<Integer> SEARCH_SOLR_PORT = ConfigKeys.newIntegerConfigKey("search.solr.port", "Solr port", 8983);
+    ConfigKey<Integer> SEARCH_SOLR_JMX_PORT = ConfigKeys.newIntegerConfigKey("search.solr.jmx_port", "Solr port", 8985);
 
     AttributeSensor<Integer> NODE_GETS = Sensors.newIntegerSensor("riak.node.gets", "Gets in the last minute");
     AttributeSensor<Integer> NODE_GETS_TOTAL = Sensors.newIntegerSensor("riak.node.gets.total", "Total gets since node started");
@@ -182,6 +192,8 @@ public interface RiakNode extends SoftwareProcess {
 
     Integer getErlangPortRangeEnd();
 
+    Boolean isSearchEnabled();
+
     Integer getSearchSolrPort();
 
     Integer getSearchSolrJmxPort();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3a809979/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
index 590cb3a..7dda317 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeImpl.java
@@ -189,6 +189,7 @@ public class RiakNodeImpl extends SoftwareProcessImpl implements RiakNode {
         WebAppServiceMethods.connectWebAppServerPolicies(this);
     }
 
+    @Override
     public void disconnectSensors() {
         super.disconnectSensors();
         if (httpFeed != null) {
@@ -242,46 +243,62 @@ public class RiakNodeImpl extends SoftwareProcessImpl implements RiakNode {
         getDriver().recoverFailedNode(nodeName);
     }
 
+    @Override
     public Integer getRiakWebPort() {
         return getAttribute(RiakNode.RIAK_WEB_PORT);
     }
 
+    @Override
     public Integer getRiakPbPort() {
         return getAttribute(RiakNode.RIAK_PB_PORT);
     }
 
+    @Override
     public Integer getHandoffListenerPort() {
         return getAttribute(RiakNode.HANDOFF_LISTENER_PORT);
     }
 
+    @Override
     public Integer getEpmdListenerPort() {
         return getAttribute(RiakNode.EPMD_LISTENER_PORT);
     }
 
+    @Override
     public Integer getErlangPortRangeStart() {
         return getAttribute(RiakNode.ERLANG_PORT_RANGE_START);
     }
 
+    @Override
     public Integer getErlangPortRangeEnd() {
         return getAttribute(RiakNode.ERLANG_PORT_RANGE_END);
     }
 
+    @Override
+    public Boolean isSearchEnabled() {
+        return getConfig(RiakNode.SEARCH_ENABLED);
+    }
+
+    @Override
     public Integer getSearchSolrPort() {
-        return getAttribute(RiakNode.SEARCH_SOLR_PORT);
+        return getConfig(RiakNode.SEARCH_SOLR_PORT);
     }
 
+    @Override
     public Integer getSearchSolrJmxPort() {
-        return getAttribute(RiakNode.SEARCH_SOLR_JMX_PORT);
+        return getConfig(RiakNode.SEARCH_SOLR_JMX_PORT);
     }
 
+    @Override
     public String getMajorVersion() {
         return getFullVersion().substring(0, 3);
     }
 
+    @Override
     public String getFullVersion() {
         return getConfig(RiakNode.SUGGESTED_VERSION);
     }
 
+    @Override
     public String getOsMajorVersion() {
         return getDriver().getOsMajorVersion();
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3a809979/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
index 856c029..7ad15d7 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/riak/RiakNodeSshDriver.java
@@ -36,10 +36,10 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
+import brooklyn.entity.java.JavaSoftwareProcessSshDriver;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
 import brooklyn.entity.basic.Attributes;
 import brooklyn.entity.basic.Entities;
 import brooklyn.entity.basic.lifecycle.ScriptHelper;
@@ -61,7 +61,7 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 
 // TODO: Alter -env ERL_CRASH_DUMP path in vm.args
-public class RiakNodeSshDriver extends AbstractSoftwareProcessSshDriver implements RiakNodeDriver {
+public class RiakNodeSshDriver extends JavaSoftwareProcessSshDriver implements RiakNodeDriver {
 
     private static final Logger LOG = LoggerFactory.getLogger(RiakNodeSshDriver.class);
     private static final String sbinPath = "$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
@@ -72,6 +72,11 @@ public class RiakNodeSshDriver extends AbstractSoftwareProcessSshDriver implemen
     }
 
     @Override
+    protected String getLogFileLocation() {
+        return "/var/log/riak/solr.log";
+    }
+
+    @Override
     public RiakNodeImpl getEntity() {
         return RiakNodeImpl.class.cast(super.getEntity());
     }
@@ -558,6 +563,14 @@ public class RiakNodeSshDriver extends AbstractSoftwareProcessSshDriver implemen
         }
     }
 
+    @Override
+    public void setup() {
+        if(entity.getConfig(RiakNode.SEARCH_ENABLED)) {
+            // JavaSoftwareProcessSshDriver.setup() is called in order to install java
+            super.setup();
+        }
+    }
+
     private Boolean hasJoinedCluster() {
         return Boolean.TRUE.equals(entity.getAttribute(RiakNode.RIAK_NODE_HAS_JOINED_CLUSTER));
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3a809979/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak-cluster-with-solr.yaml
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak-cluster-with-solr.yaml b/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak-cluster-with-solr.yaml
new file mode 100644
index 0000000..93ef146
--- /dev/null
+++ b/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak-cluster-with-solr.yaml
@@ -0,0 +1,35 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+name: Cluster Riak & Solr
+location:
+  jclouds:aws-ec2:us-east-1:
+    osFamily: centos
+    osVersionRegex: 6\..*
+services:
+- type: brooklyn.entity.nosql.riak.RiakCluster
+  initialSize: 2
+  memberSpec:
+    $brooklyn:entitySpec:
+      type: brooklyn.entity.nosql.riak.RiakNode
+      searchEnabled: true
+  brooklyn.config:
+    provisioning.properties:
+      minCores: 2
+      minRam: 6gb
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3a809979/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak.conf
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak.conf b/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak.conf
index 1c96fc0..125fa77 100644
--- a/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak.conf
+++ b/software/nosql/src/main/resources/brooklyn/entity/nosql/riak/riak.conf
@@ -447,7 +447,7 @@ leveldb.maximum_memory.percent = 70
 ## 
 ## Acceptable values:
 ##   - on or off
-search = off
+search = ${entity.isSearchEnabled()?string('on','off')}
 
 ## How long Riak will wait for Solr to start. The start sequence
 ## will be tried twice. If both attempts timeout, then the Riak node