Skip to content

Instantly share code, notes, and snippets.

vagrant@hystrix-go:/go/src/github.com/afex/hystrix-go$ time while ./gokit_bugreport; do :; done
priming with 40 successful requests
switching to errors...
now the next few requests should give us our error: kaboom
got expected error 1
got expected error 2
the circuit should have opened by now
hystrix-go: opening circuit my-endpoint
got expected error: hystrix: circuit open
got expected error: hystrix: circuit open
@afex
afex / gist:9e8c6516e6efa6e9d7fd
Created February 12, 2015 18:04
example hystrix-go panic
package main
import (
"log"
"github.com/afex/hystrix-go/hystrix"
)
func main() {
result := make(chan int)
errors := hystrix.Go("", func() error {
proxy
Started by user anonymous
[EnvInject] - Loading node environment variables.
Building on master in workspace /root/.jenkins/jobs/test-envinject/workspace
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties content
HTTP_PROXY=http://host:port/
[EnvInject] - Variables injected successfully.
org.kohsuke.stapler.export.NotExportableException: class org.jenkinsci.plugins.envinject.EnvInjectBuilderContributionAction doesn't have @ExportedBean so cannot write hudson.model.Actionable.actions
at org.kohsuke.stapler.export.Model.<init>(Model.java:73)
at org.kohsuke.stapler.export.ModelBuilder.get(ModelBuilder.java:51)
at org.kohsuke.stapler.export.Property.writeValue(Property.java:231)
at org.kohsuke.stapler.export.Property.writeValue(Property.java:187)
at org.kohsuke.stapler.export.Property.writeValue(Property.java:139)
at org.kohsuke.stapler.export.Property.writeTo(Property.java:116)
at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:190)
at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
at org.kohsuke.stapler.export.Model.writeNestedObjectTo(Model.java:185)
@afex
afex / gist:46c1d9b614fa0ed6a8f3
Last active August 29, 2015 14:05
apiserver status
[root@kubernetes-master ~]# systemctl status apiserver
apiserver.service - Kubernetes API Server
Loaded: loaded (/usr/lib/systemd/system/apiserver.service; enabled)
Active: active (running) since Fri 2014-08-08 20:50:17 UTC; 3min 34s ago
Docs: https://github.com/GoogleCloudPlatform/kubernetes
Main PID: 25059 (apiserver)
CGroup: /system.slice/apiserver.service
└─25059 /usr/local/bin/apiserver -address=10.245.1.2 -machines 10.245.2.2,10.245.2.3 -etcd_servers=http://10.245.1.2:4001 -minion_regexp kubernetes-minion.*
Aug 08 20:52:52 kubernetes-master apiserver[25059]: E0808 20:52:52.005607 25059 etcd_tools.go:358] etcd.Watch stopped unexpectedly: 501: All the given peers are not reachable (Tried to connect to each peer twice and failed) [0] (&etcd.EtcdError{ErrorCode:501, Message:"All the given peers are not reachable", Cause:"Tried to connect to each peer twice and fai...
@afex
afex / gist:dcc5b1019f019e41b2f7
Created August 8, 2014 20:52
vagrant provision
Keiths-iMac:kubernetes kthornhill$ vagrant provision
==> master: Running provisioner: shell...
master: Running: inline script
==> master: Building release
==> master: /vagrant /home/vagrant
==> master: Building release tree
==> master: /vagrant /vagrant
==> master: /vagrant
==> master: Packaging release
==> master: /home/vagrant
@afex
afex / gist:676e5811ab54f203cfee
Created August 7, 2014 00:45
from minion VM
# localhost
[root@kubernetes-minion-1 ~]# curl --verbose -X PUT 127.0.0.1:4001/v2/keys/afex -d value=Hi
* About to connect() to 127.0.0.1 port 4001 (#0)
* Trying 127.0.0.1...
* Adding handle: conn: 0xe4fd60
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xe4fd60) send_pipe: 1, recv_pipe: 0
Aug 06 23:42:44 kubernetes-master systemd[1]: Starting Kubernetes API Server...
Aug 06 23:42:44 kubernetes-master systemd[1]: Started Kubernetes API Server.
Aug 06 23:42:44 kubernetes-master apiserver[12831]: I0806 23:42:44.924674 12831 apiserver.go:85] No cloud provider specified.
Aug 06 23:44:52 kubernetes-master apiserver[12831]: E0806 23:44:52.194717 12831 healthy_minion_registry.go:54] 10.245.2.2 failed health check with error: Get http://10.245.2.2:10250/healthz: dial tcp 10.245.2.2:10250: connection timed out
Aug 06 23:46:59 kubernetes-master apiserver[12831]: E0806 23:46:59.416683 12831 healthy_minion_registry.go:54] 10.245.2.3 failed health check with error: Get http://10.245.2.3:10250/healthz: dial tcp 10.245.2.3:10250: connection timed out
Aug 06 23:47:13 kubernetes-master apiserver[12831]: I0806 23:47:13.066554 12831 log.go:135] GET /api/v1beta1/replicationControllers?labels=: (33.892519ms) 200
Aug 06 23:47:22 kubernetes-master apiserver[12831]: I0806 23:47:22.169477 12831 log.go:135] GET /api/v1b
Aug 06 23:42:13 kubernetes-master systemd[1]: Starting etcd...
Aug 06 23:42:13 kubernetes-master systemd[1]: Started etcd.
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.820 INFO | kubernetes-master is starting a new cluster
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.823 INFO | etcd server [name kubernetes-master, listen on 0.0.0.0:4001, advertised url http://127.0.0.1:4001]
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.823 INFO | peer server [name kubernetes-master, listen on :7001, advertised url http://kubernetes-master:7001]
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.823 INFO | kubernetes-master starting in peer mode
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.824 INFO | kubernetes-master: state changed from 'initialized' to 'follower'.
Aug 06 23:42:13 kubernetes-master etcd[4291]: [etcd] Aug 6 23:42:13.824 INFO | kubernetes-master: state changed from 'fo
drwxr-xr-x. 2 root root 4096 Dec 20 2013 anaconda
drwxr-x---. 2 root root 4096 Dec 20 2013 audit
-rw-r--r-- 1 root root 6588 Aug 6 22:13 boot.log
-rw-------. 1 root utmp 0 Dec 20 2013 btmp
drwxr-sr-x+ 3 root systemd-journal 4096 Dec 20 2013 journal
-rw-r--r--. 1 root root 292000 Aug 6 22:35 lastlog
drwx------ 2 nginx nginx 4096 Aug 6 22:20 nginx
drwx------. 2 root root 4096 Aug 1 2013 ppp
-rw-r--r--. 1 root root 1040 Dec 5 2013 README
drwx------ 2 root root 4096 Aug 6 22:15 salt