sudo apt-get install git
sudo apt-get install vim
这个电脑因为连 的是无线,配置ip的时候不能如下直接配
vim /etc/network/interfaces
auto ens33
iface ens33 inet static
address 192.168.31.25
netmask 255.255.255.0
gateway 192.168.31.1
dns-nameserver 192.168.31.1
应该点击右上角的上网标志然后点击编辑连接,点击你连接的wifi点击编辑,点击ipv4改成手动,然后手动添加ip地址192.168.31.25 255.255.255.0 192.168.31.1 dns 192.168.31.1,如果不知道dns是多少时,配置前可以右击右上角的上网标志也就是wifi标志,点击连接信息的dns
安装pip并修改pip源:
apt-get install python-pip
mkdir ~/.pip
vi ~/.pip/pip.conf
添加
[global]
index-url = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com
cd /home
git clone http://git.trystack.cn/openstack-dev/devstack.git -b stable/ocata
cd /home/devstack/tools
创建stack用户
./create-stack-user.sh或者sudo useradd -s /bin/bash -d /opt/stack -m stack
echo 'stack ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/stack
sudo chown -R stack:stack /home/devstack
chmod 777 /dev/pts/0
切换到stack用户并修改pip源:
sudo su - stack
mkdir ~/.pip
vi ~/.pip/pip.conf
添加
[global]
index-url = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com
设置Devstack配置文件:
cd /home/devstack
vim local.conf
打开文件输入以下内容并设置密码
[[local|localrc]]
# Credentials
ADMIN_PASSWORD=admin
MYSQL_PASSWORD=secret
RABBIT_PASSWORD=secret
SERVICE_PASSWORD=secret
SERVICE_TOKEN=abcdefghijklmnopqrstuvwxyz
# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git
HOST_IP=192.168.31.25
# Define images to be automatically downloaded during the DevStack built process.
DOWNLOAD_DEFAULT_IMAGES=False
IMAGE_URLS=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
# only support IP v4
SERVICE_IP_VERSION=4
# only support keystone v2
ENABLE_IDENTITY_V2=True
#not create default network
NEUTRON_CREATE_INITIAL_NETWORKS=False
# instead of default network
FLOATING_RANGE="192.168.31.0/24"
FIXED_RANGE="10.0.0.0/24"
Q_FLOATING_ALLOCATION_POOL=start=192.168.31.10,end=192.168.31.150#这个是指这个网段的可用ip地址,可登陆路由器的ip地址查看路由的ip地址
PUBLIC_NETWORK_GATEWAY="192.168.31.1"
# Branches
KEYSTONE_BRANCH=stable/ocata
NOVA_BRANCH=stable/ocata
NEUTRON_BRANCH=stable/ocata
SWIFT_BRANCH=stable/ocata
GLANCE_BRANCH=stable/ocata
CINDER_BRANCH=stable/ocata
# 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
# VLAN configuration.
Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True
TENANT_VLAN_RANGE=1100:2999
#Logging
LOGFILE=/opt/stack/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
# Work offline
#OFFLINE=True
# Reclone each time
RECLONE=no
开始部署:
./stack.sh
若安装失败,则执行./unstack.sh脚本和./clean.sh脚本,并重复上一步骤
出现的错误
1.
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh > /dev/null; fi'
E: Sub-process returned an error code
解决方法:
sudo apt-get remove libappstream3
or
sudo apt remove libappstream3
再进行update
sudo apt-get update
2.
在ubuntu系统的termial下,用apt-get install 安装软件的时候,如果在未完成下载的情况下将terminal close。此时 apt-get进程可能没有结束。结果,如果再次运行apt-get install 命令安装如今,可能会发生下面的提示:
无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用)
无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它?
解决办法如下:
1。终端输入 ps aux ,列出进程。找到含有apt-get的进程,直接sudo kill PID。
2。强制解锁,命令
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
3.
UnicodeEncodeError: 'ascii' codec can't encode characters in position 8-11: ordinal not in range(128)
解决UnicodeEncodeError: 'ascii' codec can't encode characters in position
转自:http://cooler1217.iteye.com/blog/1465335
异常: 'ascii' codec can't encode characters
字符集的问题,在文件前加两句话:
reload(sys)
sys.setdefaultencoding( "utf-8" )
4.
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
Could not find a version that satisfies the requirement pip!=8,<10 (from -c /home/devstack/tools/cap-pip.txt (line 1)) (from versions: )
No matching distribution found for pip!=8,<10 (from -c /home/devstack/tools/cap-pip.txt (line 1))
++./stack.sh:main:760 err_trap
++./stack.sh:err_trap:556 local r=1
++./stack.sh:err_trap:557 set +o xtrace
stack.sh failed
Error on exit
World dumping... see /opt/stack/logs/worlddump-2018-09-06-032653.txt for details
df: /mnt/hgfs: Protocol error
解决
#pip --default-timeout=100 install -U pip
修改~/.pip/pip.conf为当前用户配置.
如:stack@ztf-virtual-machine:/etc$ sudo vim pip.conf
windows下pip配置文件为 C:\Users\xx\pip\pip.ini ,没有就新建.
[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
5. File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 657, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr>=2.0.0')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fmmUIX/stestr/
You are using pip version 9.0.3, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
解决:
sudo pip install --upgrade pip