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

Commit 526a662

Browse files
authored
MAGECLOUD-3054: Implement Database Locks using Zookeeper and flock fo… (#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
1 parent b4a42d3 commit 526a662

File tree

7 files changed

+66
-42
lines changed

7 files changed

+66
-42
lines changed

_data/toc/installation-guide.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ pages:
258258
- label: Update the Magento database schema and data
259259
url: /install-gde/install/cli/install-cli-subcommands-db-upgr.html
260260

261+
- label: Configure the lock provider
262+
url: /install-gde/install/cli/install-cli-subcommands-lock.html
263+
include_versions: ["2.2","2.3"]
264+
261265
- label: Configure the store
262266
url: /install-gde/install/cli/install-cli-subcommands-store.html
263267

guides/v2.1/install-gde/install/cli/install-cli-subcommands.md

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,4 @@ Database (simplest way is to use magento setup:upgrade)|
5555
{% include install/cli_help-commands.md %}
5656

5757
## Common arguments {#instgde-cli-subcommands-common}
58-
{% include install/cli_common-commands.md %}
59-
60-
## Commands {#instgde-cli-subcommands}
61-
62-
The following sections discuss the available commands.
63-
64-
* [Installing the Magento software using the command line]({{ page.baseurl }}/install-gde/install/cli/install-cli-install.html)
65-
* [Remove sample data modules or update sample data]({{ page.baseurl }}/install-gde/install/cli/install-cli-sample-data-other.html)
66-
* [Enable or disable modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-enable.html)
67-
* [Display or change the Admin URI]({{ page.baseurl }}/install-gde/install/cli/install-cli-adminurl.html)
68-
* [Uninstall modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-mods.html)
69-
* [Create or update the deployment configuration]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html)
70-
* [Enable or disable maintenance mode]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-maint.html)
71-
* [Create the Magento database schema]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html)
72-
* [Update the Magento database schema and data]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db-upgr.html)
73-
* [Configure the store]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-store.html)
74-
* [Create or unlock a Magento administrator]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-admin.html)
75-
* [Back up and roll back the file system, media, and database]({{ page.baseurl }}/install-gde/install/cli/install-cli-backup.html)
76-
* [Uninstall themes]({{ page.baseurl }}/install-gde/install/cli/install-cli-theme-uninstall.html)
77-
* [Uninstall language packages]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-langpk.html)
78-
* [Uninstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-uninstall)
79-
* [Update the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-update)
80-
* [Reinstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-reinstall)
58+
{% include install/cli_common-commands.md %}

guides/v2.2/config-guide/prod/config-reference-envphp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ The `env.php` file contains the following sections:
2121
| `cache_types` | Cache storage settings |
2222
| `install` | The installation date |
2323
| `queue` | [Message queues][message-queues] settings |
24+
| `lock` | Lock provider settings |
25+
2426

2527
[x-frame-options]: {{ page.baseurl }}/config-guide/secy/secy-xframe.html
2628
[magento-mode]: {{ page.baseurl }}/config-guide/bootstrap/magento-modes.html

guides/v2.2/install-gde/install/cli/install-cli-install.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,17 @@ In Magento Commerce version 2.2.8 and later, you can create the Magento admin us
122122
|`--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|
123123

124124

125+
**Lock configuration options**
126+
127+
|Name|Value|Required?|
128+
|--- |--- |--- |
129+
|`--lock-provider`|Lock provider name.<br><br>Available lock providers: `db`, `zookeeper`, `file`.<br><br>The default lock provider: `db`|No|
130+
|`--lock-db-prefix`|The specific db prefix to avoid lock conflicts when using `db` lock provider.<br><br>The default value: `NULL`|No|
131+
|`--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`|
132+
|`--lock-zookeeper-path`|The path where Zookeeper will save locks.<br><br>The default path is: `/magento/locks`|No|
133+
|`--lock-file-path`|The path where file locks will be saved.|Yes, if you set `--lock-provider=file`|
134+
{:style="table-layout:auto;"}
135+
125136
{:.bs-callout .bs-callout-info}
126137
To enable or disable modules after installing Magento, see [Enable and disable modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-enable.html).
127138

@@ -247,21 +258,3 @@ Messages like the following display if the installation is successful:
247258
This type of setup is typical for shared hosting.
248259
* [Verify the installation]({{ page.baseurl }}/install-gde/install/verify.html).
249260
250-
#### Related topics
251-
252-
* [Remove sample data modules or update sample data]({{ page.baseurl }}/install-gde/install/cli/install-cli-sample-data-other.html)
253-
* [Display or change the Admin URI]({{ page.baseurl }}/install-gde/install/cli/install-cli-adminurl.html)
254-
* [Enable or disable modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-enable.html)
255-
* [Uninstall modules]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-mods.html)
256-
* [Create or update the deployment configuration]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html)
257-
* [Enable or disable maintenance mode]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-maint.html)
258-
* [Create the Magento database schema]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html)
259-
* [Update the Magento database schema and data]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db-upgr.html)
260-
* [Configure the store]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-store.html)
261-
* [Create a Magento administrator]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-admin.html)
262-
* [Back up and roll back the file system, media, and database]({{ page.baseurl }}/install-gde/install/cli/install-cli-backup.html)
263-
* [Uninstall themes]({{ page.baseurl }}/install-gde/install/cli/install-cli-theme-uninstall.html)
264-
* [Uninstall language packages]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall-langpk.html)
265-
* [Uninstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-uninstall)
266-
* [Update the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-update)
267-
* [Reinstall the Magento software]({{ page.baseurl }}/install-gde/install/cli/install-cli-uninstall.html#instgde-install-magento-reinstall)

guides/v2.2/install-gde/install/cli/install-cli-subcommands-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following table discusses the meanings of installation parameters and values
4848
|`--db-user`|Username of the Magento database instance owner.<br><br>Default is `root`.|No|
4949
|`--db-password`|Magento database instance owner's password.|No|
5050
|`--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|
51-
|`--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|
51+
|`--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|
5252
|`--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|
5353
|`--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|
5454
|`--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|
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
group: installation-guide
3+
title: Configure the lock provider
4+
functional_areas:
5+
- Install
6+
- System
7+
- Setup
8+
---
9+
10+
## First steps {#instgde-cli-before}
11+
{% include install/first-steps-cli.md %}
12+
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).
13+
14+
## Prerequisites {#instgde-cli-subcommands-store-prereq}
15+
16+
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):
17+
18+
* [Create or update the deployment configuration]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-deployment.html)
19+
* [Create the Magento database schema]({{ page.baseurl }}/install-gde/install/cli/install-cli-subcommands-db.html)
20+
21+
{% include install/fully-secure.md %}
22+
23+
## Configure the lock {#instgde-cli-lockconfig}
24+
25+
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.)
26+
27+
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.
28+
29+
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).
30+
31+
> Command usage
32+
33+
```bash
34+
magento setup:store-config:set [--<parameter_name>=<value>, ...]
35+
```
36+
37+
> Parameter descriptions
38+
39+
|Name|Value|Required?|
40+
|--- |--- |--- |
41+
|`--lock-provider`|Lock provider name: `db`, `zookeeper`, or `file`.<br><br>The default lock provider: `db`|No|
42+
|`--lock-db-prefix`|The specific db prefix to avoid lock conflicts when using the `db` lock provider.<br><br>The default value: `NULL`|No|
43+
|`--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`|
44+
|`--lock-zookeeper-path`|The path where Zookeeper saves locks.<br><br>The default path is: `/magento/locks`|No|
45+
|`--lock-file-path`|The path where file locks are saved.|Yes, if you set `--lock-provider=file`|
46+
{:style="table-layout:auto;"}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../v2.2/install-gde/install/cli/install-cli-subcommands-lock.md

0 commit comments

Comments
 (0)