Skip to content

Instantly share code, notes, and snippets.

@masato
masato / Dockerfile
Last active November 29, 2016 07:19
Docker SwarmのOverlayネットワークにAmbariでZeppelinをセットアップする ref: http://qiita.com/masato/items/ed06ec1541c7aa7159d6
FROM nginx
ADD default.conf /etc/nginx/conf.d/default.conf
{
"Blueprints": {
"stack_name": "HDP",
"stack_version": "2.3",
"blueprint_name": "zeppelin"
},
"host_groups": [
{
"name": "master_3",
"components": [
@masato
masato / file0.txt
Created December 31, 2015 01:21
IDCFクラウドのDebian Jessieにディスクを追加してDockerのディレクトリを移動する ref: http://qiita.com/masato/items/9ed5d4aa5d3995395c87
$ cat /etc/debian_version
8.2
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
@masato
masato / AmbariClient.groovy
Last active January 5, 2016 05:26
IDCFクラウドのDebian JessieでMulti-Host Docker Networking - Part 5: AmbariとZeppelinをDocker Swarmにセットアップ ref: http://qiita.com/masato/items/86f769e3bf11b9d9e80f
private static final String SLAVE = 'slave_'
def slaves = groups.findAll { it.name.toLowerCase().startsWith(SLAVE) }
if (slaves) {
int k = 0
for (int j = i; j < hostSize; j++) {
result[slaves[k].name] = result[slaves[k].name] ?: []
result[slaves[k].name] << hostNames[j]
result << [(slaves[k].name): result[slaves[k++].name]]
k = k == slaves.size ? 0 : k
@masato
masato / file0.txt
Last active December 27, 2015 18:17
Webhook as a ServiceでIoTのserverlessなバックエンド考える - Part 3: Webtask.ioでIDCFクラウド APIのセキュアな情報を扱う ref: http://qiita.com/masato/items/7a9fc2c9408fbb3ca5c0
$ export PARAMETERIZED_TOKEN=$(curl -s https://webtask.it.auth0.com/api/tokens/issue -H "Authorization: Bearer eyJhbxxx" \
-H "Content-Type: application/json" \
--data-binary '{"url":"http://bit.ly/1wT1DOi","ectx":{"secret":"abc!123"}}')
@masato
masato / Dockerfile
Last active December 26, 2015 18:54
Apache Zeppelinでデータ分析を分散処理する - Part 5: Ambari on DockerとsbtのScalaビルド環境 ref: http://qiita.com/masato/items/49c0d7911f3ba0baa340
FROM java:openjdk-7-jdk
MAINTAINER Masato Shimizu <ma6ato@gmail.com>
ENV SBT_VERSION 0.13.9
ENV PATH ${PATH}:/usr/local/sbt/bin
WORKDIR /app
RUN wget -O- http://dl.bintray.com/sbt/native-packages/sbt/$SBT_VERSION/sbt-$SBT_VERSION.tgz | tar xz -C /usr/local
@masato
masato / .webtask
Last active December 27, 2015 18:01
Webhook as a ServiceでIoTのserverlessなバックエンド考える - Part 2: Webtask.ioのHello world ref: http://qiita.com/masato/items/5689238a4d90cfd8a307
{
"default": {
"url": "https://webtask.it.auth0.com",
"container": "{アカウントのコンテナ名}",
"token": "{アカウントのwebtask token}"
}
}
@masato
masato / docker-compose.yml
Last active December 30, 2015 16:37
IDCFクラウドのDebian JessieでMulti-Host Docker Networking - Part 4: Couchbase Serverをスケールしてみる ref: http://qiita.com/masato/items/0be8b7da012f1180c281
proxy:
image: couchbase:enterprise
environment:
- constraint:node==minion-3
@masato
masato / docker-compose.yml
Last active December 30, 2015 16:37
IDCFクラウドのDebian JessieでMulti-Host Docker Networking - Part 3: OverlayネットワークとDocker SwarmとDocker ComposeでRethinkDBをスケールさせる ref: http://qiita.com/masato/items/bd3d50b31f16a00eac47
seed:
image: rethinkdb:2
ports:
- "8088:8080"
command: rethinkdb -n seed --bind all
worker:
image: rethinkdb:2
environment:
- "affinity:container!=rethink_worker_*"
@masato
masato / docker
Last active December 19, 2015 17:34
IDCFクラウドのDebian JessieでMulti-Host Docker Networking - Part 2: Docker Swarmクラスタの作成 ref: http://qiita.com/masato/items/a047798e48ccc1e56eb8
#DOCKER_OPTS="--cluster-store=consul://localhost:8500 --cluster-advertise=eth0:2376"
DOCKER_OPTS="--cluster-store=consul://localhost:8500 --cluster-advertise=eth0:2376 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock"