From 526a662372066553f40e0f3c118c15ba90d7dbdf Mon Sep 17 00:00:00 2001 From: Margaret Eker Date: Tue, 7 May 2019 09:18:35 -0500 Subject: [PATCH] =?UTF-8?q?MAGECLOUD-3054:=20Implement=20Database=20Locks?= =?UTF-8?q?=20using=20Zookeeper=20and=20flock=20fo=E2=80=A6=20(#4409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- _data/toc/installation-guide.yml | 4 ++ .../install/cli/install-cli-subcommands.md | 24 +--------- .../prod/config-reference-envphp.md | 2 + .../install/cli/install-cli-install.md | 29 +++++------- .../cli/install-cli-subcommands-deployment.md | 2 +- .../cli/install-cli-subcommands-lock.md | 46 +++++++++++++++++++ .../cli/install-cli-subcommands-lock.md | 1 + 7 files changed, 66 insertions(+), 42 deletions(-) create mode 100644 guides/v2.2/install-gde/install/cli/install-cli-subcommands-lock.md create mode 120000 guides/v2.3/install-gde/install/cli/install-cli-subcommands-lock.md diff --git a/_data/toc/installation-guide.yml b/_data/toc/installation-guide.yml index 61391ed6083..4e41e2fd4ff 100644 --- a/_data/toc/installation-guide.yml +++ b/_data/toc/installation-guide.yml @@ -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 diff --git a/guides/v2.1/install-gde/install/cli/install-cli-subcommands.md b/guides/v2.1/install-gde/install/cli/install-cli-subcommands.md index de1ba9bda79..2cd84de2255 100644 --- a/guides/v2.1/install-gde/install/cli/install-cli-subcommands.md +++ b/guides/v2.1/install-gde/install/cli/install-cli-subcommands.md @@ -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 %} \ No newline at end of file diff --git a/guides/v2.2/config-guide/prod/config-reference-envphp.md b/guides/v2.2/config-guide/prod/config-reference-envphp.md index f8980676995..0ed61ad47cf 100644 --- a/guides/v2.2/config-guide/prod/config-reference-envphp.md +++ b/guides/v2.2/config-guide/prod/config-reference-envphp.md @@ -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 diff --git a/guides/v2.2/install-gde/install/cli/install-cli-install.md b/guides/v2.2/install-gde/install/cli/install-cli-install.md index 74bc1d5e0d4..c500e259786 100644 --- a/guides/v2.2/install-gde/install/cli/install-cli-install.md +++ b/guides/v2.2/install-gde/install/cli/install-cli-install.md @@ -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.

Available lock providers: `db`, `zookeeper`, `file`.

The default lock provider: `db`|No| +|`--lock-db-prefix`|The specific db prefix to avoid lock conflicts when using `db` lock provider.

The default value: `NULL`|No| +|`--lock-zookeeper-host`|Host and port to connect to Zookeeper cluster when you use `zookeeper` lock provider.

For example: `127.0.0.1:2181`|Yes, if you set `--lock-provider=zookeeper`| +|`--lock-zookeeper-path`|The path where Zookeeper will save locks.

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) diff --git a/guides/v2.2/install-gde/install/cli/install-cli-subcommands-deployment.md b/guides/v2.2/install-gde/install/cli/install-cli-subcommands-deployment.md index 6f6bc1af661..c921dbe1aab 100644 --- a/guides/v2.2/install-gde/install/cli/install-cli-subcommands-deployment.md +++ b/guides/v2.2/install-gde/install/cli/install-cli-subcommands-deployment.md @@ -48,7 +48,7 @@ The following table discusses the meanings of installation parameters and values |`--db-user`|Username of the Magento database instance owner.

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.

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.

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.

This option enables those customers to share the database server with more than one Magento installation.|No| -|`--session-save`|Use any of the following:

- `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.

- `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.

- `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:

- `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.

- `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.

- `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.

Default is `SET NAMES utf8;`.

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.)

Format must be `:`, where you can omit `` 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| diff --git a/guides/v2.2/install-gde/install/cli/install-cli-subcommands-lock.md b/guides/v2.2/install-gde/install/cli/install-cli-subcommands-lock.md new file mode 100644 index 00000000000..45095fa09d7 --- /dev/null +++ b/guides/v2.2/install-gde/install/cli/install-cli-subcommands-lock.md @@ -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 descriptions + +|Name|Value|Required?| +|--- |--- |--- | +|`--lock-provider`|Lock provider name: `db`, `zookeeper`, or `file`.

The default lock provider: `db`|No| +|`--lock-db-prefix`|The specific db prefix to avoid lock conflicts when using the `db` lock provider.

The default value: `NULL`|No| +|`--lock-zookeeper-host`|Host and port to connect to the Zookeeper cluster when you use the `zookeeper` lock provider.

For example: `127.0.0.1:2181`|Yes, if you set `--lock-provider=zookeeper`| +|`--lock-zookeeper-path`|The path where Zookeeper saves locks.

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;"} diff --git a/guides/v2.3/install-gde/install/cli/install-cli-subcommands-lock.md b/guides/v2.3/install-gde/install/cli/install-cli-subcommands-lock.md new file mode 120000 index 00000000000..8b58df9d41d --- /dev/null +++ b/guides/v2.3/install-gde/install/cli/install-cli-subcommands-lock.md @@ -0,0 +1 @@ +../../../../v2.2/install-gde/install/cli/install-cli-subcommands-lock.md \ No newline at end of file