1.Ubuntu16.04使用devstack安装openstack的master分支

1 更新Ubuntu的源为国内的阿里源

1.1 备份原来的源文件

cd /etc/apt/
sudo cp sources.list sources.list.bak

就是将sources.list备份到sources.list.bak

1.2 替换源

sudo gedit sources.list打开文件,替换成阿里云的源即可
东北大学源

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted#Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe#Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe#Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse#Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted
deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe#Added by software-properties
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe
deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse

清华大学源

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse

阿里云源

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted  #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe#Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe#Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe#Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-security universedeb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

1.3 更新源和软件

sudo apt-get -y update 更新源

1.4 进行更新

sudo apt-get -y upgrade

2 安装git

sudo apt-get -y install git

3 安装devstack

sudo git clone https://github.com/openstack-dev/devstack.git /opt/devstack

4 创建stack用户

cd /opt/devstack/tools
sudo ./create-stack-user.sh

5 更改/opt/devstack的所有者为stack用户

sudo chown -R stack:stack /opt/devstack

6 切换到stack用户

sudo -i -u stack

7 在/opt/devstack/目录下新建local.conf文件

[[local|localrc]]
# 使用trystack来下载镜像
GIT_BASE=http://git.trystack.cn

#用于指定每次是否重新下载文件,注释掉RECLONE第二次部署时可以很快部署
#OFFLINE=True
RECLONE=True  

#用于指定本机的IP地址
HOST_IP=192.168.2.167

# Credentials
DATABASE_PASSWORD=pass
ADMIN_PASSWORD=pass
SERVICE_PASSWORD=pass
SERVICE_TOKEN=pass
RABBIT_PASSWORD=pass

#用于指定devstack下载的openstack分支,本文中直接使用master分支无需指定
#HORIZON_BRANCH=stable/mitaka
#KEYSTONE_BRANCH=stable/mitaka
#NOVA_BRANCH=stable/mitaka
#NEUTRON_BRANCH=stable/mitaka
#GLANCE_BRANCH=stable/mitaka
#CINDER_BRANCH=stable/mitaka

# Enabling Neutron (network) Service
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service q-metering
enable_service neutron

# Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs

8 运行stack

./stack.sh

9 执行失败后的操作

./unstack.sh
./clean.sh
reboot

执行完上述命令后重新执行步骤8。

10 openstack安装成功后会显示如下界面

=========================
DevStack Component Timing
 (times are in seconds)  
=========================
run_process          141
test_with_retry        5
apt-get-update         8
pip_install           76
osc                  187
wait_for_service      44
git_timed              5
dbsync               275
apt-get                5
-------------------------
Unaccounted time     1174
=========================
Total runtime        1920



This is your host IP address: 192.168.2.167
This is your host IPv6 address: ::1
Horizon is now available at http://192.168.2.167/dashboard
Keystone is serving at http://192.168.2.167/identity/
The default users are: admin and demo
The password: pass

WARNING: 
Using lib/neutron-legacy is deprecated, and it will be removed in the future


Services are running under systemd unit files.
For more information see: 
https://docs.openstack.org/devstack/latest/systemd.html

DevStack Version: rocky
Change: 24fa317234a1282478bc22b666d0f026b6cddad6 Merge "Clean up Glance config files" 2018-04-24 15:13:37 +0000
OS Version: Ubuntu 16.04 xenial

stack@henry-desktop:/opt/devstack$ 

11 Devstack部署完成后启动了那些服务

方式一:ps aux | grep python

stack@henry-desktop:~$ ps aux | grep 'python'
stack     1053  2.0  1.1 572444 44132 ?        Ssl  12:07  12:40 /usr/bin/python /usr/local/bin/cinder-scheduler --config-file /etc/cinder/cinder.conf
root      1552  0.0  0.1 211712  7264 ?        S    17:39   0:00 /usr/bin/python /usr/local/bin/privsep-helper --config-file /etc/nova/nova-cpu.conf --privsep_context os_brick.privileged.default --privsep_sock_path /tmp/tmpImpIpV/privsep.sock
root      1723  0.0  0.1 138428  7168 ?        S    17:39   0:00 /usr/bin/python /usr/local/bin/privsep-helper --config-file /etc/nova/nova-cpu.conf --privsep_context vif_plug_ovs.privsep.vif_plug --privsep_sock_path /tmp/tmp1RA8X9/privsep.sock
stack     1826  1.2  0.2 555212  9912 ?        Ss   12:07   7:22 /usr/bin/python /usr/local/bin/cinder-volume --config-file /etc/cinder/cinder.conf
stack     2092  2.7  3.0 572836 111628 ?       S    12:08  16:22 /usr/bin/python /usr/local/bin/cinder-volume --config-file /etc/cinder/cinder.conf
stack    13364  1.1  0.1 274560  6444 ?        Ss   11:59   7:06 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    14220  0.0  0.0 274560  3308 ?        S    11:59   0:00 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    14221  0.0  0.0 274560  3308 ?        S    11:59   0:00 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    14222  0.0  0.0 274560  3308 ?        S    11:59   0:00 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    14223  0.0  0.0 274560  3308 ?        S    11:59   0:00 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    14224  0.0  0.0 274560  3304 ?        S    11:59   0:00 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    14225  0.0  0.0 274560  3308 ?        S    11:59   0:00 /usr/bin/python /usr/local/bin/glance-registry --config-file=/etc/glance/glance-registry.conf
stack    16765  0.0  0.7 290700 27348 ?        Ss   12:01   0:09 /usr/bin/python /usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
stack    16921  0.5  3.5 333028 130860 ?       D    12:01   3:18 /usr/bin/python /usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
stack    16922  0.3  3.8 333172 142684 ?       S    12:01   2:04 /usr/bin/python /usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
stack    16923  0.7  3.4 321276 127156 ?       S    12:01   4:38 /usr/bin/python /usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
stack    16924  2.3  3.4 320860 127860 ?       S    12:01  14:26 /usr/bin/python /usr/local/bin/neutron-server --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
stack    18270  0.9  0.1  37212  4788 ?        S    11:44   5:51 /usr/bin/python /usr/bin/dstat -tcmndrylpg --tcp --output /opt/stack/logs/dstat-csv.log
stack    18271  4.0  0.1  38396  6312 ?        S    11:44  25:34 /usr/bin/python /usr/bin/dstat -tcmndrylpg --top-cpu-adv --top-io-adv --top-mem --swap --tcp
stack    18534  2.6  2.9 294624 107052 ?       Ss   12:01  16:30 /usr/bin/python /usr/local/bin/neutron-openvswitch-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
stack    19124  2.7  0.6 274428 24128 ?        Ss   12:01  16:59 /usr/bin/python /usr/local/bin/neutron-dhcp-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini
stack    19977  2.4  0.5 281568 21416 ?        Ss   12:01  15:01 /usr/bin/python /usr/local/bin/neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini
root     20561  0.0  0.2 596776  7860 ?        Sl   12:01   0:01 /usr/bin/python /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
stack    20618  1.9  0.5 265296 18504 ?        Ss   12:01  12:10 /usr/bin/python /usr/local/bin/neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini
stack    21219  2.2  0.5 267048 21720 ?        Ss   12:02  14:04 /usr/bin/python /usr/local/bin/neutron-metering-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/services/metering/metering_agent.ini
root     21451  0.0  0.0 148332  3128 ?        S    12:02   0:00 /usr/bin/python /usr/local/bin/privsep-helper --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent.ini --privsep_context neutron.privileged.default --privsep_sock_path /tmp/tmpOt5E4R/privsep.sock
stack    21453  0.0  0.4 266468 15520 ?        S    12:02   0:06 /usr/bin/python /usr/local/bin/neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini
stack    21454  0.0  0.4 267968 14796 ?        S    12:02   0:06 /usr/bin/python /usr/local/bin/neutron-metadata-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/metadata_agent.ini
stack    21615  0.0  0.0  21312   932 pts/18   S+   22:14   0:00 grep --color=auto python
root     22934  0.0  0.0 148224  2996 ?        S    12:02   0:00 /usr/bin/python /usr/local/bin/privsep-helper --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/dhcp_agent.ini --privsep_context neutron.privileged.default --privsep_sock_path /tmp/tmpALGRbi/privsep.sock
root     23217  0.0  0.2 301592  8424 ?        Sl   12:03   0:00 /usr/bin/python /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
root     23939  0.0  0.1 375580  5456 ?        Sl   12:03   0:00 /usr/bin/python /usr/local/bin/neutron-rootwrap-daemon /etc/neutron/rootwrap.conf
root     24363  0.0  0.1 208736  4644 ?        Sl   17:00   0:00 python3 /usr/lib/software-properties/software-properties-dbus
stack    26765  1.5  0.2 273560  9200 ?        Ss   12:03   9:23 /usr/bin/python /usr/local/bin/nova-scheduler --config-file /etc/nova/nova.conf
stack    28043  2.0  1.0 278624 39672 ?        S    12:04  12:21 /usr/bin/python /usr/local/bin/nova-scheduler --config-file /etc/nova/nova.conf
stack    28044  2.0  0.7 278588 28004 ?        S    12:04  12:18 /usr/bin/python /usr/local/bin/nova-scheduler --config-file /etc/nova/nova.conf
stack    28079  0.0  0.1 525848  7344 ?        Ss   12:04   0:19 /usr/bin/python /usr/local/bin/nova-novncproxy --config-file /etc/nova/nova.conf --web /opt/stack/noVNC
stack    28944  2.0  0.7 280228 27352 ?        Ss   12:04  12:46 /usr/bin/python /usr/local/bin/nova-consoleauth --config-file /etc/nova/nova.conf
stack    29868  1.5  0.2 267564  8796 ?        Ss   12:04   9:32 /usr/bin/python /usr/local/bin/nova-conductor --config-file /etc/nova/nova.conf
stack    30526  1.5  0.2 267520  9784 ?        Ss   12:04   9:37 /usr/bin/python /usr/local/bin/nova-conductor --config-file /etc/nova/nova_cell1.conf
stack    30694  2.0  0.7 282500 28920 ?        S    12:04  12:21 /usr/bin/python /usr/local/bin/nova-conductor --config-file /etc/nova/nova.conf
stack    30695  2.0  1.0 282048 38416 ?        S    12:04  12:19 /usr/bin/python /usr/local/bin/nova-conductor --config-file /etc/nova/nova.conf
stack    31436  2.2  1.6 293680 60476 ?        S    12:05  13:50 /usr/bin/python /usr/local/bin/nova-conductor --config-file /etc/nova/nova_cell1.conf
stack    31437  2.2  2.7 295440 100716 ?       S    12:05  13:51 /usr/bin/python /usr/local/bin/nova-conductor --config-file /etc/nova/nova_cell1.conf
stack    31471  2.4  1.0 2007592 38804 ?       Ssl  12:05  15:04 /usr/bin/python /usr/local/bin/nova-compute --config-file /etc/nova/nova-cpu.conf

方式二: screen -x

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 194,457评论 5 459
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 81,837评论 2 371
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 141,696评论 0 319
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 52,183评论 1 263
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 61,057评论 4 355
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 46,105评论 1 272
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 36,520评论 3 381
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 35,211评论 0 253
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 39,482评论 1 290
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 34,574评论 2 309
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 36,353评论 1 326
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 32,213评论 3 312
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 37,576评论 3 298
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 28,897评论 0 17
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,174评论 1 250
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 41,489评论 2 341
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 40,683评论 2 335

推荐阅读更多精彩内容