k8s遇坑:The connection to the server k8s-api.virtual.local:6443 was refused - did you specify the right host or port?

k8s坑The connection to the server localhost:8080 was refused - did you specify the right host or port
2019年01月08日 17:21:06 金柱 阅读数:47

定义一个mysql的RC文件:mysql-rc.yaml

apiVersion: v1
kind: ReplicationController
metadata:
  name: mysql
spec:
  replicas: 1
  selector:
    app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - name: mysql
        image: mysql
        ports:
        - containerPort: 3306
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "123456"

发布到k8s集群中

# kubectl create -f mysql-rc.yaml

    1
    2

报错:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

    1
    2

没有启动k8s集群或启动顺序不对,重新按一下顺序启动所有服务:

# systemctl start etcd
# systemctl start docker
# systemctl start kube-apiserver
# systemctl start kube-controller-manager
# systemctl start kube-scheduler
# systemctl start kubelet
# systemctl start kube-proxy

然后再发布mysql-rc.yaml就不报错了

原文地址:https://www.cnblogs.com/fuyuteng/p/10337354.html

时间: 2024-11-12 13:18:16

k8s遇坑:The connection to the server k8s-api.virtual.local:6443 was refused - did you specify the right host or port?的相关文章

The connection to the server localhost:8080 was refused - did you specify the right host or port?

解决方法:kube-apiserver启动失败,重启即可!!![root@master ~]# systemctl status kube-apiserver● kube-apiserver.service - Kubernetes API Server   Loaded: loaded (/usr/lib/systemd/system/kube-apiserver.service; enabled; vendor preset: disabled)   Active: failed (Resu

SpringCache实战遇坑

1. SpringCache实战遇坑 1.1. pom 主要是以下两个 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!-- 配合redis做缓存 --> <dependency> <groupId

MySQL导入数据提示Lost connection to MySQL server

数据库版本为Mariadb 5.5,使用K8S进行管理mysql -uroot -p xxxx < xxxxx.sql在本地提示ERROR 2013 (HY000) at line 1320: Lost connection to MySQL server during query 这个是因为mysql的max_allow_packet默认的只有16MB,我们在mysql的配置文件中添加一行max_allowed_packet=100M 或者修改pod下的args参数args: ["--c

虚拟机中MySQL连接问题:Lost connection to MySQL server at &#39;reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql

环境:在VirtualBox中安装了Ubuntu虚拟机,网络使用了NAT模式,开启了端口转发. 局域网内其他计算机访问虚拟机中的MySQL Server出现两个问题: Lost connection to MySQL server at 'reading initial communication packet, system error: 0 以及 host is not allowed to connect mysql 1.解决Lost connection to MySQL server

Lost connection to MySQL server at &#39;reading authorization packet&#39; 处理解决办法

Mysql Version : 5.1.73 Os Version : Centos 5.9 问题叙述: 今天一个php程序从客户端连接Mysql被监测到在偶尔的连接过程中报错,信息如下: Lost connection to MySQL server at 'reading authorization packet',看到这个错误提示,第一想到是客户端连接不上,服务端本地是否能连接.经验证,服务端本地是可以连接的,这就松了口气,一方面有很多任务是跑在Mysql服务端的,如果本地无法连接,会造成

MySQL存盘阻塞“Lost connection to MySQL server during query”

公测以来的两次全服维护,都遇到了个别服务器停服时间异常长的情况,具体表现为停服流程阻塞在MySQL存盘,待存储数据一直不减少,持续大概一个小时到两个小时之后继续存储,成功停服,并SQLError报错“Lost connection to MySQL server during query”. 这两天同事查询一些资料大致弄清了问题原因,我们服务器停服瞬间会像MySQL发送大量数据进行存储,数据量过大触发了MySQL的net_read_timeout超时,MySQL报错断开连接,而服务器这边无法直接

mysqldump导出报错&quot;mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `file_storage` at row: 29&quot;

今天mysql备份的crontab自动运行的时候,出现了报警,报警内容如下 mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `file_storage` at row: 29 mysqldump: Couldn't execute 'show table status like 'property'': MySQL server has gone away (2006)

Error NO.2013 Lost connection to Mysql server during query

系统:[[email protected] ~]# cat /etc/redhat-release CentOS release 6.3 (Final) DB版本:mysql> select @@version;+------------+| @@version  |+------------+| 5.6.26-log |+------------+ 数据中心部门申请线上数据库select权限,直接grant  select on DB.* to 'username'@'IP' identifi

Ionic App 启动时报Application Error - The connection to the server was unsuccessful

最近在更新App的时候,发现在华为手机上报这个错误,有点困惑,查找资料分析,大概原因是程序在加载index.html网页时,加载的资源过多,造成时间超时, 这个时原因分析https://stackoverflow.com/questions/12319809/application-error-the-connection-to-the-server-was-unsuccessful-file-andr 具体的解决方案是在config.xml文件中添加如下延时设置: <!--解决程序启动问题:A