博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
DC/OS虚拟网络
阅读量:5751 次
发布时间:2019-06-18

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

hot3.png

DC/OS enables virtual networking through the use of virtual networks. DC/OS virtual networks enable you to provide each container in the system with a unique IP address (“IP-per-container”) with isolation guarantees amongst subnets. DC/OS virtual networks offer the following advantages:

  • Both Mesos and Docker containers can communicate from within a single node and between nodes on a cluster.
  • Services can be created such that their traffic is isolated from other traffic coming from any other virtual network or host in the cluster.
  • They remove the need to worry about potentially overlapping ports in applications, or the need to use nonstandard ports for services to avoid overlapping.
  • You can generate any number of instances of a class of tasks and have them all listen on the same port so that clients don’t have to do port discovery.
  • You can run applications that require intra-cluster connectivity, like Cassandra, HDFS, and Riak.
  • You can create multiple virtual networks to isolate different portions of your organization, for instance, development, marketing, and production.

Note: Isolation guarantees among subnets depend on your CNI implementation and/or your firewall policies.

Using Virtual Networks

First, you or the data center operator needs to .

Virtual networks are configured at install time. You or the data center operator will specify a canonical name for each network in the config.yaml. When your service needs to launch a container, refer to it by that canonical name.

To use a virtual network in a Marathon app definition, specify the "network": "USER" property along with an ipAddress field in the form: {"ipAddress": {"network": "$MYNETWORK"}}. The value of $MYNETWORK is the canonical name of the network.

Example

The following Marathon application definition specifies a network named dcos-1, which refers to the target DC/OS virtual network of the same name.

{   "id":"my-networking",   "cmd":"env; ip -o addr; sleep 30",   "cpus":0.10,   "mem":64,   "instances":1,   "backoffFactor":1.14472988585,   "backoffSeconds":5,   "ipAddress":{      "networkName":"dcos-1"   },   "container":{      "type":"DOCKER",      "docker":{         "network":"USER",         "image":"busybox",         "portMappings":[            {               "containerPort":123,               "servicePort":80,               "name":"foo"            }         ]      }   }}

Copy

Learn more about ports and networking in .

转载于:https://my.oschina.net/u/2449787/blog/1629019

你可能感兴趣的文章
LVS+Keepalived高可用负载均衡集群架构
查看>>
烂泥:kvm安装windows系统蓝屏
查看>>
iPhone开发面试题--葵花宝典
查看>>
EdbMails Convert EDB to PST
查看>>
POJ 2184
查看>>
大话 程序猿 眼里的 接口
查看>>
struts2用了哪几种模式
查看>>
replace函数结合正则表达式实现转化成驼峰与转化成连接字符串的方法
查看>>
ubuntu 初学常用命令
查看>>
WCF客户端与服务端通信简单入门教程
查看>>
判断是否含有中文
查看>>
android 资源种类及使用
查看>>
Explorer程序出错
查看>>
修改系统时间 ubuntu
查看>>
Centos7同时运行多个Tomcat
查看>>
使用CocoaPods过程中的几个问题
查看>>
我的友情链接
查看>>
mysql数据类型---数值型---int
查看>>
为eclipse安装maven插件
查看>>
公司新年第一次全员大会小记
查看>>