Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
MAGECLOUD-3054: Implement Database Locks using Zookeeper and flock fo… (
Browse files Browse the repository at this point in the history
#4409)

* MAGECLOUD-3054: Implement Database Locks using Zookeeper and flock for Reliable HA Support
- Added instructions for configuring the lock provider
- Update Installation Guide TOC
- Remove related topics list
- Added symlink for 2.3 lock provider file
- Removed manually-created links to command topics which are available in toc
- Changed toc scope for lock provider topic to exclude v2.1
  • Loading branch information
meker12 authored May 7, 2019
1 parent b4a42d3 commit 526a662
Showing 7 changed files with 66 additions and 42 deletions.
4 changes: 4 additions & 0 deletions _data/toc/installation-guide.yml
Original file line number Diff line number Diff line change
@@ -258,6 +258,10 @@ pages:
- label: Update the Magento database schema and data
url: /install-gde/install/cli/install-cli-subcommands-db-upgr.html

- label: Configure the lock provider
url: /install-gde/install/cli/install-cli-subcommands-lock.html
include_versions: ["2.2","2.3"]

- label: Configure the store
url: /install-gde/install/cli/install-cli-subcommands-store.html

24 changes: 1 addition & 23 deletions guides/v2.1/install-gde/install/cli/install-cli-subcommands.md
Original file line number Diff line number Diff line change
@@ -55,26 +55,4 @@ Database (simplest way is to use magento setup:upgrade)|
{% include install/cli_help-commands.md %}

## Common arguments {#instgde-cli-subcommands-common}
{% include install/cli_common-commands.md %}

## Commands {#instgde-cli-subcommands}

The following sections discuss the available commands.

* [Installing the Magento software using the command line]({{ page.baseurl }}/install-gde/install/cli/install-cli-install.html)
* [Remove sample data modules or update sample data]({{ page.baseurl }}/install-gde/install/cli/install-cli-sample-data-other.html)
* [Enable or disable modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-enable.html)
* [Display or change the Admin URI]({{ page.baseurl }}/install-gde/install/cli/install-cli-adminurl.html)
* [Uninstall modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-mods.html)
* [Create or update the deployment configuration]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html)
* [Enable or disable maintenance mode]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-maint.html)
* [Create the Magento database schema]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html)
* [Update the Magento database schema and data]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db-upgr.html)
* [Configure the store]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-store.html)
* [Create or unlock a Magento administrator]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-admin.html)
* [Back up and roll back the file system, media, and database]({{ page.baseurl }}/install-gde/install/cli/install-cli-backup.html)
* [Uninstall themes]({{ page.baseurl }}/install-gde/install/cli/install-cli-theme-uninstall.html)
* [Uninstall language packages]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-langpk.html)
* [Uninstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-uninstall)
* [Update the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-update)
* [Reinstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-reinstall)
{% include install/cli_common-commands.md %}
2 changes: 2 additions & 0 deletions guides/v2.2/config-guide/prod/config-reference-envphp.md
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@ The `env.php` file contains the following sections:
| `cache_types` | Cache storage settings |
| `install` | The installation date |
| `queue` | [Message queues][message-queues] settings |
| `lock` | Lock provider settings |


[x-frame-options]: {{ page.baseurl }}/config-guide/secy/secy-xframe.html
[magento-mode]: {{ page.baseurl }}/config-guide/bootstrap/magento-modes.html
29 changes: 11 additions & 18 deletions guides/v2.2/install-gde/install/cli/install-cli-install.md
Original file line number Diff line number Diff line change
@@ -122,6 +122,17 @@ In Magento Commerce version 2.2.8 and later, you can create the Magento admin us
|`--amqp-ssl`|{{site.data.var.ee}} only. Indicates whether to connect to RabbitMQ. The default is `false`. See RabbitMQ for information about setting up SSL for RabbitMQ.|No|


**Lock configuration options**

|Name|Value|Required?|
|--- |--- |--- |
|`--lock-provider`|Lock provider name.<br><br>Available lock providers: `db`, `zookeeper`, `file`.<br><br>The default lock provider: `db`|No|
|`--lock-db-prefix`|The specific db prefix to avoid lock conflicts when using `db` lock provider.<br><br>The default value: `NULL`|No|
|`--lock-zookeeper-host`|Host and port to connect to Zookeeper cluster when you use `zookeeper` lock provider.<br><br>For example: `127.0.0.1:2181`|Yes, if you set `--lock-provider=zookeeper`|
|`--lock-zookeeper-path`|The path where Zookeeper will save locks.<br><br>The default path is: `/magento/locks`|No|
|`--lock-file-path`|The path where file locks will be saved.|Yes, if you set `--lock-provider=file`|
{:style="table-layout:auto;"}

{:.bs-callout .bs-callout-info}
To enable or disable modules after installing Magento, see [Enable and disable modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-enable.html).

@@ -247,21 +258,3 @@ Messages like the following display if the installation is successful:
This type of setup is typical for shared hosting.
* [Verify the installation]({{ page.baseurl }}/install-gde/install/verify.html).
#### Related topics
* [Remove sample data modules or update sample data]({{ page.baseurl }}/install-gde/install/cli/install-cli-sample-data-other.html)
* [Display or change the Admin URI]({{ page.baseurl }}/install-gde/install/cli/install-cli-adminurl.html)
* [Enable or disable modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-enable.html)
* [Uninstall modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-mods.html)
* [Create or update the deployment configuration]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html)
* [Enable or disable maintenance mode]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-maint.html)
* [Create the Magento database schema]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html)
* [Update the Magento database schema and data]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db-upgr.html)
* [Configure the store]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-store.html)
* [Create a Magento administrator]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-admin.html)
* [Back up and roll back the file system, media, and database]({{ page.baseurl }}/install-gde/install/cli/install-cli-backup.html)
* [Uninstall themes]({{ page.baseurl }}/install-gde/install/cli/install-cli-theme-uninstall.html)
* [Uninstall language packages]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-langpk.html)
* [Uninstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-uninstall)
* [Update the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-update)
* [Reinstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-reinstall)
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ The following table discusses the meanings of installation parameters and values
|`--db-user`|Username of the Magento database instance owner.<br><br>Default is `root`.|No|
|`--db-password`|Magento database instance owner's password.|No|
|`--db-prefix`|Use only if you're installing the Magento database tables in a database instance that has Magento tables in it already.<br><br>In that case, use a prefix to identify the Magento tables for this installation. Some customers have more than one Magento instance running on a server with all tables in the same database.<br><br>The prefix can be a maximum of five characters in length. It must begin with a letter and can include only letters, numbers, and underscore characters.<br><br>This option enables those customers to share the database server with more than one Magento installation.|No|
|`--session-save`|Use any of the following:<br><br>- `db` to store session data in the [database]({{ page.baseurl }}/extension-dev-guide/cache/partial-caching/database-caching.html). Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.<br><br>- `files` to store session data in the file system. File-based session storage is appropriate unless the Magento file system access is slow, you have a clustered database, or you want to store session data in Redis.<br><br>- `redis` to store session data in [Use Redis for session storage]({{ page.baseurl }}/config-guide/redis/config-redis.html">Redis. If you will be using Redis for default or page caching, Redis must be already installed. |No|
|`--session-save`|Use any of the following:<br><br>- `db` to store session data in the [database]({{ page.baseurl }}/extension-dev-guide/cache/partial-caching/database-caching.html). Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.<br><br>- `files` to store session data in the file system. File-based session storage is appropriate unless the Magento file system access is slow, you have a clustered database, or you want to store session data in Redis.<br><br>- `redis` to store session data in [Use Redis for session storage]({{ page.baseurl }}/config-guide/redis/config-redis.html>Redis. If you will be using Redis for default or page caching, Redis must be already installed. |No|
|`--key`|If you have one, specify a key to encrypt [sensitive data](#sens-data) in the Magento database. If you don't have one, Magento generates one for you.|No|
|`--db-init-statements`|Advanced MySQL configuration parameter. Uses database initialization statements to run when connecting to the MySQL database.<br><br>Default is `SET NAMES utf8;`.<br><br>Consult a reference similar to [this one](http://dev.mysql.com/doc/refman/5.6/en/server-options.html) before you set any values.|No|
|`--http-cache-hosts`|Comma-separated list of HTTP cache gateway hosts to which to send purge requests. (For example, Varnish servers.) Use this parameter to specify the host or hosts to purge in the same request. (It doesn't matter if you have only one host or many hosts.)<br><br>Format must be `<hostname or ip>:<listen port>`, where you can omit `<listen port>` if it's port 80. For example, `--http-cache-hosts=192.0.2.100,192.0.2.155:6081`. Do not separate hosts with a space character.|No|
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
group: installation-guide
title: Configure the lock provider
functional_areas:
- Install
- System
- Setup
---

## First steps {#instgde-cli-before}
{% include install/first-steps-cli.md %}
In addition to the command arguments discussed here, see [Common arguments]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands.html#instgde-cli-subcommands-common).

## Prerequisites {#instgde-cli-subcommands-store-prereq}

Before you run this command, you must do all of the following *or* you must [install the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-install.html):

* [Create or update the deployment configuration]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html)
* [Create the Magento database schema]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html)

{% include install/fully-secure.md %}

## Configure the lock {#instgde-cli-lockconfig}

Configure a lock provider to prevent the launch of duplicate cron jobs and cron groups. (Requires Magento 2.2.5 and later 2.2.x versions or version 2.3.2 and later.)

Magento uses the database to save locks by default. If you have multiple nodes on your Magento Commerce servers, we recommend using Zookeeper as the lock provider.

If you are running Magento Commerce on the cloud infrastructure, you do not need to configure lock provider settings. Magento configures the file lock provider for Magento Commerce Pro projects during the provisioning process. See [Cloud variables]({{ page.baseurl }}/cloud/env/variables-cloud.html).

> Command usage
```bash
magento setup:store-config:set [--<parameter_name>=<value>, ...]
```

> Parameter descriptions
|Name|Value|Required?|
|--- |--- |--- |
|`--lock-provider`|Lock provider name: `db`, `zookeeper`, or `file`.<br><br>The default lock provider: `db`|No|
|`--lock-db-prefix`|The specific db prefix to avoid lock conflicts when using the `db` lock provider.<br><br>The default value: `NULL`|No|
|`--lock-zookeeper-host`|Host and port to connect to the Zookeeper cluster when you use the `zookeeper` lock provider.<br><br>For example: `127.0.0.1:2181`|Yes, if you set `--lock-provider=zookeeper`|
|`--lock-zookeeper-path`|The path where Zookeeper saves locks.<br><br>The default path is: `/magento/locks`|No|
|`--lock-file-path`|The path where file locks are saved.|Yes, if you set `--lock-provider=file`|
{:style="table-layout:auto;"}

0 comments on commit 526a662

Please sign in to comment.