Build a DevStack Development Environment on CentOS7.0

Source: Internet
Author: User

Build a DevStack Development Environment on CentOS7.0

Yesterday, according to other people's information on the Internet, the local virtual machine was used to build a DevStack in the ubuntu14.04 environment and the mitaka version was selected. In the deployment phase of Eclipse, the blue screen of the host causes failure. Sang Xin...

I am not familiar with Ubuntu to build this environment again today. I have to check the information for many operations. Try a familiar centos system today and it should be easier to operate. Because you need to install the development tool (Eclipse), choose to install the desktop when installing the operating system. Hope you can install it successfully today...

Centos7 is installed with the KDE graphic interface.

First, set the network and host name. In this case, my virtual machine uses vmware workstation and nat network, and the host name is set to devstack.

My Network Configuration

To install devstack, you need to ensure that the virtual machine can access the Internet. This address is also required for later configuration. dhcp allocation is not recommended.

Modify host name

Okay, please ignore the wrong commands. I can't remember them. I tried them several times and finally got it right. Yes

Hostnamectl set-hostname Host Name

Restart once, and these changes will be updated.

After restarting, you can see that the host name is updated and the address is changed.

Finally, I can use the terminal software to log on.

Modify the host file.

Vim/etc/hosts

The font of the terminal software is really much more beautiful.

The source will be updated later, and yum update will be used. This process will take a long time ......

Input Y

Update completed

Now, devstack is officially installed. First install Git

Yum install git-y

Installation Complete

Next, download devstack. I chose to download it to/tmp/devstack. This directory will be used by the stack users at last, so it doesn't matter which directory to store it.

Download devstack and run the following command:

Git clone-B stable/mitaka https://git.openstack.org/openstack-dev/devstack

After the download is complete, go to the tools in the devstack directory and run

Create-stack-user.sh

Script to create a stack user. devstack must be used for operations.

After the user is created, run

Su-stack

Go to the stack user and copy the devstack directory to the stack user directory.

Modify the owner group of the devstack directory.

Chown-R stack: stack devstack

Before the formal installation, You can manually download the source code back to shorten the installation time. I have no comparison and doubt this.

You can run the following commands in multiple Windows:

Git clone-B stable/mitaka git: // git.openstack.org/openstack/horizon.git/opt/stack/horizon
Git clone-B stable/mitaka git: // git.openstack.org/openstack/keystone.git/opt/stack/keystone
Git clone-B stable/mitaka git: // git.openstack.org/openstack/nova.git/opt/stack/nova
Git clone-B stable/mitaka git: // git.openstack.org/openstack/neutron.git/opt/stack/neutron
Git clone-B stable/mitaka git: // git.openstack.org/openstack/glance.git/opt/stack/glance
Git clone-B stable/mitaka git: // git.openstack.org/openstack/cinder

Note that every terminal must be su-applied to the stack before execution.

Just like this

Execute a git clone command in each window.

After all the terminals are cloned, start to configure the configuration file. This is a key part of devstack installation. The configuration file determines the installed component content and network settings. Here I use the Mr _ portable configuration. The link is as follows: http://blog.csdn.net/u011521019/article/details/41014681.

[[Local | localrc]
# 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

# 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"

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

HOST_IP = 192.168.88.180
SERVICE_HOST = 192.168.88.180
MYSQL_HOST = 192.168.88.180
RABBIT_HOST = 192.168.88.180
GLANCE_HOSTPORT = 192.168.88.180: 9292

# Database BackendMySQL
Enable_service mysql

# RPC Backend RabbitMQ
Enable_service rabbit

# Enable Keystone-OpenStack Identity Service
Enable_service key

# Horizon-OpenStack Dashboard Service
Enable_service horizon

# Enable Glance-OpenStack Image service
Enable_service g-api g-reg

# Enable Cinder-Block Storage service for OpenStack
VOLUME_GROUP = "cinder-volumes"
Enable_service cinder c-api c-vol c-sch c-bak

# Enable Heat (orchestration) Service
Enable_service heat h-api-cfn h-api-cw h-eng

# Enable Tempest-The OpenStack Integration Test Suite
Enable_service tempest

# Enable NoVNC
Enable_service n-novnc

# 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

# Neutron options
Q_USE_SECGROUP = True
FLOATING_RANGE = "192.168.88.0/24"
FIXED_RANGE = "10.0.1.0/24"
NETWORK_GATEWAY = "10.0.1.254"
Q_FLOATING_ALLOCATION_POOL = start = 192.168.88.200, end = 192.168.88.210
PUBLIC_NETWORK_GATEWAY = "192.168.88.2"
Q_L3_ENABLED = True
PUBLIC_INTERFACE = eth0
Q_USE_PROVIDERNET_FOR_PUBLIC = True
OVS_PHYSICAL_BRIDGE = br-ex
PUBLIC_BRIDGE = br-ex
OVS_BRIDGE_MAPPINGS = public: br-ex

# VLAN configuration.
Q_PLUGIN = ml2
ENABLE_TENANT_VLANS = True

# Branches
KEYSTONE_BRANCH = stable/mitaka
NOVA_BRANCH = stable/mitaka
NEUTRON_BRANCH = stable/mitaka
GLANCE_BRANCH = stable/mitaka
CINDER_BRANCH = stable/mitaka
HEAT_BRANCH = stable/mitaka
HORIZON_BRANCH = stable/mitaka

# Select Keystone's token format
# Choose from 'uuid', 'pki ', or 'pkiz'
# Insert this line...
KEYSTONE_TOKEN_FORMAT =$ {KEYSTONE_TOKEN_FORMAT:-UUID}
KEYSTONE_TOKEN_FORMAT = $ (echo $ {KEYSTONE_TOKEN_FORMAT} | tr '[: upper:]' [: lower:] ')

# Work offline
# OFFLINE = True
# Reclone each time
RECLONE = yes

# Logging
DEST =/home/stack. mitaka
LOGFILE =/home/stack. mitaka/logs/stack. sh. log
VERBOSE = True
LOG_COLOR = True
SCREEN_LOGDIR =/home/stack. mitaka/logs

In configuration, I only modified the network part, but the other parts were not changed.

In the devstack directory, create local. conf

Vim local. conf

Stick the configuration above.

Then you can start the installation and execute

./Stack. sh

Installation started, and it was a long wait .......

After lunch and taking a nap, I didn't fall asleep. I stared at the screen for a while and finally finished the installation.

Installation started at nine o'clock A.M. and completed at noon. It took three and a half hours and no development tools were installed.

In this case, you can use the web to open the firewall. Check if the firewall is disabled. My firewall is not closed at the beginning. It does not seem to work after it is installed. I cannot access the dashboard outside, but it can be accessed on the centos system. The interface is like this:

Admin Login

It should be normal, but external access is not allowed.

Next, install eclipse. First upload jdk

Decompress the tar.gz package of JDK to/usr/lib/Java.

Configuration file/etc/profile

Add JAVA_HOME

Exprot JAVA_HOME =/usr/lib/java/jdk directory

Run after editing

Source/etc/profile

Execute Command

Java-version

Verify that jdk can be used

Then upload eclipse. The idea can be downloaded. Now I can only install it using install.

Decompress eclipse installer

Tar-xzvf eclipse-inst-linux64.tar.gz

Then go to the centos graphical interface and start the installation.

Enter Installation Options

I selected the first

Select the installation path. The default setting is good.

Start installation, or wait...

In the middle of the pop-up license confirmation, just agree.

Installation Complete

Start eclipse and set the working directory to/opt/stack.

Install pydev. Open the following URL in the browser:

Https://marketplace.eclipse.org/content/pydev-Python-ide-eclipse

Click install and drag it to eclipse to start installation.

Select "Install" and click "confirm" to start installation.

After the installation is complete, you will be prompted to restart eclipse and click restart.

After startup, click windows> prefrences and find the python option.

Click "Quick Auto-Config"

Click "OK"

Click "File" and select "Import ..."

Select Projects from Git

Select an existing database

Select a component and click finish.

Here you can select Import as general project

This completes. You can see that the source code of keystone has been imported, and you can edit and modify it. Other components can also be imported in this way. At this point, the establishment of the devstack development environment is basically complete. With the code, we can solve problems and change the environment. Mom no longer needs to worry about the failure of openstack.

Finally, the problem of external access is also solved. The reason is that I used the systemctl stop firewalld command to disable the firewall. In fact, iptables still works, so I disabled iptables and the access was normal, I don't know how many centos firewalls are.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.