Last modified: 2014-10-24 14:45:23 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T38422, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 36422 - easily reload all apaches
easily reload all apaches
Status: RESOLVED FIXED
Product: Wikimedia Labs
Classification: Unclassified
deployment-prep (beta) (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 37081
  Show dependency treegraph
 
Reported: 2012-05-02 11:47 UTC by Antoine "hashar" Musso (WMF)
Modified: 2014-10-24 14:45 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2012-05-02 11:47:37 UTC
When doing Apache configurations changes on deployment-web* machines, we need to restart every apache2 process.  There is no easy way to do it right now.
Comment 1 Sam Reed (reedy) 2012-05-02 13:15:18 UTC
Fenari has a script for doing this: /home/wikipedia/bin/apache-graceful-all

No point reinventing the wheel
Comment 2 Peter Bena 2012-05-02 13:50:06 UTC
It's cool fenari has it, but as long as it's not open source which is publicly available it's not of much use...
Comment 3 Peter Bena 2012-05-02 13:50:36 UTC
it doesn't really need to be open source, but if that code was public it would be enough
Comment 4 Sam Reed (reedy) 2012-05-02 13:54:24 UTC
http://noc.wikimedia.org/~reedy/apache-graceful-all

http://noc.wikimedia.org/~reedy/apache-graceful

http://noc.wikimedia.org/~reedy/apache-sanity-check


(In reply to comment #2)
> It's cool fenari has it, but as long as it's not open source which is publicly
> available it's not of much use...

It was directed at Antoine, as he does
Comment 5 Sam Reed (reedy) 2012-05-02 13:55:42 UTC
Bleh, this is a crappy script dependency tree...
Comment 6 Antoine "hashar" Musso (WMF) 2012-05-02 14:01:40 UTC
The problem is not that much about having the apache-graceful scripts but more about setting up a system that would let us ssh on the other hosts.

Currently dsh is of no use :-/
Comment 7 Antoine "hashar" Musso (WMF) 2012-05-24 11:21:38 UTC
We might want to import/reuse the apache* production scripts in /home/wikipedia/bin
Comment 8 Platonides 2012-05-29 22:00:35 UTC
We should first have a list of all apaches. Maybe there's a ldap magic command we could use?
Comment 9 Antoine "hashar" Musso (WMF) 2012-05-30 08:01:26 UTC
dsh does support netgroups which could be provided through LDAP.  But that would require a LDAP schema change.

Meanwhile, we will have to edit and maintain some flat file in /etc/dsh/group or something.
Comment 10 Damian Z 2012-10-11 09:26:50 UTC
Pulling the data from LDAP into a static file via a script could work. In theory you could do it based off puppet classes, for not-yet-puppetized things you'd have to go off hostname formats or such.

Assuming you don't mind forwarding keys to the deployment 'bastion' host allowing ssh should be possible. The alternative would be to look at using Salt once there is an API in place to allow authentication via Nova (I believe production is moving towards Salt for deployment anyway).
Comment 11 jeremyb 2013-02-25 04:30:26 UTC
I'm not sure what the current state of salt in labs is but this seems like a perfect case to use salt.
Comment 12 Antoine "hashar" Musso (WMF) 2013-03-16 21:59:21 UTC
Asked salt status in labs on the labs mailing list: http://permalink.gmane.org/gmane.org.wikimedia.labs/1077
Comment 13 Bryan Davis 2014-03-13 14:21:17 UTC
Ryan and I are working on adding a dedicated salt master for the beta cluster. When this is doing it should be fairly trivial to implement a script that will tell each apache host to perform a graceful restart.
Comment 14 Bryan Davis 2014-03-21 20:07:08 UTC
The eqiad instances of deployment-prep now have a local salt master. I'll take a stab at making this a reality.
Comment 15 Bryan Davis 2014-04-06 22:12:08 UTC
Salt has a built in module for communicating with apache [0]. Our puppet configuration now creates a salt grain for each system role [1]. Putting the two of these together allows us to send all apaches acting as application servers a restart signal from deployment-salt.eqiad.wmflabs:

    sudo salt -G 'rolename:role::applicationserver::appserver::beta' apache.signal restart


All apache instances across the whole beta cluster could be restarted as well:

    sudo salt -G '*' apache.signal restart


[0]: http://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.apache.html
[1]: https://gerrit.wikimedia.org/r/#/c/107831/
Comment 16 Antoine "hashar" Musso (WMF) 2014-04-11 12:35:11 UTC
Great!  Would it be worth adding a few shell wrappers such as:

 beta-apaches (restart|reload|graceful|stop|start) ?

Not sure if it is worth it, but sounds easier to remember than the salt command.
Comment 17 Gerrit Notification Bot 2014-04-14 21:54:58 UTC
Change 125888 had a related patch set uploaded by BryanDavis:
beta: New script to restart apaches

https://gerrit.wikimedia.org/r/125888
Comment 18 Gerrit Notification Bot 2014-07-22 13:11:50 UTC
Change 125888 merged by Alexandros Kosiaris:
beta: New script to restart apaches

https://gerrit.wikimedia.org/r/125888
Comment 19 Bryan Davis 2014-08-19 21:41:52 UTC
My patch was merged, but puppet<->salt integration is disabled/broken due to race conditions that occur when new instances are added and need their salt client certs to be accepted on the salt master.
Comment 20 Antoine "hashar" Musso (WMF) 2014-10-24 14:45:23 UTC
Seems it is fixed now :)  Thank you Bryan.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links