Skip to content

Magento 2 Recipe: Use roles to execute DB tasks only on one server #3800

@dverkade

Description

@dverkade

Description

Have a Magento 2 deployment with 4 webservers. 3 webservers serve traffic for users. 1 webserver is used for the backend of Magento. Database, Redis, Elasticsearch / Opensearch is on a separate server.

Current situation

When deploying the setup:upgrade command runs on all 4 webservers

Expected situation

I've defined the roles in the hosts configuration. The "DB" role is only set on the server used for the Magento backend. I expect the setup:upgrade command and other DB related commands to be run on the server with the "DB" role only. Servers without that role should skip the step.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions