求知 文章 文库 Lib 视频 iPerson 课程 认证 咨询 工具 讲座 Model Center   Code  
会员   
要资料
 
 
 

Kubernetes教程
Kubernetes概述
Kubernetes设计架构
kubernetes设计理念
创建Kubernetes集群
基于Docker本地运行Kubernetes
使用Vagrant
本地运行Kubrenetes v1.0
Google Computer Engine入门
AWS EC2快速入门
在Azure上使用CoreOS和Weave的 Kubernetes
从零开始k8s
CoreOS部署Kubernetes集群
CloudStack部署Kubernetes集群
vSphere部署Kubernetes集群
Ferdora部署Kubernetes集群
CentOS部署Kubernetes集群
Ubuntu物理节点上部署Kubernets集群
Mesos部署Kubernetes集群
Kubernetes用户指南:应用程序管理
名词解释 Pods
名词解释 Labels
名词解释:Namespace
名词解释 Replication Controller
名词解释:Node
名词解释:ReplicaSets
名词解释 Services
名词解释 Volumes
名词解释:PV/PVC/StorageClass
名称解释:Deployment
名词解释:Secret
名词解释:StatefulSet
名词解释:DaemonSet
名词解释:Service Account
名词解释:CronJob
名词解释:Job
名词解释:Security Context和PSP
名词解释:Resource Quotas
名词解释:Network Policy
名词解释:Ingress
名词解释:ThirdPartyResources
名词解释:ConfigMap
名词解释:PodPreset
配置Kubernetes
管理应用:部署持续运行的应用
Horizontal Pod Autoscaling
管理应用:连接应用
管理应用: 在生产环境中使用Pods和容器
Kubernetes UI
Kube-API Server
授权插件
认证插件
API Server端口配置
Admission Controller
Service Accounts集群管理指南
使用Kubernetes在云上原生部署cassandra
Spark例子
Storm 示例
示例: 分布式任务队列 Celery, RabbitMQ和Flower
Kubernetes在Hazelcast平台上部署原生云应用
Meteor on Kuberenetes
配置文件使用入门
环境向导示例
在Kubernetes上运行你的第一个容器
kubectl
安装和设置kubectl
kubectl annotate
kubectl api-versions
kubectl apply
kubectl attach
kubectl cluster-info
kubectl config
kubectl config set-cluster
kubectl config set-context
kubectl config set-credentials
kubectl config set
kubectl config unset
kubectl config use-context
kubectl config view
kubectl create
kubectl delete
kubectl describe
kubectl edit
kubectl exec
kubectl logs
kubectl version
故障排查
应用程序相关的故障排查
 
 

Storm 示例
 
1355 次浏览
59次  

接下来的例子中,你将会使用Kubernetes和Docker来创建一个多功能的Apache Storm集群。

你将会设置一个Apache ZooKeeper服务,一个Storm master服务(又名Nimbus主机),以及一个Storm工作者集合(又名监管者)。

资源

可以自由获取这些资源文件:

Docker镜像 – https://github.com/mattf/docker-storm

Docker受信的构建文件 – https://registry.hub.docker.com/search?q=mattf/storm

步骤零:前期准备

这个示例假设你已经安装运行了一个Kubernetes集群,环境路径下已经安装了kubectl命令行工具。请查看不同平台的安装说明开始。

步骤一:启动ZooKeeper服务

ZooKeeper是一个分布式协调者服务,Storm使用它来作为引导程序和存储运行转态数据。

使用这个examples/storm/zookeeper.json文件来创建一个运行ZooKeeper服务的pod。

$ kubectl create -f examples/storm/zookeeper.json

然后使用examples/storm/zookeeper-service.json文件创建一个逻辑服务终端节点用来给Storm访问ZooKeeper pod。

$ kubectl create -f examples/storm/zookeeper-service.json

在这之前,你需要确保ZooKeeper pod处于运行态并且可以被访问。

查看ZooKeeper是否运行

$ kubectl get pods
NAME         READY   STATUS   RESTARTS   AGE
zookeeper   1/1     Running    0           43s

查看ZooKeeper是否可以访问

步骤二:启动Nimbus服务

Nimbus服务是Storm集群的主节点(或者首要)服务。Nimbus依赖于多种功能的ZooKeeper服务。

使用examples/storm/storm-nimbus.json文件创建一个运行Nimbus服务的pod。

$ kubectl create -f examples/storm/storm-nimbus.json

然后使用examples/storm/storm-nimbus-service.json文件创建一个逻辑服务终端节点用来给Storm工作者访问Nimbus pod。

$ kubectl create -f examples/storm/storm-nimbus-service.json

确保Nimbus服务运行正常。

查看Nimbus节点是否运行以及可以访问

步骤三:启动Storm工作者

在Storm集群中,Storm工作者(或者监督者)用来完成繁重的工作。Nimbus服务管理这些运行流处理拓扑应用的工人。

Storm工作者需要保证ZooKeeper和Nimbus服务处于运行态。

使用examples/storm/storm-worker-controller.json文件来创建副本控制器来管理工作者pods。

$ kubectl create -f examples/storm/storm-worker-controller.json

查看工作者们是否在运行

一种查看工作者信息的方式是,通过ZooKeeper服务查看有多少客户端在运行。

$ echo stat | nc 10.254.139.141 2181; echo
Zookeeper version: 3.4.6--1, built on 10/23/2014 14:18 GMT
Clients:
/192.168.48.0:44187[0](queued=0,recved=1,sent=0)
/192.168.45.0:39568[1] (queued=0,recved=14072,sent=14072)
/192.168.86.1:57591[1](queued=0,recved=34,sent=34)
/192.168.8.0:50375[1](queued=0,recved=34,sent=34)
/192.168.45.0:39576[1](queued=0,recved=34,sent=34)

Latency min/avg/max: 0/2/2570
Received: 23199
Sent: 23198
Connections: 5
Outstanding: 0
Zxid: 0xa39
Mode: standalone
Node count: 13

Nimbus服务和每个工作者都对应着一个客户端。理想情况下,应该可以在副本控制器创建前后从ZooKeeper获取stat输出。

(欢迎提交pull requests使用不同的方式来验证workers)

tl;dr

kubectl create -f zookeeper.json

kubectl create -f zookeeper-service.json

确保ZooKeeper Pod正在运行(使用:kubectl get pods)。

kubectl create -f storm-nimbus.json

kubectl create -f storm-nimbus-service.json

确保Nimbus Pod正在运行。

kubectl create -f storm-worker-controller.json

 


您可以捐助,支持我们的公益事业。

1元 10元 50元





认证码: 验证码,看不清楚?请点击刷新验证码 必填



1355 次浏览
59次
 捐助