Tuesday, August 18, 2015

openstack upstream testing setup from source step-by-step

prerequisite

1: install setuptool, pip
$sudo -E python ez_setup.py
$sudo -E python get-pip.py

$sudo route del default(route del -net 0.0.0.0 netmask 0.0.0.0 gw 172.16.116.2 dev eth0)
$sudo route add default gw 16.158.48.1(route add -net 0.0.0.0 netmask 0.0.0.0 gw 16.158.48.1 dev br-ex)
2:sudo apt-get install build-essential autoconf libtool python-dev libffi-dev libssl-dev

keystone

4:python setup.py install
5:sudo -E pip install -r requirements.txt
6:apt-get install mariadb-server python-mysqldb
[mysqld]
...

bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'

character-set-server = utf8
7:apt-get install rabbitmq-server
$rabbitmqctl add_user openstack
Permit configuration, write, and read access for the openstack user:
$rabbitmqctl set_permissions openstack ".*" ".*" ".*"

8:apt-get install memcached python-memcache

9: Keystone will look in the following directories for a configuration file, in order:
    The Keystone primary configuration file is expected to be     named keystone.conf. When starting Keystone, you can specify a different configuration file to use with --config-file
  • ~/.keystone/
  • ~/
  • /etc/keystone/
  • /etc/
mkdir -p /etc/keystone/
cp etc/keystone-paste.ini /etc/keystone/
cp policy.json /etc/keystone/

10: keystone-manage db_sync
11: keystone-all

osc

12:  INSTALL OSC 


GLANCE GLANCE-CLEINT


cp etc/*.conf /etc/glance
cp /etc/*.ini/  /etc/glance
cp /etc/policy.json /etc/glance
$glance-registry
$glance-api


INSTALL NOVA

sudo apt-get install libxml2-dev libxslt1-dev
 
udo apt-get install libpq-dev
 
sudo pip install tox
tox -egenconfig (error to recreate conf)

apt-get install sysfsutils
apt-get install python-libvirt
sudo usermod -G libvirtd -a <username>
then logout then login
nova-manage db sync
$ sudo mkdir -p /var/lib/nova
$ sudo chown -R whg:whg /var/lib/nova
$nova-api
$nova-cert
$nova-consoleauth
$nova-scheduler
$nova-conductor
$nova-novncproxy
$nova-compute

install neutron



neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini upgrade head
apt-get install openvswitch-switch
ovs-vsctl add-br br-ex
ovs-vsctl add-port br-ex INTERFACE_NAME
neutron-openvswitch-agent --config-file=/etc/neutron/plugins/ml2/ml2_conf.ini --config-file /etc/neutron/neutron.conf   --log-file=/var/log/neutron/openvswitch-agent.log
neutron-server  --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini   --log-file=/var/log/neutron/neutron-server.log

cp fwaas_driver.ini /etc/neuron/(uncomment to enable fw)
mkdir /var/lib/neutron && chown -R 
neutron-l3-agent --config-file=/etc/neutron/l3_agent.ini --config-file=/etc/neutron/fwaas_driver.ini --config-file /etc/neutron/neutron.conf --log-file=/var/log/neutron/l3-agent.log
neutron-dhcp-agent --config-file=/etc/neutron/dhcp_agent.ini  --config-file=/etc/neutron/neutron.conf  --log-file=/var/log/neutron/dhcp-agent.log
neutron-metadata-agent  --config-file=/etc/neutron/dhcp_agent.ini  --config-file=/etc/neutron/metadata_agent.ini --log-file=/var/log/neutron/metadata-agent.log
neutron-ovs-cleanup --config-file /etc/neutron/neutron.conf  --log-file=/var/log/neutron/ovs-cleanup.log

horizon

python setup.py compile_catalog
pip install -e .
Add openstack_auth to settings.INSTALLED_APPS
Add 'openstack_auth.backend.KeystoneBackend' to yoursettings.AUTHENTICATION_BACKENDS
Include 'openstack_auth.urls' somewhere in your urls.py file

chown -R $STACK_USER $1/*.egg-info
# using pip before running `setup.py develop`
setup.py develop


sudo pip install .
Include 'openstack_auth.urls' somewhere in your urls.py file

cp openstack_dashboard/local/local_settings.py.example  /etc/openstack_dashboard/local/local_settings.py
$ ./manage.py collectstatic
$ ./manage.py compress
python manage.py compress
COMPRESS_OFFLINE = True  to disable compress offline(openstack_dashboard/local/local_settings.py) if compress offline failed
mkdir -p /var/lib/keystone
./manage.py make_web_conf --apache > /etc/apache2/sites-available/horizon.conf
Same as above but if you want ssl support:
$ ./manage.py make_web_conf --apache --ssl --sslkey=/path/to/ssl/key --sslcert=/path/to/ssl/cert > /etc/apache2/sites-available/horizon.conf
$ sudo a2ensite horizon
$ sudo service apache2 restart



upstart service

If you use Upstart 1.4 or newer, put console log into your Upstart job and all the output to stdout/stderr will end up to /var/log/upstart/<job>.log. Then you can do tail -f /var/log/upstart/<job>.log & to have the output appear in terminal

No comments:

Post a Comment