Page MenuHomePhabricator

Configure phabricator clustering for daemons and repositories
Open, Stalled, MediumPublic

Description

Now that we have phab2001.codfw.wmnet up and running, we need to properly configure phabricator for repository replication and clustered task daemons.

Event Timeline

When cluster config is done we need to undo f528c2779e84 so that phd will run on both phabricator nodes.

When I initially attempted to set this up, I ran into an issue with almanac: it's not possible to remove devices from service bindings using the almanac UI. You have to use bin/remove destroy $PHID with a phid obtained from the almanac.search conduit api call.

Disabling clustered repo service entirely involves doing the same bin/remove trick but with the service phid rather than the binding phid.

Inquiring about this issue resulted in this upstream bug report: https://secure.phabricator.com/T11534

mmodell lowered the priority of this task from High to Medium.Apr 11 2017, 12:47 PM
mmodell changed the task status from Open to Stalled.Jun 6 2017, 9:09 AM

Following @Dzahn last message on https://gerrit.wikimedia.org/r/#/c/324841/3 , continuing here.

I've quickly reviewed Phabricator documentation and the change and the sudo requirement seems to be limited to run ssh and git as the Phabricator daemon-user, not as root. The commit message was a bit misleading and I might have missed the phd_user there, apologies.

Anyway can we also make it use keyholder to use an ssh key with passphrase and removing access to the private key to the Phabricator users?
Keyholder is the standard in our infrastructure for intra-host ssh, AFAIK.

As per the obvious concerns about www-data being able to ssh as the Phabricator daemon_user, that seems to be a hard requirement on Phabricator side in order to enable the clustering unfortunately. I'd like @MoritzMuehlenhoff to comment on this too, in the end is a trade off between security and high availability.
Is not fully clear to me right now in the single host configuration what kind of access has www-data to the repositories data. The sudo line seems limited to git-upload-pack and git-receive-pack.

Is not fully clear to me right now in the single host configuration what kind of access has www-data to the repositories data. The sudo line seems limited to git-upload-pack and git-receive-pack.

@Volans: also git-http-backend:

www-data ALL=(phd) SETENV: NOPASSWD: /usr/local/bin/git-http-backend

Additionally, www-data has direct (read-only) access to /srv/repos/ as the files are world readable on disk.