Skip to content

Instantly share code, notes, and snippets.

View Mahito's full-sized avatar

Mahito Mahito

View GitHub Profile
sudo easy_install pip
pip install fabric
@Mahito
Mahito / cm_host_api.rb
Created April 18, 2014 04:58
CM5 sometimes response Internal server error when use /hosts API
# -*- coding: utf-8 -*-
require 'net/http'
require 'json'
def create_hosts
res = Net::HTTP.start('10.211.55.100', 7180) do | http |
req = Net::HTTP::Post.new("/api/v6/hosts")
req.basic_auth('admin', 'admin')
req.content_type = 'application/json'
@Mahito
Mahito / cloudera-scm-agent.log
Created May 8, 2014 00:34
cloudera-scm-agent error log
[08/May/2014 03:28:00 +0000] 17289 MainThread agent ERROR Failed to activate {u'refresh_files': [], u'config_generation': 0, u'auto_restart': False, u'running': True, u'required_tags': [u'cdh'], u'user': u'root', u'special_file_info': [], u'group': u'root', u'id': 451, u'status_links': {}, u'name': u'deploy-client-config', u'run_generation': 1, u'environment': {u'CDH_VERSION': u'5', u'PRIORITY': u'92', u'SERVICE_TYPE': u'YARN', u'ALT_NAME': u'hadoop-conf', u'ETC_DIR_NAME': u'/etc/hadoop', u'ZK_QUORUM': u'cdh1:2181,cdh2:2181,cdh3:2181', u'DIRECTORY_NAME': u'yarn-conf'}, u'optional_tags': [u'cdh-plugin', u'yarn-plugin', u'mapreduce2-plugin'], u'program': u'client/deploy-cc.sh', u'arguments': [u'yarn1-clientconfig.zip', u'conf.cloudera.yarn1'], u'parcels': {u'CDH': u'5.0.0-1.cdh5.0.0.p0.47'}, u'resources': [], u'one_off': True}
Traceback (most recent call last):
File "/usr/lib64/cmf/agent/src/cmf/agent.py", line 1062, in handle_heartbeat_response
new_process.activate()
File "/usr/lib64/cmf/agen
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
print '\n{0}:\n{1}'.format(field, res[field])
class CallbackModule(object):
@Mahito
Mahito / hadoop_spec.rb
Created August 12, 2014 08:13
Serverspec to xml file
require 'serverspec'
require 'nokogiri'
describe file('/etc/hadoop/hadoop-0.20.2/conf/mapred-site.xml') do
it { should be_file }
it do
doc = Nokogiri::Slop(subject.content)
doc.configuration.each do |property|
case property.name.content
when 'mapred.child.java.opts'
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
return self.func(req, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/oslo_middleware/base.py", line 114, in __call__
response = req.get_response(self.application)
File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1317, in send
@Mahito
Mahito / docker-compose.yml
Created March 30, 2017 08:38
RabbitMQ monitoring with Prometheus and Grafana
version: '2'
services:
rabbitmq:
image: rabbitmq:3.6.4-management
hostname: rabbitmq
expose:
- "9090"
ports:
- "4369:4369"
- "5671:5671"
version: '2'
services:
nginx:
image: nginx
ports:
- 80:80
depends_on:
- redmine
@Mahito
Mahito / docker-compose.yml
Created October 10, 2017 07:16
jaegertracing/all-in-one:latest
version: '2'
services:
jaeger_ui:
image: jaegertracing/all-in-one:latest
ports:
- 5775:5775/udp
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
@Mahito
Mahito / restaurant.md
Last active March 5, 2018 09:29
田町駅近辺の個室かつプロジェクタが使えそうなお店