安装Kubernetes遇到的问题

初次安装Kubernetes后,尝试nginx,服务启动成功,但是nginx不能访问,通过下面的命令查看日志:

journalctl -u kubelet -f

发现有:

Error syncing pod 39931f84-dd24-11e8-b766-000c294dd3a2, skipping: failed to “StartContainer” for “POD” with ImagePullBackOff: “Back-off pulling image \”registry.access.redhat.com/rhel7/pod-infrastructure:latest\”

应该是无法下载 pod-infrastructure:latest

手工执行命令:

docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest

报错:

open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory

看来是缺证书,执行如下两条命令,生成证书:

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm

rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv –to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem

再次执行命令:

docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest

成功。

Nginx访问自动恢复正常。

Windows hyper-v 开关命令

如果要关闭hyper-v,需要以下命令,然后重启(android studio的虚机需要)

bcdedit /set hypervisorlaunchtype off

如果要打开hyper-v,需要以下命令,然后重启(windows自带的hyper-v虚机需要)

bcdedit /set hypervisorlaunchtype auto

安装Linux版本的SQL Server

开放的态度让M$有了更多的想象空间,比如Linux版的Office和SQL Server。

下面介绍Linux下安装SQL Server的方法:

微软的安装资源库地址:https://packages.microsoft.com/config/rhel/7/

其中mssql-server-2017.repo 是安装包

prod.repo是工具包

curl https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo > /etc/yum.repos.d/mssql-server-2017.repo

然后

yum install -y mssql-server
/opt/mssql/bin/mssql-conf setup

安装工具:

curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-server-tools.repo
yum install mssql-tools
sqlcmd -S localhost -U SA

命令行(/opt/mssql-tools/bin/目录):

[root@souqu ~]# sqlcmd -S 127.0.0.1 -U sa
Password:
1>

 

I.DO