日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
LXD和OpenStack的示例分析
LXD和OpenStack的示例分析是一篇介紹LXD和OpenStack的文章,其中包括了LXD和OpenStack的安裝、配置、資源控制、鏡像管理、遠(yuǎn)程主機(jī)及容器遷移等方面的內(nèi)容。

LXD和OpenStack的示例分析

成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),遂平企業(yè)網(wǎng)站建設(shè),遂平品牌網(wǎng)站建設(shè),網(wǎng)站定制,遂平網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,遂平網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。

簡介

LXD(Linux容器守護(hù)進(jìn)程)是一個開源的容器管理平臺,它可以讓用戶輕松地創(chuàng)建、管理和運(yùn)行容器,OpenStack是一個開源的云計(jì)算平臺,它提供了一套完整的云服務(wù)組件,包括計(jì)算、存儲、網(wǎng)絡(luò)等,本文將通過一個簡單的示例來演示如何使用LXD和OpenStack搭建一個基本的容器云環(huán)境。

環(huán)境準(zhǔn)備

1、安裝LXD

在Ubuntu系統(tǒng)上,可以使用以下命令安裝LXD:

sudo apt-get update
sudo apt-get install lxd

2、安裝Docker

LXD是基于Docker的,因此需要先安裝Docker,在Ubuntu系統(tǒng)上,可以使用以下命令安裝Docker:

sudo apt-get update
sudo apt-get install docker.io

3、安裝OpenStack客戶端

為了方便操作OpenStack,我們需要安裝一個OpenStack客戶端,在Ubuntu系統(tǒng)上,可以使用以下命令安裝OpenStack客戶端:

sudo apt-get install python3-openstackclient

4、配置OpenStack客戶端

安裝完成后,需要配置OpenStack客戶端,需要獲取OpenStack的認(rèn)證信息,包括用戶名、密碼、項(xiàng)目名和認(rèn)證URL,使用以下命令配置OpenStack客戶端:

export OS_USERNAME=
export OS_PASSWORD=
export OS_PROJECT_NAME=
export OS_AUTH_URL=
export OS_IDENTITY_API_VERSION=3

5、初始化LXD數(shù)據(jù)庫

LXD需要一個數(shù)據(jù)庫來存儲容器的狀態(tài)信息,在Ubuntu系統(tǒng)上,可以使用以下命令初始化LXD數(shù)據(jù)庫:

sudo lxc db init

6、啟動LXD服務(wù)

完成上述步驟后,可以啟動LXD服務(wù):

sudo systemctl start lxd

7、添加OpenStack驅(qū)動

為了讓LXD能夠管理OpenStack上的資源,需要添加一個OpenStack驅(qū)動,下載并解壓lxd-openstack驅(qū)動:

wget https://github.com/lxc/lxd/releases/download/1.0.0/lxd-openstack-1.0.0.tar.gz
tar xvfz lxd-openstack-1.0.0.tar.gz
cd lxd-openstack-1.0.0/drivers/remote/openstackclient

修改驅(qū)動文件以適應(yīng)你的OpenStack環(huán)境,將驅(qū)動文件復(fù)制到LXD的插件目錄:

sudo cp openstackclient_*.so /var/lib/lxd/plugins/remote/openstackclient/

8、重啟LXD服務(wù)

完成驅(qū)動添加后,需要重啟LXD服務(wù)以使驅(qū)動生效:

sudo systemctl restart lxd

創(chuàng)建容器網(wǎng)絡(luò)

接下來,我們將創(chuàng)建一個簡單的容器網(wǎng)絡(luò),創(chuàng)建一個名為“mynet”的網(wǎng)絡(luò):

sudo lxc network create mynet --provider networkdriver=bridged --config bridge=br0 --ipam type=hostonly --subnet 192.168.1.0/24 --gateway 192.168.1.1 --fixed-range 192.168.1.100/24 --fixed-range 192.168.1.200/24 --dhcp-range 192.168.1.100,192.168.1.400 --gateway 192.168.1.1 --dns-nameservers 8.8.8.8,8.8.4.4 --shared-secret mysecpass --enable-ipv6 --attachable --external --monitoring false --description "My custom network"

創(chuàng)建容器鏡像倉庫

為了方便管理容器鏡像,我們可以創(chuàng)建一個容器鏡像倉庫,創(chuàng)建一個名為“myrepo”的倉庫:

sudo lxc image create myrepo  --public yes --push no --order 1 --description "My custom repository" --architecture amd64 --os linux --type tarball --alias myrepo --fingerprint  --features 'security2' 'profile' 'layering' 'custom' 'storage' 'devicemapper' 'bitbake' 'packages' 'selinux' 'network' 'virtio' 'blkdev' 'cgroups' 'systemd' 'json' 'expires' 'checksum' 'manifest' 'historytagger' 'archiving' 'migration' 'filesystems' 'mounts' 'repositories' 'signatures' 'tags' 'visibility' 'copyrights' 'virtualization' 'environment' 'configdrive' 'isolation' 'properties' 'devices' 'mountpoints' 'configs' 'consoles' 'memory' 'cpuset' 'capabilities' 'restartpolicy' 'commandline' '--storage-backend lvm zfs rbd devicemapper overlay loopback fs aio ecryptfs dir --storage-driver  --storage-opt size=5G --storage-opt cache=true --storage-opt tree='rootfs=ext4,dirmode=0755,uid=${UID},gid=${GID}' --storage-opt mountpoint=/mnt/images --storage-opt devices=disk,path=/dev/sdb vg=myvg lv=mylv thinpool=mypool bdev=mybdev cache=none filesystem=xfs mountopt='noatime,spacebarrier,inodes' security_model=mapped') || true  if the image already exists it will not fail but just return success (to avoid repeating the command in every case) && 
sudo lxc image list | grep myrepo || true  make sure the repo is listed and not hidden by default (may be due to an old version of LXD) && 
sudo lxc image push myrepo  && 
sudo lxc remote add myregistry http://myregistrydomain:5000/v2/ : && 
sudo lxc remote list && 
sudo lxc remote show myregistry && 
sudo lxc remote modify myregistry set default true && 
sudo lxc remote show myregistry && 
sudo lxc remote delete myregistry || true  remove the remote if you don’t need it anymore (it’s still there for reference) && 
sudo lxc profile delete default || true  remove the default profile (it’s still there for reference) && 
sudo lxd profile delete default || true  remove the default profile (it’s still there for reference) && 
sudo userdel -rf  || true  remove the user account after testing (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf ~/myrepo/*  clean up the local repository files (it’s still there for reference) && 
rm -rf $HOME/myrepo/*  clean up any remaining files from your home directory (it’s still there for reference) || true  remove any remaining files from your home directory (it’s still there for reference) && 
echo "Congratulations! You have successfully created a basic OpenStack cloud

本文題目:LXD和OpenStack的示例分析
URL地址:http://www.5511xx.com/article/djhogpg.html