首页 > 其他分享 >主机ip6容器ip6以及应用ip6

主机ip6容器ip6以及应用ip6

时间:2022-11-22 23:35:56浏览次数:43  
标签:容器 mongo 主机 custom ip6 file ipv6 configuration

目录

启用 ip6

完全启用 ip6 配置并不简单

  1. 宿主机启用ip6

sysctl net.ipv6.bindv6only=0
sysctl net.ipv6.conf.default.forwarding=1
sysctl net.ipv6.conf.all.forwarding=1

  1. docker demond 启用ipv6
    Edit /etc/docker/daemon.json, set the ipv6 key to true and the fixed-cidr-v6 key to your IPv6 subnet. In this example we are setting it to 2001:db8:1::/64.

{
  "ipv6": true,
  "fixed-cidr-v6": "2001:db8:1::/64"
}

Save the file.
Reload the Docker configuration file.

$ systemctl reload docker
  1. 容器内的 应用 也必须启用ip6

mongo 应用默认 不支持ip6

导致外网 ip6 无法访问

Using a custom MongoDB configuration file
For a more complicated configuration setup, you can still use the MongoDB configuration file. mongod does not read a configuration file by default, so the --config option with the path to the configuration file needs to be specified. Create a custom configuration file and put it in the container by either creating a custom Dockerfile FROM mongo or mounting it from the host machine to the container. See the MongoDB manual for a full list of configuration file options.

For example, /my/custom/mongod.conf is the path to the custom configuration file. Then start the MongoDB container like the following:

$ docker run --name some-mongo -v /my/custom:/etc/mongo -d mongo --config /etc/mongo/mongod.conf

To bind to all IPv4 addresses, you can specify the bind ip address of 0.0.0.0. To bind to all IPv4 and IPv6 addresses, you can specify the bind ip address of ::,0.0.0.0 or alternatively, use the new net.bindIpAll setting or the new command-line option --bind_ip_all.

来聊聊把,共同进步
image

标签:容器,mongo,主机,custom,ip6,file,ipv6,configuration
From: https://www.cnblogs.com/ltgybyb/p/16916875.html

相关文章

  • C++语言vector容器介绍和示例
         之前我们在声明数组的时候,采用的是datatype array[len]的形式,数组在分配之后,不能调整大小,删除和插入数据时操作十分的繁琐,虽然可以采用链表,但是链表的操作更......
  • Serverless云服务的出现以及docker容器带来的变化
    Serverless云服务的出现以及docker容器带来的变化坚持原创,写好每一篇文章随着云服务的不断发展,很多公司都把自己的服务放在云上,通过云来管理各种服务。云服务的演进一......
  • 容器与容器编排系统
       Docker公司发明的「容器镜像」技术,创造性地解决了应用打包的难题。改变了一大批诸如容器编排、服务网格和云原生等技术,深刻影响了云计算领域的技术方向。一、Docke......
  • Docker 命令查看容器的IP地址
    查看Docker的底层信息​​docker​​ inspect会返回一个JSON文件记录着Docker容器的配置和状态信息#查看容器所有状态信息;dockerinspectNAMES #查看容器ip地......
  • 容器与容器编排系统
    Docker公司发明的「容器镜像」技术,创造性地解决了应用打包的难题。改变了一大批诸如容器编排、服务网格和云原生等技术,深刻影响了云计算领域的技术方向。一、Docker容器......
  • 云主机的作用是什么
    云主机的用途1、数据共享平台云主机越来越细分化,出现了不同的专业级别,例如数据、邮件、防御等在某领域突出的服务器。数据服务器就是其中一种。中小企业、专业......
  • Linux 主机意外重启原因
    查看主机是正常重启还是意外重启:last-x|head|tac正常reboot重启显示如下:rootpts/010.5.3.207TueNov2211:14-down(00:04)shutdownsy......
  • 虚拟机打不开,提示“此主机不支持虚拟化实际模式”的解决方法。
    文章目录​​1、安装/启动虚拟机失败​​​​2、获取视频教程​​​​3、版权声明​​1、安装/启动虚拟机失败在VMWare软件中,安装/启动虚拟机时,如果出以类似以下的错误提示:......
  • 利用容器创建多个线程
    利用容器创建thread对象数组,从而创建多个线程举例:#include<iostream>#include<vector>#include<algorithm>#include<thread>#include<mutex>usingnamespacestd;void......
  • aws 与 aliyun 容器集群升级调研
    https://help.aliyun.com/document_detail/86497.html#section-t4q-rgc-7daACK保障最近的三个Kubernetes子版本的稳定运行,同时支持最新版本往前两个子版本的升级功能。例......