70 Commits

Author SHA1 Message Date
melanie witt
0bf25506b0 Move RABBIT_USERID to lib/rpc_backend
This moves setting of RABBIT_USERID from stack.sh to lib/rpc_backend
so it may be used in grenade runs, which don't have the defaulted
value from stack.sh. The RABBIT_USERID is needed in order to call
get_transport_url in lib/rpc_backend.

Change-Id: I6f211e9102f79418f9f94a15784f91c4150ab8a7
2016-08-31 19:11:33 +00:00
Mehdi Abaakouk
6176ae6895 Use transport_url instead of driver-specif options
Future oslo.messaging is going to deprecate usage of driver-specific
options for hosts/port/user/password options.

This change uses transport_url that exists since a while now and
works with all drivers (even devstack handles only the rabbit one).

Change-Id: I3006b96ff93a3468249177c31c359c2f9ddc5db6
2016-06-02 22:57:51 +00:00
Kyle Mestery
75633266c8 rpc_backend: Conditionally enable rabbit on fedora
Change 4d8c03a3 added logic to enable rabbit on Fedora/CentOS systems
whether or not rabbit is enabled. This corrects that to only enable
rabbit when it is configured as such.

Change-Id: I270e79ff989176770d65df1ac0ac4e2c4382bb9a
Signed-off-by: Kyle Mestery <mestery@mestery.com>
2016-01-07 16:48:14 -06:00
Jenkins
ddeaaf2044 Merge "Enable some serivce when on boot" 2016-01-07 01:38:08 +00:00
Zhang Jinnan
4d8c03a377 Enable some serivce when on boot
Solve the devstack ./rejoin-stack.sh when is reboot-safe in RHEL 7.
Enable mysql, postgresql, rabbitmq-server, openvswitch service when on boot.

Change-Id: I3ce9fc58ccc76092ad08314de1c3c9339ebfb3b5
Related-Bug: #1486833
2016-01-06 16:40:11 +00:00
Ian Wienand
523f488036 Namespace XTRACE commands
I noticed this when debugging some grenade issues failures.

An include of grenade/functions stores the current value of XTRACE
(on) and disables xtrace for the rest of the import.

We then include devstack's "functions" library, which now overwrites
the stored value of XTRACE the current state; i.e. disabled.

When it finishes it restores the prior state (disabled), and then
grenade restores the same value of XTRACE (disabled).

The result is that xtrace is incorrectly disabled until the next time
it just happens to be turned on.

The solution is to name-space the store of the current-value of xtrace
so when we finish sourcing a file, we always restore the tracing value
to what it was when we entered.

Some files had already discovered this.  In general there is
inconsistency around the setting of the variable, and a lot of obvious
copy-paste.  This brings consistency across all files by using
_XTRACE_* prefixes for the sotre/restore of tracing values.

Change-Id: Iba7739eada5711d9c269cb4127fa712e9f961695
2015-11-27 15:36:04 +11:00
Atsushi SAKAI
fe7b56cdef Fix typos for stack.sh and lib of comments and message
Fix 10 comments and 1 message

stack.sh
  Certicate => Certificate (comment)
lib/stack
  Sentinal => Sentinel (comment)
lib/neutron-legacy
  overriden => overridden (comment)
  necesssary => necessary (comment)
  notifiy => notify (message)
  notifations => notifications (comment)
lib/rpc_backend
  orginal => original (comment)
  cofiguration => configuration (comment)
lib/stack
  confgured => configured (comment)
lib/swift
  additinal => additional (comment)
  calclution => calculation (comment)
  maximun => maximum (comment)

Change-Id: I3637388b67decb007cd49af9addecc654009559b
2015-11-13 17:28:05 +09:00
Sean Dague
37eca48970 remove non RabbitMQ messaging
Part of what was decided at summit is devstack needs to return to a
more opinionated stance, the following removes support for non
RabbitMQ messaging. RabbitMQ is used by over 95% of our community
(statistically all of it), so it's a pretty clear line to draw that
this shouldn't be in tree.

iniset_rpc_backend will be our stable hook for other projects that
want to implement this out of tree. The burden on creating those out
of tree plugins will be on those that wish to support those
alternative stacks.

Change-Id: I8073a895c03ec927a2598eff6c2f01e5c82606fc
2015-06-16 08:28:52 -04:00
Tony Breeds
6bc905c348 Change the restart_rpc_backend loop to accomodate async rabbitmq
Some distros have converted to systemd for starting RabbitMQ.  This has
resulted in:
---
[Call Trace]
./stack.sh:904:restart_rpc_backend
/home/stack/projects/openstack/openstack-dev/devstack/lib/rpc_backend:201:die
[ERROR] /home/stack/projects/openstack/openstack-dev/devstack/lib/rpc_backend:201 Failed to set rabbitmq password
Error on exit
World dumping... see /opt/stack/logs/worlddump-2015-05-29-031618.txt for details
---

Because 'restart_service rabbitmq-server' returns before the server is ready to
accept connections.

Alter the retry loop to only restart the rabbitmq-server every second time
through the loop.  Allowing time for the slow rabbit to start.

Closes-Bug: 1449056
Change-Id: Ibb291c1ecfd109f9ed10b5f194933364985cc1ce
2015-06-01 16:23:13 +10:00
Jenkins
e350d3aa53 Merge "Assurance status of rabbitmq is running" 2015-04-17 15:49:12 +00:00
Mehdi Abaakouk
7cf7a8f88f rpc: Allow to configure the rabbitmq heartbeat
For testing we can need to disable or change the rate of the heartbeat
Currently we have to set the value manually in each componments or
to write multiple [[post-config|$<APP>_CONF]] section in local.conf.

This change will allow to configure all componments at once with only two
lines.

Also, we don't set default values to continue to use oslo.messaging
defaults.

Change-Id: Ieaca60ca1cd6d7455b66ce490a9b023df431e9c3
2015-04-09 15:56:44 +02:00
Sean Dague
60996b1b60 introduce pip_install_gr
This creates a new pip_install_gr that installs from global
requirements allowed versions. Now that stable branches are getting
capped all of devstack needs to be fixed to do things like this.

Change-Id: I8fd0ef2bfc544ca2576fab09d3018f760b8848fe
2015-04-08 10:28:17 -04:00
Yuki Nishiwaki
0089035504 Assurance status of rabbitmq is running
I changed it so that rabbitmq always restart.

Current devstack don't restart rabbitmq in case of ubuntu. Because
rabbitmq is running at default.
But this approach have the following bug.
If rabbitmq is already installed and not running ,  stack.sh will
fail.
So I change it so that rabbitmq always restart.

Closes-bug: #1030798
Change-Id: Ie45446d3817b2f15631f03b2af84749fe936c67b
2015-04-07 04:16:25 +00:00
Jenkins
4a640c6847 Merge "Add pluggability for matchmaker-redis" 2015-04-06 23:40:05 +00:00
Dean Troyer
dc97cb71e8 Mostly docs cleanups
Fix documentation build errors and RST formatting

Change-Id: Id93153400c5b069dd9d772381558c7085f64c207
2015-03-28 14:35:12 -05:00
Li Ma
0f20ad41f3 Add pluggability for matchmaker-redis
This commit introduces stevedore to matchmaker-redis:

https://review.openstack.org/#/c/161615/

Change-Id: I547157c02c9e0536add6949910a911540f27fb2d
2015-03-23 23:05:15 -07:00
Joe Gordon
d01ff96e3f Stop using deprecated rabbit related config options
Stop services from throwing the following warning:
  Option "rabbit_password" from group "DEFAULT" is deprecated. Use option
  "rabbit_password" from group "oslo_messaging_rabbit".
Same for rabbit_hosts and rabbit_userid

Change-Id: I7da503ef50b3653b888cb243caa74b4253a495e2
2015-03-23 15:05:39 -07:00
Jenkins
743d03bf7d Merge "iniset_rpc_backend default section" 2015-03-22 02:41:03 +00:00
Brant Knudson
2dd110ce86 iniset_rpc_backend default section
iniset_rpc_backend should know what section it needs to set the
config options in better than the callers. The config options
have actually been moved to different sections and the options
in the DEFAULT section are deprecated.

Change-Id: I0e07fe03c7812ef8df49e126bf71c57588635639
2015-03-14 17:53:54 +00:00
gordon chung
b6197e6ab0 switch to use ceilometermiddleware
swift middleware contained in ceilometer is now deprecated. the
middleware is available in ceilometermiddleware.

Change-Id: I6e41986245f4d95a9385dc7829479ed1199f10ac
2015-03-13 15:41:13 +00:00
Li Ma
c24b399b7e Complete the support of MatchMakerRedis driver
MatchMakerRedis is the only tested routing method
for ZeroMQ driver. For others, like MatchMakerLocalhost
and MatchMakerRing, it still takes some time to work
on and completely test.

MatchMakerRedis is enough to run under real-world
deployment.

Change-Id: I3b2e8e68ceebd377479d75bbb8b862ae60cfc826
Partially-Implements: blueprint zeromq
2015-02-27 21:31:20 -08:00
Jenkins
d26da45b98 Merge "add gating up/down script for devstack" 2015-02-11 20:53:44 +00:00
Mehdi Abaakouk
d1e3ff14b8 qpid: plain auth needs cyrus-sasl-plain package
On fedora 21, qpidd cannot authenticate user, because
cyrus-sasl-plain is no more automatically installed.

This change fixes that.

Change-Id: I74452f40723881291b8c7577e5509da1c0e4e6e5
2015-02-11 14:27:11 +01:00
Sean Dague
9a413abcd4 add gating up/down script for devstack
This adds the test infrastructure for testing that unstack.sh and
clean.sh do the right thing, and actually stop what's expected. This
is designed to be used in upstream testing to make unstack and clean a
bit more certain.

It includes numerous fixes to make these pass in an errexit
environment with the gate config. The scripts still don't run under
errexit because we don't assume we've handled all possible cleanup safely.

Change-Id: I774dfb2cc934367eef2bb7ea5123197f6da7565b
2015-02-11 06:10:38 -05:00
Li Ma
529f8113c2 Fix oslo_messaging package and related object names
Use the latest oslo_messaging package and the related driver names.

Change-Id: I20d4c9286cd2216aa238705f00d8f4537ed91234
2015-01-23 03:10:49 -08:00
Sean Dague
537532931d Make changes such that -o nounset runs
This makes a bunch of variable cleanups that will let -o nounset
function, for the time being we hide nounset behind another setting
variable so that it's not on by default.

Because this is bash, and things are only executed on demand, this
probably only works in the config it was run in. Expect cleaning up
all the paths to be something that takes quite a while.

This also includes a new set of unit tests around the trueorfalse
function, because my change in how it worked, didn't. Tests are good
m'kay.

Change-Id: I71a896623ea9e1f042a73dc0678ce85acf0dc87d
2015-01-15 13:06:14 -05:00
Li Ma
d3ca1418c4 Fix matchmaker-redis dependencies for zeromq driver
Add an option 'ZEROMQ_MATCHMAKER' to indicate which
matchmaker driver to use.

When it indicates 'redis', the dependencies will be
installed.

Change-Id: I910b48347bad0685ea10083a3b0b243524f32095
Partially-Implements: blueprint zeromq
2015-01-08 07:17:58 +00:00
Li Ma
ce1524d084 Fix proper oslo.messaging object for zeromq driver
Currently, as almost all the rpc driver of projects
have been switched to oslo.messaging, the object should
be imported via oslo.messaging rather than its own rpc lib.

Change-Id: I9633446e78cb5af21f61a26f6fb365a8ed57a85f
Partially-Implements: blueprint zeromq
Closes-Bug: #1395721
2014-12-21 11:43:36 -08:00
Ian Wienand
64b56a53d8 Fix rabbitmq retry for error checking
I think this retry check has been broken since we introduced "set -e".
Unfortunately it seems the issue of rabbitmq not starting first-time
persists on centos 7 hosts occasionally, e.g. [1]:

---
 + rabbit_setuser stackrabbit secretrabbit
 + local user=stackrabbit pass=secretrabbit found= out=
 ++ sudo rabbitmqctl list_users
 Error: unable to connect to node 'rabbit@devstack-centos7-rax-iad-100675': nodedown

 DIAGNOSTICS
 ===========

 nodes in question: ['rabbit@devstack-centos7-rax-iad-100675']

 hosts, their running nodes and ports:
 - devstack-centos7-rax-iad-100675: [{rabbitmqctl29293,39511}]

 current node details:
 - node name: 'rabbitmqctl29293@devstack-centos7-rax-iad-100675'
 - home dir: /var/lib/rabbitmq
 - cookie hash: KieJnx1pnllKbHVihGcDqA==
---

Fix up this retry while we investigate [2]

[1] http://logs.openstack.org/64/141864/1/check//check-tempest-dsvm-centos7/4308f0c/logs/devstacklog.txt.gz
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1144100

Change-Id: I11fb3728e08adc1e0f7acca63e5a308d24dce78e
2014-12-16 10:13:04 +11:00
Abhishek Chanda
d5b74c688f Take an optional rabbit user name as input
Newer versions of rabbitmq (3.3 and later) do not allow the 'guest'
user to access on non-local interfaces.

- Added a new config RABBIT_USERID which defaults to stackrabbit
- Invoked config scripts using that variable

Adopted from:
https://review.openstack.org/#/c/107779/

Change-Id: I43a231c9611b4cc2e390b603aa3bfb49c915bdc5
Closes-Bug: #1343354
Co-Authored-By: Scott Moser <smoser@ubuntu.com>
2014-12-12 02:20:09 +05:30
Sean Dague
e263c82e48 add shebang lines to all lib files
With gerrit 2.8, and the new change screen, this will trigger syntax
highlighting in gerrit. Thus making reviewing code a lot nicer.

Change-Id: Id238748417ffab53e02d59413dba66f61e724383
2014-12-10 11:28:05 -05:00
Kenneth Giusti
062a3c3e70 Configure an authorized user for the QPID broker
If QPID_USERNAME is set, add the user to the QPID broker's
authentication database.  Use the value of QPID_PASSWORD as the
password for the user, prompting for a password if QPID_PASSWORD is
not set.  This requires that all clients provide this username and
password when connecting to the QPID broker, or the connection will be
rejected.

If QPID_USERNAME is not set (the default), disable QPID broker
authentication. This allows any client to connect to the QPID broker
without needing authentication.

Change-Id: Ibd79873379740930ce5f598018c1ca1fffda7c31
Closes-Bug: 1272399
2014-10-01 16:06:52 -04:00
Jenkins
7c11e28cf3 Merge "Re-order stack.sh 3: logging and error traps" 2014-09-29 16:59:33 +00:00
Jenkins
3454209005 Merge "The python-qpid packages must be installed when qpidd is configured" 2014-09-18 05:27:49 +00:00
Kenneth Giusti
a1875b7b67 The python-qpid packages must be installed when qpidd is configured
The python-qpid package is available for Ubuntu trusty, precise, and
all the supported RHEL based platforms.  This package is necessary if
qpidd is configured as the RPC backend.  It is the client API used to
talk to the broker, and must be installed on each system that
communicates with the broker.

Change-Id: I635d3e857aa4b769a80cb7cde405cfd6cae44d32
2014-09-15 14:21:55 -04:00
Dean Troyer
ffd17680d5 Re-order stack.sh 3: logging and error traps
Part 3 of a series

Re-order the setup and check bits in the top portion of stack.sh to
have a logical flow with similar things done together.

No behaviour changes are intended aside from the order of execution.
Any such changes are bugs.

* Move logging and error configuration earlier to cover initial project setup.

Change-Id: Ib16bbe20f224b1cf5e86c7a2fda0d9472c108873
2014-09-13 18:18:43 -05:00
Kenneth Giusti
7e58c06a06 Add an option to enable version 1.0 of the AMQP messaging protocol
This change adds the RPC_MESSAGING_PROTOCOL configuration option that
selects the messaging protocol that is used by the RPC backend and
client.

Some brokers can support different kinds of 'on the wire' messaging
protocols.  Qpid, for example, supports both AMQP 0-10 (the default),
and AMQP 1.0.  Use the RPC_MESSAGING_PROTOCOL configuration variable
to override the default protocol for those brokers that support
multiple protocol options.

This new option is necessary in order to enable the new AMQP 1.0
oslo.messaging transport as described in the blueprint.

Note well: currently this AMQP 1.0 functionality is only available on
fedora 19+ platforms.  Support is WIP on ubuntu/debian and rhel/centos
7. Enabling the RPC_MESSAGING_PROTOCOL option on an unsupported
platform will cause devstack to exit with an approriate error
message.

Change-Id: Ib8dea59922844e87d6c947b5dca557f5b5fc1160
Implements: blueprint amqp10-driver-implementation
2014-09-10 14:53:01 -04:00
Dean Troyer
3ef23bceec Clean up local variable usage - Backends
Combines cleanup for mysql, postgresql and rpc

Change-Id: I37b928a669146671c946fc1ccb8e3ef1a27a3891
2014-07-25 16:24:00 -05:00
Ian Wienand
7ccf4e025a Remove output filter on rabbitmq install
The original workaround was for an init script that grabbed stdout.
This was some time ago and I think it's safe to remove.

It can be a problem on Fedora; out-of-the-box some old F20 images can
have a broken dependency when rabbitmq installs.  With this in place,
all helpful output goes into the temp log file, but it is never shown
because the install_packages function exits the script.  Thus things
just stop and you have no idea why.

Change-Id: I2f5b934492a8c9d7b93e89fdcfa776bf15f25cb8
2014-07-23 14:24:11 +10:00
Nicolas Simonds
8f084c6b85 use "rabbit_hosts" config option instead of "rabbit_host"
This allows for easy client configuration against clustered RabbitMQ
setups.  Does not break existing configs.

Change-Id: I2b180f8860a727e35d7b465253689e5e8c44eb98
Closes-Bug: 1286411
2014-02-28 17:03:34 -08:00
Ian Wienand
aee18c749b Enforce function declaration format in bash8
Check that function calls look like ^function foo {$ in bash8, and fix
all existing failures of that check.  Add a note to HACKING.rst

Change-Id: Ic19eecb39e0b20273d1bcd551a42fe400d54e938
2014-02-28 07:59:03 +11:00
Sahid Orentino Ferdjaoui
e9648276a6 Removes the dependence with aptitude
Removes the dependence with aptitude by replacing
the call of:
  aptitude purge -y ~npackage by apt_get purge -y package*

Change-Id: I08875ffad9dc6293047827666f02453a355b16ea
Closes-Bug: 1281410
2014-02-24 09:41:07 +01:00
Ben Nemec
ec5918f2f6 Retry rabbitmq password change
Due to the bug referenced below, on Fedora it is possible for
the rabbitmq password change to fail the first time rabbitmq is
started.  This change adds a retry loop to avoid the problem in
devstack.  One retry should be enough in most (all?) cases, but
this will retry up to ten times just to be safe.

Note that just retrying the password change is not enough.  The
rabbitmq-server service must be restarted as well.

Change-Id: I403dcd503aa8e74e2ba6312a0decf0d4fd0d8795
bz: https://bugzilla.redhat.com/show_bug.cgi?id=1059028
2014-01-30 18:53:19 +00:00
Sean Dague
2bb483d32e clean up ubuntu versions
oneiric is long dead, remove references to it whenever possible
(one more subtle issue in cinder should be a seperate patch). This
includes removing the oneiric only tool build_uec.sh.

also remove the bulk of references to quantal, which is 8 months
out of support. note: raring only has support for the rest of the
month.

Change-Id: Ib17502be7572af76dc95560615221b48b970a547
2014-01-11 19:13:47 -05:00
Adam Spiers
6a5aa7c6a2 Fix some Markdown formatting issues
Address miscellaneous issues with Markdown formatting in comments which
are consumed by shocco when generating the online documentation.

Change-Id: I953075cdbddbf1f119c6c7e35f039e2e54b79078
2013-10-24 17:38:19 +01:00
Sean Dague
101b424842 fix whitespace in the rest of lib/*
this brings this in line with bash8 checker

Change-Id: Ib34a2292dd5bc259069457461041ec9cd4fd2957
2013-10-22 13:02:23 -04:00
Jenkins
677f225091 Merge "remove useless step in cleanup_rpc_backend" 2013-10-18 05:01:08 +00:00
Jenkins
f31efd89c7 Merge "refine rabbit cleanup" 2013-10-18 04:43:39 +00:00
DennyZhang
557744faec refine rabbit cleanup
Beside it's good to killall -9 epmd,
if killall epmd fails

Change-Id: Ide90ef8ac3339bd70d991666ce0d3550a088670b
2013-10-14 12:21:29 -05:00
DennyZhang
c7a92800c9 remove useless step in cleanup_rpc_backend
It shall not make dir of /var/run/openstack for the cleanup operation.

install_rpc_backend will make the directory, which is covered by another
take care of this.

Change-Id: I2bf1bfb4a6b409cc04f2d7b94dd58627e0134b71
2013-10-14 00:51:19 -05:00