Skip to content

Instantly share code, notes, and snippets.

@murdoaird
murdoaird / info.log
Last active February 26, 2017 20:33
REST API info.log entry
2017-02-26 19:58:53,525 WARN 130 o.a.b.r.u.DefaultExceptionMapper [tp348897468-4990] REST call generated exception type class java.lang.NullPointerException unrecognized in class org.apache.brooklyn.rest.util.DefaultExceptionMapper (subsequent occurrences will be logged debug only): java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.brooklyn.core.config.Sanitizer.apply(Sanitizer.java:115)[120:org.apache.brooklyn.core:0.11.0.20170126_1332]
at org.apache.brooklyn.core.config.Sanitizer.sanitize(Sanitizer.java:100)[120:org.apache.brooklyn.core:0.11.0.20170126_1332]
at org.apache.brooklyn.core.config.Sanitizer.sanitize(Sanitizer.java:96)[120:org.apache.brooklyn.core:0.11.0.20170126_1332]
at org.apache.brooklyn.rest.resources.EffectorResource.invoke(EffectorResource.java:93)[130:org.apache.brooklyn.rest-resources:0.11.0.20170126_1332]
at sun.reflect.GeneratedMethodAccessor258.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:4
@murdoaird
murdoaird / streams.md
Last active February 26, 2017 19:54
ssh: effector DoStuff ssh call - STREAMS

Works

(calling Effector from web UI)

ENV:

STDIN:

mkdir -p '/tmp/brooklyn-murdoaird/apps/zjtchjskha/entities/EmptySoftwareProcess_mygmaft3gk' && cd '/tmp/brooklyn-murdoaird/apps/zjtchjskha/entities/EmptySoftwareProcess_mygmaft3gk' && whoami

STDOUT:

@murdoaird
murdoaird / info.log
Created February 26, 2017 19:47
Effector fails - info.log contents
2017-02-26 19:36:23,124 INFO 130 o.a.b.r.r.EffectorResource [tp348897468-3895] REST invocation of EmptySoftwareProcessImpl{id=mygmaft3gk}.DoStuff[] {=}
2017-02-26 19:36:23,158 WARN 120 o.a.b.u.c.t.s.ProcessTaskWrapper [ger-Gz6p7XOq-242] SSH task ended with exit code 1 when 0 was required, in Task[ssh: effector DoStuff ssh call]@jJ7nRaJ6: effector DoStuff ssh call (throwing)
2017-02-26 19:36:23,158 INFO 120 o.a.b.u.c.t.s.ProcessTaskWrapper [ger-Gz6p7XOq-242] STDERR for problem in Task[ssh: effector DoStuff ssh call]@jJ7nRaJ6:
/tmp/brooklyn-20170226-193623132-HuUc-effector_DoStuff_ssh_call.sh: line 3: export: `=': not a valid identifier
2017-02-26 19:36:23,159 INFO 120 o.a.b.u.c.t.s.ProcessTaskWrapper [ger-Gz6p7XOq-242] STDIN for problem in Task[ssh: effector DoStuff ssh call]@jJ7nRaJ6:
mkdir -p '/tmp/brooklyn-murdoaird/apps/zjtchjskha/entities/EmptySoftwareProcess_mygmaft3gk' && cd '/tmp/brooklyn-murdoaird/apps/zjtchjskha/entities/EmptySoftwareProcess_mygmaft3gk' && whoami
2017-02-26 19:36:23,159 WARN 12
@murdoaird
murdoaird / gist:df893bf3a3b0c560eea4
Created March 10, 2016 13:17
fix jekyll serve issue with nokogiri
gem install nokogiri -v '1.6.5' -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries
@murdoaird
murdoaird / CratePolicy.java
Last active February 19, 2016 19:10 — forked from nakomis/CratePolicy.java
Crate Policy
package com.acme.crate;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.brooklyn.api.entity.EntityLocal;
import org.apache.brooklyn.api.sensor.SensorEvent;
import org.apache.brooklyn.api.sensor.SensorEventListener;
import org.apache.brooklyn.core.entity.trait.Startable;
import org.apache.brooklyn.core.mgmt.internal.EffectorUtils;
@murdoaird
murdoaird / brooklyn.properties
Created January 7, 2016 09:39
brooklyn.properties
#
# 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
@murdoaird
murdoaird / Resilient Load-Balanced Bash Web Cluster.yaml
Last active January 22, 2016 20:29
Resilient Load-Balanced Bash Web Cluster
name: Resilient Load-Balanced Bash Web Cluster (Brooklyn Example)
# this final example shows some of the advanced functionality:
# defining custom sensors, and a cluster with a "spec",
# policies for resilience and scaling based on that sensor,
# and wiring a load balancer in front of the cluster
# combining this with the riak cluster in the previous example
# is left as a suggested exercise for the user
@murdoaird
murdoaird / Basic Enrichers.yaml
Last active January 27, 2016 11:53
Basic Enrichers
name: Bash Web Server and Riak Cluster (Brooklyn Example)
# this example *references* the previous one,
# combining it with a stock blueprint for a Riak cluster,
# and shows how a sensor from the latter can be injected
services:
# reference template 2, overriding message to point at riak
- type: 2-bash-web-server-template
@murdoaird
murdoaird / Web Server and Riak Cluster.yaml
Last active January 29, 2016 05:36
Web Server and Riak Cluster
name: Bash Web Server and Riak Cluster (Brooklyn Example)
# this example *references* the previous one,
# combining it with a stock blueprint for a Riak cluster,
# and shows how a sensor from the latter can be injected
services:
# reference template 2, overriding message to point at riak
- type: 2-bash-web-server-template
@murdoaird
murdoaird / catalog.yaml
Last active January 26, 2016 07:38
New Catalog Entity
brooklyn.catalog:
version: 1.0
id: my-sql
description: MySQL is a relational database.
item:
type: org.apache.brooklyn.entity.database.mysql.MySqlCluster
initialSize: 2
name: MySQL Node
location: byon