API 서버들을 최신 버전으로 업데이트하는 스크립트.
기존 스크립트와의 차이는 다음과 같다.
- 서버를 모두 새로 띄운다.
기존 스크립트는 서버를 한대씩 멈추고 업데이트한 다음, 다시 실행하는 방식으로 작동하였는데, 2~3대의 서버가 있을 때 한대를 내리게 되면 잠시나마 서비스에 상당한
zookeeper = require 'node-zookeeper-client' | |
client = zookeeper.createClient '__your__zookeeper__host__with:port__' | |
listChildren = (client, path) -> | |
client.getChildren( | |
path | |
(err, children, stat) -> | |
console.log err, children | |
) |
# upstart config | |
author "blmarket" | |
description "service-admin daemon upstart for ubuntu" | |
start on runlevel[2345] | |
stop on runlevel[!2345] | |
respawn # restart task if failed | |
respawn limit 5 20 # respawn up to 5 times if failed(with 20 sec of interval) |
// run this with sbt run | |
import org.apache.hadoop.hbase._ | |
import org.apache.hadoop.hbase.client._ | |
import org.apache.hadoop.hbase.util._ | |
import org.apache.hadoop.hbase.client.{HBaseAdmin,Scan,Result} | |
import org.apache.hadoop.hbase.mapreduce.{TableMapper,TableMapReduceUtil} | |
import org.apache.hadoop.hbase.HBaseConfiguration | |
import org.apache.hadoop.hbase.io.ImmutableBytesWritable |
import AssemblyKeys._ | |
assemblySettings | |
name := "HelloWorld" | |
version := "0.0.1" | |
scalaVersion := "2.9.2" |
request = require 'request' | |
url = 'http://localhost:4000' | |
i = 0 | |
sendRequest = (id) -> | |
request.get url, (err, res, body) -> | |
return console.log err if err | |
console.log "#{id} : #{res.statusCode}" |
util = require 'util' | |
hbase = require 'hbase' | |
inspect = (obj) -> util.inspect(obj, { colors: true, depth: null }) | |
debug = (err, res) -> console.log err? && err || inspect(res) | |
client = hbase { | |
host: '--some-host--' | |
port: --some-port-number-- | |
} |
import pango | |
from terminatorlib.util import dbg | |
import terminatorlib.plugin as plugin | |
# AVAILABLE must contain a list of all the classes that you want exposed | |
AVAILABLE = ['AutoFontSizePlugin'] | |
class Resizer: | |
def __init__(self, term): |
API 서버들을 최신 버전으로 업데이트하는 스크립트.
기존 스크립트와의 차이는 다음과 같다.
module.exports = (grunt) -> | |
grunt.initConfig { | |
pkg: grunt.file.readJSON('package.json') | |
coffee: { | |
compile: { | |
options: { | |
bare: false | |
} | |
files: { | |
'dist/app_nodep.js': 'app.coffee' |
module.exports = (grunt) -> | |
grunt.initConfig | |
pkg: grunt.file.readJSON 'package.json' | |
coffee: compile: | |
options: bare: true | |
files: 'dist/controller.js': './controller.coffee' | |
jade: compile: | |
options: pretty: true | |
files: 'dist/index.html': [ 'index.jade' ] |