~rlane/nova/ldapimprovements

« back to all changes in this revision

Viewing changes to doc/source/adminguide/multi.node.install.rst

  • Committer: Ryan Lane
  • Date: 2010-11-24 15:46:32 UTC
  • mfrom: (382.48.1 trunk)
  • Revision ID: laner@controller-20101124154632-zh7kwjuyyd02a2lh
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
..
 
2
      Copyright 2010 United States Government as represented by the
 
3
      Administrator of the National Aeronautics and Space Administration. 
 
4
      All Rights Reserved.
 
5
 
 
6
      Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
      not use this file except in compliance with the License. You may obtain
 
8
      a copy of the License at
 
9
 
 
10
          http://www.apache.org/licenses/LICENSE-2.0
 
11
 
 
12
      Unless required by applicable law or agreed to in writing, software
 
13
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
      License for the specific language governing permissions and limitations
 
16
      under the License.
 
17
 
 
18
Installing Nova on Multiple Servers
 
19
===================================
 
20
 
 
21
When you move beyond evaluating the technology and into building an actual
 
22
production environemnt, you will need to know how to configure your datacenter
 
23
and how to deploy components across your clusters.  This guide should help you
 
24
through that process.
 
25
 
 
26
You can install multiple nodes to increase performance and availability of the OpenStack Compute installation.
 
27
 
 
28
This setup is based on an Ubuntu Lucid 10.04 installation with the latest updates. Most of this works around issues that need to be resolved in the installation and configuration scripts as of October 18th 2010. It also needs to eventually be generalized, but the intent here is to get the multi-node configuration bootstrapped so folks can move forward.
 
29
 
 
30
 
 
31
Requirements for a multi-node installation
 
32
------------------------------------------
 
33
 
 
34
* You need a real database, compatible with SQLAlchemy (mysql, postgresql) There's not a specific reason to choose one over another, it basically depends what you know. MySQL is easier to do High Availability (HA) with, but people may already know Postgres. We should document both configurations, though.
 
35
* For a recommended HA setup, consider a MySQL master/slave replication, with as many slaves as you like, and probably a heartbeat to kick one of the slaves into being a master if it dies.
 
36
* For performance optimization, split reads and writes to the database. MySQL proxy is the easiest way to make this work if running MySQL.
 
37
 
 
38
 
 
39
Assumptions
 
40
^^^^^^^^^^^
 
41
 
 
42
* Networking is configured between/through the physical machines on a single subnet.
 
43
* Installation and execution are both performed by root user.
 
44
 
 
45
 
 
46
 
 
47
Step 1 Use apt-get to get the latest code
 
48
-----------------------------------------
 
49
 
 
50
1. Setup Nova PPA with https://launchpad.net/~nova-core/+archive/ppa.
 
51
 
 
52
::
 
53
    
 
54
    sudo apt-get install python-software-properties
 
55
    sudo add-apt-repository ppa:nova-core/ppa
 
56
        
 
57
2. Run update.
 
58
 
 
59
::
 
60
    
 
61
    sudo apt-get update
 
62
 
 
63
3. Install nova-pkgs (dependencies should be automatically installed).
 
64
 
 
65
::
 
66
 
 
67
    sudo apt-get install python-greenlet
 
68
    sudo apt-get install nova-common nova-doc python-nova nova-api nova-network nova-objectstore nova-scheduler
 
69
 
 
70
It is highly likely that there will be errors when the nova services come up since they are not yet configured. Don't worry, you're only at step 1!
 
71
 
 
72
Step 2 Setup configuration files (installed in /etc/nova)
 
73
---------------------------------------------------------
 
74
 
 
75
Note: CC_ADDR=<the external IP address of your cloud controller>
 
76
 
 
77
1. These need to be defined in EACH configuration file
 
78
 
 
79
::
 
80
 
 
81
   --sql_connection=mysql://root:nova@$CC_ADDR/nova # location of nova sql db
 
82
   --s3_host=$CC_ADDR  # This is where nova is hosting the objectstore service, which
 
83
                       # will contain the VM images and buckets
 
84
   --rabbit_host=$CC_ADDR # This is where the rabbit AMQP messaging service is hosted
 
85
   --cc_host=$CC_ADDR     # This is where the the nova-api service lives
 
86
   --verbose              # Optional but very helpful during initial setup
 
87
   --ec2_url=http://$CC_ADDR:8773/services/Cloud
 
88
   --network_manager=nova.network.manager.FlatManager # simple, no-vlan networking type
 
89
 
 
90
 
 
91
2. nova-manage specific flags
 
92
 
 
93
::
 
94
 
 
95
   --fixed_range=<network/prefix>   # ip network to use for VM guests, ex 192.168.2.64/26
 
96
   --network_size=<# of addrs>      # number of ip addrs to use for VM guests, ex 64
 
97
 
 
98
 
 
99
3. nova-network specific flags
 
100
 
 
101
::
 
102
 
 
103
   --fixed_range=<network/prefix>   # ip network to use for VM guests, ex 192.168.2.64/26
 
104
   --network_size=<# of addrs>      # number of ip addrs to use for VM guests, ex 64
 
105
 
 
106
4. Create a nova group
 
107
 
 
108
::
 
109
 
 
110
   sudo addgroup nova
 
111
 
 
112
5. nova-objectstore specific flags < no specific config needed >
 
113
 
 
114
Config files should be have their owner set to root:nova, and mode set to 0640, since they contain your MySQL server's root password.
 
115
 
 
116
::
 
117
 
 
118
   cd /etc/nova
 
119
   chown -R root:nova .
 
120
 
 
121
Step 3 Setup the sql db
 
122
-----------------------
 
123
 
 
124
1. First you 'preseed' (using vishy's :doc:`../quickstart`). Run this as root.
 
125
 
 
126
::
 
127
 
 
128
   sudo apt-get install bzr git-core
 
129
   sudo bash
 
130
   export MYSQL_PASS=nova
 
131
 
 
132
 
 
133
::
 
134
 
 
135
   cat <<MYSQL_PRESEED | debconf-set-selections
 
136
   mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
 
137
   mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
 
138
   mysql-server-5.1 mysql-server/start_on_boot boolean true
 
139
   MYSQL_PRESEED
 
140
 
 
141
2. Install mysql
 
142
 
 
143
::
 
144
 
 
145
   sudo apt-get install -y mysql-server
 
146
 
 
147
4. Edit /etc/mysql/my.cnf and set this line: bind-address=0.0.0.0 and then sighup or restart mysql
 
148
 
 
149
5. create nova's db   
 
150
 
 
151
::
 
152
 
 
153
   mysql -uroot -pnova -e 'CREATE DATABASE nova;'
 
154
 
 
155
 
 
156
6. Update the db to include user 'root'@'%'
 
157
 
 
158
::
 
159
 
 
160
   mysql -u root -p nova 
 
161
   GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
 
162
   SET PASSWORD FOR 'root'@'%' = PASSWORD('nova');
 
163
 
 
164
7. branch and install Nova
 
165
 
 
166
::
 
167
 
 
168
   sudo -i
 
169
   cd ~
 
170
   export USE_MYSQL=1
 
171
   export MYSQL_PASS=nova
 
172
   git clone https://github.com/vishvananda/novascript.git
 
173
   cd novascript
 
174
   ./nova.sh branch
 
175
   ./nova.sh install
 
176
   ./nova.sh run
 
177
 
 
178
Step 4 Setup Nova environment
 
179
-----------------------------
 
180
 
 
181
::
 
182
 
 
183
   /usr/bin/python /usr/bin/nova-manage user admin <user_name>
 
184
   /usr/bin/python /usr/bin/nova-manage project create <project_name> <user_name>
 
185
   /usr/bin/python /usr/bin/nova-manage project create network
 
186
 
 
187
Note: The nova-manage service assumes that the first IP address is your network (like 192.168.0.0), that the 2nd IP is your gateway (192.168.0.1), and that the broadcast is the very last IP in the range you defined (192.168.0.255). If this is not the case you will need to manually edit the sql db 'networks' table.o.
 
188
 
 
189
On running this command, entries are made in the 'networks' and 'fixed_ips' table. However, one of the networks listed in the 'networks' table needs to be marked as bridge in order for the code to know that a bridge exists. We ended up doing this manually, (update query fired directly in the DB). Is there a better way to mark a network as bridged?
 
190
 
 
191
Update: This has been resolved w.e.f 27/10. network is marked as bridged automatically based on the type of n/w manager selected.
 
192
 
 
193
More networking details to create a network bridge for flat network
 
194
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
195
 
 
196
Nova defaults to a bridge device named 'br100'. This needs to be created and somehow integrated into YOUR network. In my case, I wanted to keep things as simple as possible and have all the vm guests on the same network as the vm hosts (the compute nodes). Thus, I set the compute node's external IP address to be on the bridge and added eth0 to that bridge. To do this, edit your network interfaces config to look like the following::
 
197
 
 
198
   < begin /etc/network/interfaces >
 
199
   # The loopback network interface
 
200
   auto lo
 
201
   iface lo inet loopback
 
202
 
 
203
   # Networking for NOVA
 
204
   auto br100
 
205
 
 
206
   iface br100 inet dhcp
 
207
          bridge_ports    eth0
 
208
          bridge_stp      off
 
209
          bridge_maxwait  0
 
210
          bridge_fd       0
 
211
   < end /etc/network/interfaces >
 
212
 
 
213
 
 
214
Next, restart networking to apply the changes::
 
215
 
 
216
   sudo /etc/init.d/networking restart
 
217
 
 
218
Step 5: Create nova certs.
 
219
--------------------------
 
220
 
 
221
Generate the certs as a zip file::
 
222
 
 
223
   mkdir creds
 
224
   sudo /usr/bin/python /usr/bin/nova-manage project zip admin admin creds/nova.zip
 
225
 
 
226
you can get the rc file more easily with::
 
227
 
 
228
   sudo /usr/bin/python /usr/bin/nova-manage project env admin admin creds/novarc 
 
229
 
 
230
unzip them in your home directory, and add them to your environment::
 
231
 
 
232
   unzip creds/nova.zip
 
233
   echo ". creds/novarc" >> ~/.bashrc
 
234
   ~/.bashrc
 
235
 
 
236
 
 
237
Step 6 Restart all relevant services
 
238
------------------------------------
 
239
 
 
240
Restart Libvirt::
 
241
 
 
242
   sudo /etc/init.d/libvirt-bin restart
 
243
 
 
244
Restart relevant nova services::
 
245
 
 
246
   sudo /etc/init.d/nova-compute restart
 
247
   sudo /etc/init.d/nova-volume restart
 
248
 
 
249
 
 
250
.. todo:: do we still need the content below?
 
251
 
 
252
Bare-metal Provisioning
 
253
-----------------------
 
254
 
 
255
To install the base operating system you can use PXE booting.
 
256
 
 
257
Types of Hosts
 
258
--------------
 
259
 
 
260
A single machine in your cluster can act as one or more of the following types
 
261
of host:
 
262
 
 
263
Nova Services
 
264
 
 
265
* Network
 
266
* Compute
 
267
* Volume
 
268
* API
 
269
* Objectstore
 
270
 
 
271
Other supporting services
 
272
 
 
273
* Message Queue
 
274
* Database (optional)
 
275
* Authentication database (optional)
 
276
 
 
277
Initial Setup
 
278
-------------
 
279
 
 
280
* Networking
 
281
* Cloudadmin User Creation
 
282
 
 
283
Deployment Technologies
 
284
-----------------------
 
285
 
 
286
Once you have machines with a base operating system installation, you can deploy
 
287
code and configuration with your favorite tools to specify which machines in
 
288
your cluster have which roles:
 
289
 
 
290
* Puppet
 
291
* Chef