The foreword 0.

As a person who wants to get started in cloud computing, the first step for most people is to learn openstack, and the first step for those who learn openstack is the first ‘problem’, which is to deploy the openstack environment using the automated deployment tool DevStack. The first time I saw this, it took over two days to successfully deploy Ubuntu Server and Ubuntu Desktop on version 16.04. There are a lot of people who say that the Desktop version has a lot of bugs, and there are more testing issues than the Server version, but they are all fixable. One of the most beginner unfriendly problems is the Internet, and here’s why. So if you buy a foreign VPS it is easy to do, because there is a SAO operation to use, if your network speed is good you may not encounter these problems can be ignored.

The following two sections describe the deployment process on both Server and Desktop. This tutorial should not be too much for beginners, easy to mess up, as long as there is a correct implementation framework is good. Just Google any other bugs you encounter.

Then tell me about my environment

  • Mac 10.12.6
  • VirtualBox 5.1.28
  • Ubuntu Server 16.04 4G+20G
  • Ubuntu Desktop 16.04 4G+80G
  • VPS(preferably) (because it is a beggar version, not suitable for direct deployment and learning)

1. The Ubuntu Server edition

Install Ubuntu Server

The first step is definitely to install Ubuntu Server in the Virtual Box, so skip this step. Believe you have been in contact with the virtual machine for a period of time, but a little attention, unexpectedly may be divided into a little more memory and hard disk. Since I do not plan to use this Server version in the future, my configuration is 4G + 20G

Log in to the VM using SSH

One of the problems you have when you’re done is that the interface is ugly… So it would be nice if you could do it on a host, and SSH does it for you. As for SSH can not be used to check their own information, here I mainly introduce the network card configuration, I use two network cards: the first:








Then the connection is used directly under the host

SSH -p 2222 [email protected]Copy the code

Fitzeng change to your username. If you have a variety of problems can not be connected to pay attention to two points: 1. Firewall 2. Delete the “known_hosts” file in the ~/. SSH folder and try again

Start the deployment

The main tutorial here is the official one, and I will update those notes.

The scripts to be deployed must be non-root users who have the root permission.

sudo useradd -s /bin/bash -d /opt/stack -m stack

echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
sudo su - stack

cd /opt/stack
git clone https://git.openstack.org/openstack-dev/devstack
cd devstackCopy the code

If the above clone is too slow or clone can not down if you can try github source.

git clone https://github.com/openstack-dev/devstack.gitCopy the code

Then is to add the configuration, if you do not understand the recommended direct use of the official page. Or use the following command

cp samples/local.conf ./
vim local.confCopy the code

If you’re lucky, be reasonable and execute./stack.sh all the way to the end… But there are many more pits waiting for us. But the nice thing is that the Log and error report are very fresh, and you can quickly locate the problem, and sometimes you can find a solution by searching the Log directly. If the script exits directly, HOST_IP is not displayed. Add it directly after local.conf

HOST_IP=x.x.x.x
GIT_BASE=https://github.comCopy the code

What HOST_IP is in your virtual machine ifconfig view. It’s recommended to switch to github git sources. /etc/apt/sources.list.d/; /etc/apt/sources.list.d/; If you need to upgrade your apt-get upgrade, use the default 2.7.x for Python. If you need to upgrade your apt-get upgrade, use the default 2.7.x for Python. If you change to 3.4 many libraries will have problems. If you are Python 3.X, you can link python2.x in/ user/bin/ to the Python file in that directory. Execute python -v to see the result.

But, but, but, it only solves the visible bugs, there are the invisible bugs, you will have network problems, if you want to smooth things out you can directly change the source. Modify the PIP source

Mkdir ~/.pip vim ~/.pip/ PIP  [global] trusted-host=mirrors.aliyun.com index-url=http://mirrors.aliyun.com/pypi/simpleCopy the code

Modify the sources. The list:

Sudo cp/etc/apt/sources. List/etc/apt/sources list. Bak sudo vim/etc/apt/sources. Fill the list with:# 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-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverseCopy the code

Aliyun’s. By this time if your network is not a problem, there may be some small environmental problems, DKPG and a variety of packages and so on, a search online basic solutions.

But, but, if your Internet speed is less than 10Kb/s to download some packages then you need to use the SAO operation… Because it will be stuck all the time, the network will be broken and have to start again, first unstack, clean and stack, very unfriendly. Most problems occur when downloading a git repository and certain packages. Especially something like the Nova Horizon, up to 300+M.

Here’s one way: The idea is to SSH your foreign VPS and download your Git repository or other files. Then SCP it to your virtual machine. The main is that this will not interrupt, and can be virtually multithreaded operation, open several terminal SCP several files. Check out the speed comparison, download on virtual machine:





sudo scp -P 10800 -r [email protected]:/fitzeng/horizon /etc/stack/Copy the code

-r is the cp folder, then port, IP, and your own directory. It might be a little slower here too, but it’s better and more stable than before.







Having these operations basically means that you’ve solved the network problem, and with Google you can basically solve other libraries and environments. Successful graph upload a wave:

2. The Ubuntu Desktop version

The basic steps are the same as before, the problem may be that you have installed a variety of software in Ubuntu (I installed Sogou input method, the fCITx source in Ubuntu slowed down the speed, and sometimes even blocked it), changed the software source or made other tool changes, according to the previous configuration can be tested. If you have previously installed the Ubuntu Server version, you can send the SCP file directly to the Ubuntu Desktop. If the VMS cannot communicate with each other, you can first send the SCP file to the host and then share the file from the host to the Ubuntu Desktop. And then you just run it, and it’s pretty easy now that you have the basics.

Let’s look at the results directly:




3. Afterword.

To be honest, it’s not really a technical article, it’s a personal note. Originally, I didn’t want to write it, but I feel that the domestic environment is a little unfriendly to developers. If this article can help beginners in part, I will be satisfied, so that beginners can continue to learn. And this was written after deployment, which was not as easy as writing, but I now have the confidence to solve the problems I encountered during deployment, which is the point. I hope you do too. Everyone’s environment is different, and the problems may not be the same, so if you have not solved the problem as above, please leave a message and discuss with us.

Finally: thanks for reading and wish everyone to go over ^_^