00. virtualbox老是获取不到ip的问题

virtualbox作为本人首选的虚拟化应用软件,有时会遇到一些诡异的问题。

有一次在Mac上用桥接模式、无线网卡死活获取不到ip地址,但用网线就可以。

如果宿主机开了vpn,那么宿主机可能无法连接到虚机。如果想连接,可以断掉vpn,再连虚机,然后再连vpn,此时宿主机和虚机的已有连接可能不。。会。。断。。。

windows上的virtualbox和docker、VMware尽量不要共存,安装其中的一个最好。最近忘记这点了,先后安装了docker和VMware的客户端,然后virtualbox老是获取不到ip。

01. php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution. Please check if wacore is running: wacore:6252

用docker-compose部署WhatsApp Business API的时候报这个错误,是因为waweb找不到wacore的机器(无法解析wacore的主机名),需要增加hosts或者dns

02. 腾讯云容器和阿里云容器的nginx ingress的注解

阿里云kubernetes的ingress默认不会强制http到https跳转,如果需要跳转,则需要加上注解nginx.ingress.kubernetes.io/ssl-redirect: 'true'

而腾讯云kubernetes的ingress默认开启强制http到https跳转,如果不需要跳转,需要显示加上注解nginx.ingress.kubernetes.io/ssl-redirect: "false"

03. deployment添加hosts

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
      dnsPolicy: ClusterFirst
      nodeSelector:
        group: default
      restartPolicy: Always
      ...省略其他
      hostAliases:
        - ip: 10.149.30.13
          hostnames:
            - a.test.com
            - b.test.com

04. consul的health check错误

如果是i/o timeout,则一般是网络问题, agent 到consul的8500端口通,consul机器到agent的机器不通。

如果是connection refused,则agent端有问题。

下线掉其他agent,则用命令 curl -v -X PUT http://ip:8500/v1/agent/service/deregister/${id}

05. RabbitMQ的网络分区错误

Mnesia reports that this RabbitMQ cluster has experienced a network partition. There is a risk of losing data. Please read RabbitMQ documentation about network partitions and the possible solutions.

这个原因比较复杂,后边需要单独写篇文章。

06. nginx ingress webhook

admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: nginx.ingress.kubernetes.io/configuration-snippet annotation cannot be used. Snippet directives are disabled by the Ingress administrator

详情地址: https://github.com/kubernetes/ingress-nginx/pull/8221

07. nginx ingress开启png压缩

1
2
3
4
5
6
7
8
9
    nginx.ingress.kubernetes.io/server-snippet: |
      gzip on;
      gzip_vary on;
      gzip_proxied any;
      gzip_comp_level 6;
      gzip_buffers 16 8k;
      gzip_http_version 1.1;
      gzip_min_length 256;
      gzip_types application/atom+xml application/javascript application/x-javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component image/png;

08. SSH开启一个代理端口

1
ssh -D 10821 root@hostname -p 22 -NTC

然后Firefox设置里头开启代理配置就行,Firefox还支持使用 SOCKS v5 时代理 DNS 查询启用基于 HTTPS 的 DNS