博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nomad安装
阅读量:6709 次
发布时间:2019-06-25

本文共 2988 字,大约阅读时间需要 9 分钟。

一、环境要求

操作系统版本:centos7.2操作系统内核:4.8.4系统工具:yum数据分区(200G容量以上):/data默认启用端口:4646、4647、4648

二、下载安装文件

wget https://releases.hashicorp.com/nomad/0.6.1/nomad_0.6.1_linux_amd64.zip

三、解压安装文件

unzip nomad_0.6.1_linux_amd64.zip -d /usr/bin

四、创建启动文件

vim /lib/systemd/system/nomad.service[Unit]Description=nomad[Service]ExecStart=/usr/bin/nomad agent -config /etc/nomadKillSignal=SIGTERM

五、创建配置文件

创建文件存放路径:mkdir /etc/nomad########################client节点##############################文件client.hcl#####client {  enabled = true  options {    "driver.raw_exec.enable" = "1"    "driver.exec.enable" = "1"    "driver.exec.java" = "1"    "docker.volumes.enabled" = "true"    "max_kill_timeout" = "30s"  }  meta {    "key" = "vaule"    "key2" = "vaule2" } } ####文件consul.hcl##### consul {  address = "consul主机IP地址:8500"  server_service_name = "nomad"  server_auto_join = true  client_service_name = "nomad-client"  client_auto_join = true  auto_advertise = true  token   = "consul的token"} ####文件nomad.hcl##### log_level = "INFO"data_dir = "/var/run/nomad"bind_addr = "0.0.0.0"leave_on_terminate = trueregion = "区域"datacenter = "数据中心名称"advertise {  http = "主机IP:4646"  rpc = "主机IP:4647"  serf = "主机IP:4648"}telemetry {  publish_allocation_metrics = true  publish_node_metrics       = true}########################master节点##############################文件client.hcl#####client {  enabled = true  options {    "driver.raw_exec.enable" = "1"    "driver.exec.enable" = "1"    "driver.exec.java" = "1"    "docker.volumes.enabled" = "true"    "max_kill_timeout" = "30s"  }  meta {    "key" = "vaule"    "key2" = "vaule2" } } ####文件consul.hcl##### consul {  address = "consul主机IP地址:8500"  server_service_name = "nomad"  server_auto_join = true  client_service_name = "nomad-client"  client_auto_join = true  auto_advertise = true  token   = "consul的token"} ####文件nomad.hcl##### log_level = "INFO"data_dir = "/var/run/nomad"bind_addr = "0.0.0.0"leave_on_terminate = trueregion = "区域"datacenter = "数据中心名称"advertise {  http = "主机IP:4646"  rpc = "主机IP:4647"  serf = "主机IP:4648"}telemetry {  publish_allocation_metrics = true  publish_node_metrics       = true}####文件server.hcl#####server {  enabled = true  bootstrap_expect = 3}

六、启动服务

systemctl start nomad查找Python  json格式:nomad run -output 
.nomad

七、日志配置

rm -rf /etc/rsyslog.d/nomad.confrm -rf /etc/logrotate.d/nomadecho ':programname, isequal, "nomad" /var/log/nomad.log' >> /etc/rsyslog.d/nomad.confecho '& ~' >> /etc/rsyslog.d/nomad.confecho '/var/log/nomad.log' >> /etc/logrotate.d/nomadecho '{' >> /etc/logrotate.d/nomadecho '    daily' >> /etc/logrotate.d/nomadecho '    rotate 7' >> /etc/logrotate.d/nomadecho '    missingok' >> /etc/logrotate.d/nomadecho '    dateext' >> /etc/logrotate.d/nomadecho '    copytruncate' >> /etc/logrotate.d/nomadecho '    compress' >> /etc/logrotate.d/nomadecho '}' >> /etc/logrotate.d/nomad重启服务/bin/systemctl restart nomad配置开机启动echo "/bin/systemctl start nomad" >> /etc/rc.local

转载于:https://blog.51cto.com/aaronsa/2064884

你可能感兴趣的文章
CodeForces 483C Diverse Permutation
查看>>
我的友情链接
查看>>
mrtg监控网络流量简单配置
查看>>
解决“连接U8数据库服务器失败”的方法尝试
查看>>
把oracle数据库恢复到某个时间点或者某个scn
查看>>
分组背包问题
查看>>
css的再深入4(更新中···)
查看>>
一道面试题
查看>>
大公司里怎样开发和部署前端代码?
查看>>
如何安装pycharm
查看>>
《Windows Internal》(2)
查看>>
数据监听进阶
查看>>
HTML5之Canvas绘图——图像切割函数clip
查看>>
五、箭头函数
查看>>
阿里Android开发规范:文件与数据库
查看>>
Android组件化专题 - 路由框架原理
查看>>
JQuery筛选器全系列介绍
查看>>
异步解决方案一:promise
查看>>
Clocksource tsc unstable
查看>>
两个sed小技巧:sed "/变量/变量/"
查看>>