尊龙凯时人生就是搏

ÉèÖÃLinuxϵͳÒÔÖ§³ÖÈÝÆ÷±àÅźÍÖÎÀí

ÉèÖÃlinuxϵͳÒÔÖ§³ÖÈÝÆ÷±àÅźÍÖÎÀí

Ëæ×ÅÈÝÆ÷ÊÖÒյĿìËÙÉú³¤ £¬ÈÝÆ÷±àÅźÍÖÎÀí³ÉΪÁËÏÖ´ú»¯ÔƶËÇéÐÎÖв»¿É»òȱµÄÒ»²¿·Ö¡£ÔÚLinuxϵͳÉÏ £¬ÎÒÃÇ¿ÉÒÔͨ¹ýһϵÁеÄÉèÖúÍ×°ÖÃÀ´Ö§³ÖÈÝÆ÷±àÅźÍÖÎÀí¹¤¾ß £¬ÈçKubernetesºÍDocker Swarm¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxϵͳÉÏÉèÖÃÕâЩ¹¤¾ß £¬²¢Ìṩ´úÂëʾÀý¡£

×°ÖÃDocker

DockerÊÇÒ»¸ö¿ªÔ´µÄÈÝÆ÷ÒýÇæ £¬Ëü¿ÉÒÔ×ÊÖúÎÒÃǹ¹½¨¡¢·â×°ºÍ·Ö·¢ÈÝÆ÷»¯µÄÓ¦Óá£ÏÂÃæÊÇÔÚLinuxϵͳÉÏ×°ÖÃDockerµÄ°ì·¨:

Ê×ÏÈ £¬¸üÐÂϵͳÈí¼þ°üÁбí £¬²¢×°ÖÃһЩÐëÒªµÄÈí¼þ°ü:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

µÇ¼ºó¸´ÖÆ

È»ºó £¬Ìí¼ÓDockerµÄ¹Ù·½GPGÃÜÔ¿ºÍ¿ÍÕ»:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

µÇ¼ºó¸´ÖÆ

½ÓÏÂÀ´ £¬ÔٴθüÐÂÈí¼þ°üÐÅÏ¢ £¬²¢×°ÖÃDocker:

sudo apt-get update
sudo apt-get install docker-ce

µÇ¼ºó¸´ÖÆ

×îºó £¬ÑéÖ¤DockerÊÇ·ñ×°ÖÃÀÖ³É:

sudo docker run hello-world

µÇ¼ºó¸´ÖÆ

×°ÖÃKubernetes

KubernetesÊÇÒ»¸ö¿ªÔ´µÄÈÝÆ÷±àÅźÍÖÎÀíƽ̨ £¬Ëü¿ÉÒÔ×ÊÖúÎÒÃÇÖÎÀí¶à¸öÈÝÆ÷»¯µÄÓ¦Óá£ÏÂÃæÊÇÔÚLinuxϵͳÉÏ×°ÖÃKubernetesµÄ°ì·¨:

Ê×ÏÈ £¬Ìí¼ÓKubernetesµÄ¹Ù·½GPGÃÜÔ¿:

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

µÇ¼ºó¸´ÖÆ

È»ºó £¬Ìí¼ÓKubernetesµÄ¹Ù·½APT¿ÍÕ»:

echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

µÇ¼ºó¸´ÖÆ

½ÓÏÂÀ´ £¬¸üÐÂÈí¼þ°üÁÐ±í²¢×°ÖÃKubernetes:

sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl

µÇ¼ºó¸´ÖÆ

×îºó £¬ÑéÖ¤KubernetesÊÇ·ñ×°ÖÃÀÖ³É:

kubectl version

µÇ¼ºó¸´ÖÆ

ÉèÖÃÈÝÆ÷±àÅźÍÖÎÀí

ÔÚLinuxϵͳÉÏ×°ÖÃÍêDockerºÍKubernetesºó £¬ÎÒÃÇÐèÒª¾ÙÐÐһЩÉèÖÃÒÔÖ§³ÖÈÝÆ÷±àÅźÍÖÎÀí¡£ÏÂÃæÊÇһЩ³£ÓõÄÉèÖð취:

Ê×ÏÈ £¬ÉèÖÃDockerÒÔʹÓÃKubernetesµÄÈÝÆ÷ÔËÐÐʱ¡£±à¼­/etc/docker/daemon.jsonÎļþ:

sudo nano /etc/docker/daemon.json

µÇ¼ºó¸´ÖÆ

ÔÚÎļþÖÐÌí¼ÓÒÔÏÂÄÚÈÝ:

{
    "exec-opts": ["native.cgroupdriver=systemd"]
}

µÇ¼ºó¸´ÖÆ

ÉúÑÄÎļþ²¢Í˳ö¡£

½ÓÏÂÀ´ £¬ÖØÐÂÆô¶¯DockerЧÀÍ:

sudo systemctl daemon-reload
sudo systemctl restart docker

µÇ¼ºó¸´ÖÆ

È»ºó £¬ÉèÖÃKubernetesµÄÍøÂç²å¼þ¡£ÔÚKubernetes¼¯ÈºÖÐʹÓõÄÍøÂç²å¼þÓÐÐí¶àÑ¡Ôñ £¬ÈçCalico¡¢FlannelºÍWeaveµÈ¡£ÕâÀïÒÔCalicoΪÀý £¬Í¨¹ýÔËÐÐÒÔÏÂÏÂÁîÀ´°²ÅÅCalicoÍøÂç²å¼þ:

kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml

µÇ¼ºó¸´ÖÆ

×îºó £¬³õʼ»¯Kubernetes¼¯Èº¡£ÔËÐÐÒÔÏÂÏÂÁîÀ´ÔÚÖ÷½ÚµãÉϳõʼ»¯¼¯Èº:

sudo kubeadm init --pod-network-cidr=192.168.0.0/16

µÇ¼ºó¸´ÖÆ

³õʼ»¯Íê³Éºó £¬½«Êä³öÖеĔkubeadm join”ÏÂÁÖÆ £¬²¢ÔÚÊÂÇé½ÚµãÉÏÖ´ÐÐÒÔ¼ÓÈ뼯Ⱥ¡£

ʹÓÃÈÝÆ÷±àÅźÍÖÎÀí

ÉèÖÃÍê³Éºó £¬ÎÒÃÇ¿ÉÒÔʹÓÃÈÝÆ÷±àÅźÍÖÎÀí¹¤¾ßÀ´½¨ÉèºÍÖÎÀíÈÝÆ÷»¯µÄÓ¦Óá£

¹ØÓÚKubernetes £¬ÎÒÃÇ¿ÉÒÔʹÓÃkubectlÏÂÁîÀ´½¨ÉèºÍÖÎÀíÓ¦Óá£ÒÔÏÂÊÇһЩ³£ÓõÄkubectlÏÂÁîʾÀý:

½¨ÉèÒ»¸ö°²ÅÅ:

kubectl create deployment nginx --image=nginx

µÇ¼ºó¸´ÖÆ

¼ì²é°²ÅÅ״̬:

kubectl get deployments

µÇ¼ºó¸´ÖÆ

À©ÈÝÓ¦ÓÃ:

kubectl scale deployments/nginx --replicas=3

µÇ¼ºó¸´ÖÆ

¹ØÓÚDocker Swarm £¬ÎÒÃÇ¿ÉÒÔʹÓÃdockerÏÂÁîÀ´½¨ÉèºÍÖÎÀíЧÀÍ¡£ÒÔÏÂÊÇһЩ³£ÓõÄdockerÏÂÁîʾÀý:

½¨ÉèÒ»¸öЧÀÍ:

docker service create --name nginx --replicas 3 nginx

µÇ¼ºó¸´ÖÆ

¼ì²éЧÀÍ״̬:

docker service ls

µÇ¼ºó¸´ÖÆ

À©ÈÝЧÀÍ:

docker service scale nginx=5

µÇ¼ºó¸´ÖÆ

×ܽá

ͨ¹ýÉèÖÃlinuxϵͳÒÔÖ§³ÖÈÝÆ÷±àÅźÍÖÎÀí £¬ÎÒÃÇ¿ÉÒÔ¸üºÃµØʹÓÃÈÝÆ÷ÊÖÒÕÀ´¹¹½¨¡¢·â×°ºÍ·Ö·¢Ó¦Óá£ÔÚ±¾ÎÄÖÐ £¬ÎÒÃÇÏÈÈÝÁËÔõÑù×°ÖÃDockerºÍKubernetes £¬²¢ÌṩÁËһЩ³£ÓõÄÏÂÁîʾÀý¡£Ï£ÍûÕâЩÐÅÏ¢¶ÔÄãÓÐËù×ÊÖú£¡

ÒÔÉϾÍÊÇÉèÖÃLinuxϵͳÒÔÖ§³ÖÈÝÆ÷±àÅźÍÖÎÀíµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是搏ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是搏ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ