比较简单的集群搭建

一个server 三个client (单机) 参考代码 https://github.com/rongfengliang/nomad-cluster-demo

server 配置

# Increase log verbosity
log_level = "DEBUG" # Setup data dir 实际配置参考自己的配置路径,必须是绝对路径
data_dir = "/Users/dalong/mylearning/nomad-cluster/server/node1/data" # Enable the server
server {
enabled = true # Self-elect, should be 3 or 5 for production
bootstrap_expect = 1
}

客户端配置

三个

  • client1
# Increase log verbosity
log_level = "DEBUG" # Setup data dir
data_dir = "/Users/dalong/mylearning/nomad-cluster/client/client1" # Give the agent a unique name. Defaults to hostname
name = "client1" # Enable the client
client {
enabled = true # For demo assume we are talking to server1. For production,
# this should be like "nomad.service.consul:4647" and a system
# like Consul used for service discovery.
servers = ["127.0.0.1:4647"]
} # Modify our port to avoid a collision with server1
ports {
http = 5656
}
  • client2
# Increase log verbosity
log_level = "DEBUG" # Setup data dir
data_dir = "/Users/dalong/mylearning/nomad-cluster/client/client2" # Give the agent a unique name. Defaults to hostname
name = "client2" # Enable the client
client {
enabled = true # For demo assume we are talking to server1. For production,
# this should be like "nomad.service.consul:4647" and a system
# like Consul used for service discovery.
servers = ["127.0.0.1:4647"]
} # Modify our port to avoid a collision with server1
ports {
http = 5657
}
  • client3
# Increase log verbosity
log_level = "DEBUG" # Setup data dir
data_dir = "/Users/dalong/mylearning/nomad-cluster/client/client3" # Give the agent a unique name. Defaults to hostname
name = "client3" # Enable the client
client {
enabled = true # For demo assume we are talking to server1. For production,
# this should be like "nomad.service.consul:4647" and a system
# like Consul used for service discovery.
servers = ["127.0.0.1:4647"]
} # Modify our port to avoid a collision with server1
ports {
http = 5658
}

启动server && client

  • 启动consul

    测试,使用单

consul agent --dev
  • server
nomad agent -config server.hcl
  • client(1、2、3)
按照实际,进入目录进行启动
nomad agent -config client(1、2、3).hcl

参考界面

  • consul
  • nomad server

  • client

运行job

  • 生成参考代码
nomad  init 
  • 修改运行个数为5

    实际代码可以参考github

group "cache" {
count = 5
  • 运行
nomad run example.nomad
  • 参考界面

consul dns 测试

说明

实际环境中我们使用集群环境,同时结合coredns 可以实现一些比较强大的功能。

参考资料

https://www.nomadproject.io/intro/getting-started/cluster.html
https://github.com/rongfengliang/nomad-cluster-demo

 
 
 
 

nomad 集群搭建的更多相关文章

  1. 【Oracle 集群】Linux下Oracle RAC集群搭建之Oracle DataBase安装(八)

    Oracle 11G RAC数据库安装(八) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总 ...

  2. 【Oracle 集群】Linux下Oracle RAC集群搭建之基本测试与使用(九)

    Oracle 11G RAC数据库安装(九) 概述:写下本文档的初衷和动力,来源于上篇的<oracle基本操作手册>.oracle基本操作手册是作者研一假期对oracle基础知识学习的汇总 ...

  3. 【Data Cluster】真机环境下MySQL数据库集群搭建

    真机环境下MySQL-Cluster搭建文档  摘要:本年伊始阶段,由于实验室对不同数据库性能测试需求,才出现MySQL集群搭建.购置主机,交换机,双绞线等一系列准备工作就绪,也就开始集群搭建.起初笔 ...

  4. (四)Spark集群搭建-Java&Python版Spark

    Spark集群搭建 视频教程 1.优酷 2.YouTube 安装scala环境 下载地址http://www.scala-lang.org/download/ 上传scala-2.10.5.tgz到m ...

  5. (三)Spark-Hadoop集群搭建-Java&Python版Spark

    Spark-Hadoop集群搭建 视频教程: 1.优酷 2.YouTube 配置java 启动ftp [root@master ~]# /etc/init.d/vsftpd restart 关闭 vs ...

  6. Mosquitto搭建Android推送服务(三)Mosquitto集群搭建

    文章钢要: 1.进行双服务器搭建 2.进行多服务器搭建 一.Mosquitto的分布式集群部署 如果需要做并发量很大的时候就需要考虑做集群处理,但是我在查找资料的时候发现并不多,所以整理了一下,搭建简 ...

  7. Mongodb集群搭建的三种方式

    转自:http://blog.csdn.net/luonanqin/article/details/8497860 MongoDB是时下流行的NoSql数据库,它的存储方式是文档式存储,并不是Key- ...

  8. 分布式架构中一致性解决方案——Zookeeper集群搭建

    当我们的项目在不知不觉中做大了之后,各种问题就出来了,真jb头疼,比如性能,业务系统的并行计算的一致性协调问题,比如分布式架构的事务问题, 我们需要多台机器共同commit事务,经典的案例当然是银行转 ...

  9. 从零自学Hadoop(06):集群搭建

    阅读目录 序 集群搭建 监控 系列索引 本文版权归mephisto和博客园共有,欢迎转载,但须保留此段声明,并给出原文链接,谢谢合作. 文章是哥(mephisto)写的,SourceLink 序 上一 ...

随机推荐

  1. Python 在字符串中处理html 和xml

    问题: 想将HTML 或者XML 实体如&entity; 或&#code; 替换为对应的文本.再者,你需要转换文本中特定的字符(比如<, >, 或&). 解决方案: ...

  2. animation CSS3动画总结

    最近一个小游戏项目用到了CSS3的动画属性,例如transition.transform.animation.经过三个星期,终于做完了,利用周末好好梳理总结一下. keyframes这个属性用来定义一 ...

  3. HDU1087

    /*记忆化dfs+dp,因为每次最多走k步,所以上下左右的方向有所扩展, dp[i][j]存的是从dp[i][j]出发能吃的最大个数*/ #include<stdio.h> #includ ...

  4. 337BRoutine Problem

    /*给出你图片的长和宽的比例a:b 和摄像头的比例c:d,然后叫你求最后将图片放进摄像头 以后,剩余的面积比上摄像头的总面积,注意要化简为最简形式,而且摄像头要设置成至少一条边和图片相等 做法:先将两 ...

  5. 五,动态库(dll)的封装与使用

    在项目开发中,我们经常会使用到动态库(dll),要么是使用别人的动态库,要么是将功能函数封装为动态库给别人用.那么如何封装和使用动态库呢?以下内容为你讲解. 1.动态库的封装 以vs2010为例,我们 ...

  6. Sublime Text3编辑器简介

    Sublime Text3编辑器简介 下载地址 绿色中文版v3.3038下载地址:http://www.cncrk.com/downinfo/60832.html 官方网址(英文安装版)下载地址:ht ...

  7. 2017-2018-1 JaWorld 第六、七周作业

    2017-2018-1 JaWorld 第六.七周作业 修改需求规格说明书 上次的<需求规格说明书>初稿有哪些不足? 王译潇同学回答:   1. 引言和目的性考虑的不是很周全.   2. ...

  8. python常见容器属性和方法

    `````字符串中反斜杠字符表 转义格式    意义 \'  单引号(') \"  双引号(") \\  反斜杠(\ ) \n  换行 \r  返回光标至行首 \f  换页 \t ...

  9. hyper-v安装虚拟机ubuntu 18.04 64bit后无法使能增强模式怎么办

    1.获取脚本来使能增强模式 $ sudo apt-get update $ sudo apt install git $ git clone https://github.com/jterry75/x ...

  10. Mac OS 下安装 Vagrant

    Vagrant是一款用来构建虚拟开发环境的工具,它其实算是一个跨平台的虚拟机管理工具 1 安装 1.1 安装Vagrant 下载好pkg文件后,下一步安装即可 1.2 安装Virtualbox Vag ...