Centos7 and docker practices

Posted 我的空中楼阁

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos7 and docker practices相关的知识,希望对你有一定的参考价值。

1. Failed to get D-Bus connection: Operation not permitted error

when you execute the systemctl start sshd or start other service, maybe you will encounter this error. this is a bug for Centos7, it will be fixed in 7.2.

so now you can just use the full path like /usr/sbin/sshd & to start the service.

2.Could not load host key: /etc/ssh/ssh_host_ecdsa_key

    some key file maybe need manually generated.

After you install openssh-server, you should simplely config the sshd service.

permitRootlogin, and port 22 in /etc/ssh/sshd_config

ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key

3.start docker service and set it autostart after system start

sudo systemctl enable docker.service
start the docker service manully:
sudo systemctl start docker.service

4.

docker network create -d bridge hadoop

dk run --net=hadoop -h=nn1 --name=nn1 -v /nn1:/data -itd -p 50070:50070 -p 8081:8081 yaoshuya/hadoop-base
dk run --privileged --net=hadoop -h=nn2 --name=nn2 -v /nn2:/data -itd -p 50071:50070 -p 8082:8081 yaoshuya/hadoop-base 

5。基本思路

下载一个最新的CENTOS库,然后加载本地的APP目录到容器中,

把APP中的相关文件复制到容器中,如JDK,SCALASDK,SPARK,HADOOP,HIVE等软件,配置好并保存容器。

需要注意的是最好安装以下软件,

yum install –y which openssh-server

然后配置本机的无密钥访问。

这样基本HADOOP的容器就可以使用了,新的版本比较成熟,很多问题已经有很好的解决方案了。如网络问题。

以上是关于Centos7 and docker practices的主要内容,如果未能解决你的问题,请参考以下文章

spring boot hello and docker

k8s实践:ConfigMap and Secret

k8s实践:存储卷和数据持久化(Volumes and Persistent Storage)

DockerSegmentation Fault or Critical Error encountered. Dumping core and abort

k8s实践:Helm and Kubeapps UI

CentOS7离线安装Docker和卸载Docker步骤(亲测有效)