Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions _includes/cloud/pretty-print-services.md

This file was deleted.

21 changes: 13 additions & 8 deletions guides/v2.2/cloud/project/project-conf-files_magento-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,22 @@ access:

### `relationships`

Defines the service mapping in your application.
Defines the service mapping in the application.

The left-hand side is the name of the relationship as it will be exposed to the application in the `MAGENTO_CLOUD_RELATIONSHIPS` environment variable. The right-hand side is in the form `<service-name>:<endpoint-name>`, where `<service-name>` comes from `.magento/services.yaml` and `<endpoint-name>` should be the same as the value of `type` declared in that same file.

Example of valid options are:
The relationship `name` is available to the application in the `MAGENTO_CLOUD_RELATIONSHIPS` environment variable. The `<service-name>:<endpoint-name>` relationship maps to the name and type values defined in the `.magento/services.yaml` file.

```yaml
relationships:
<name>: "<service-name>:<endpoint-name>"
```
database: "mysql:mysql"
database2: "mysql2:mysql"
cache: "arediscache:redis"
search: "searchengine:solr"

The following is an example of the default relationships:

```yaml
relationships:
database: "mysql:mysql"
redis: "redis:redis"
elasticsearch: "elasticsearch:elasticsearch"
```

See [Services]({{page.baseurl}}/cloud/project/project-conf-files_services.html) for a full list of currently supported service types and endpoints.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ functional_areas:

For information on how these changes affect your environments, see [Services]({{ page.baseurl }}/cloud/project/project-conf-files_services.html).

1. [Verify the relationships](#verify-relationships) and configure Elasticsearch in the Admin UI.
1. [Verify the relationships]({{page.baseurl}}/cloud/project/project-conf-files_services.html#service-relationships) and configure Elasticsearch in the Admin UI.

### Add Elasticsearch plugins

Expand Down Expand Up @@ -80,11 +80,5 @@ See [Elasticsearch plugin documentation](https://www.elastic.co/guide/en/elastic
{:.bs-callout-info}
If you use the ElasticSuite third-party plugin, you must [update the `{{site.data.var.ct}}` package]({{page.baseurl}}/cloud/project/ece-tools-update.html) to version 2002.0.19 or later.

## Verify relationships

{{site.data.var.ece}} uses the [MAGENTO_CLOUD_RELATIONSHIPS]({{ page.baseurl }}/cloud/env/variables-cloud.html) variable to retrieve the environment-related relationships. You must use this information when you [configure Elasticsearch through the Magento Admin]({{page.baseurl}}/config-guide/elasticsearch/configure-magento.html).

{% include cloud/pretty-print-services.md %}

{: .bs-callout-warning}
Staging and Production environments that are in the same cluster share a single Elasticsearch instance, so you must specify a unique Elasticsearch prefix for each of these environments.
92 changes: 54 additions & 38 deletions guides/v2.2/cloud/project/project-conf-files_services-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,77 @@ functional_areas:
- Setup
---

The `mysql` service provides data storage. It is based on [MariaDB](https://mariadb.com/), supporting the [XtraDB](https://www.percona.com/software/mysql-database/percona-server/xtradb) storage engine (equivalent to MySQL with InnoDB).
The `mysql` service provides persistent data storage. It is based on [MariaDB](https://mariadb.com/), supporting the [XtraDB](https://www.percona.com/software/mysql-database/percona-server/xtradb) storage engine.

We support MariaDB version 10.0, which includes reimplemented features from MySQL 5.6 and 5.7.
We support MariaDB version 10.2, which includes reimplemented features from MySQL 5.6 and 5.7.

To access the MariaDB database directly, [open an SSH tunnel]({{ page.baseurl }}/cloud/env/environments-start.html#env-start-tunn) and use the following command:
#### To access the MariaDB database directly:

Using SSH, log in to the remote server and connect to the database.

For Starter:

```bash
mysql -h database.internal -u user
mysql -h database.internal -u <username>
```

{% include cloud/service-config-integration-starter.md %}
For Pro, use the db, username, and password from the relationship:

```bash
mysql -h<db> -p<number> -u<username> -p<password>
```

## Enable MySQL

1. Add the required name, type, and disk value (in MB) to the `.magento/services.yaml` file.

```yaml
mysql:
type: mysql:10.2
disk: 2048
```

1. Configure the relationships in the `.magento.app.yaml` file.

```yaml
relationships:
database: "mysql:mysql"
```

1. Add, commit, and push your code changes.

```bash
git add -A && git commit -m "Enable mysql service" && git push origin <branch-name>
```

1. [Verify the relationships]({{page.baseurl}}/cloud/project/project-conf-files_services.html#service-relationships).

{: .bs-callout-info }
- If you configure one MySQL user, you cannot use the [`DEFINER`](http://dev.mysql.com/doc/refman/5.6/en/show-grants.html) access control mechanism for stored procedures and views.
- MySQL errors such as `PDO Exception 'MySQL server has gone away` are usually the result of exhausting your existing disk space. Be sure you have sufficient space allocated to the service in [`.magento/services.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_magento-app.html#disk).

## Set up multiple database users {#cloud-appyaml-mysqlusers}
## Set up multiple database users

Optionally, you can set up multiple databases as well as multiple users with different permissions.

An _endpoint_ is a user who has privileges you specify. By default, there is one endpoint named `mysql` that has administrator access to all defined databases. To set up multiple databases and users, you must specify multiple endpoints.
An _endpoint_ is a set of credentials (or users) with specific privileges. By default, there is one endpoint named `mysql` that has administrator access to all defined databases. To set up multiple databases and users, you must define multiple endpoints in the services.yaml file and declare the relationships in the .magento.app.yaml file.

{:.bs-callout .bs-callout-warning}
{: .bs-callout-warning}
You cannot use multiple _databases_ with {{site.data.var.ee}} at this time. You **can** create multiple endpoints to restrict access to the `main` database.

To specify user access, use the `endpoints` nested array. Each endpoint can have access to one or more schemas (databases), and can have different levels of permission on each.
Use a nested array to define the endpoints for specific user access. Each endpoint can designate access to one or more schemas (databases) and different levels of permission on each.

The valid permission levels are:

- `ro`: Only SELECT queries are allowed.
- `rw`: SELECT queries as well as INSERT/UPDATE/DELETE queries are allowed.
- `rw`: SELECT queries and INSERT, UPDATE, and DELETE queries are allowed.
- `admin`: All queries are allowed, including DDL queries (CREATE TABLE, DROP TABLE, and so on).

If no endpoints are defined, a single endpoint named `mysql` has `admin` access to the `main` database. For example:

```yaml
mysqldb:
type: mysql:10.0
mysql:
type: mysql:10.2
disk: 2048
configuration:
schemas:
Expand All @@ -55,40 +92,19 @@ mysqldb:
importer:
privileges:
main: rw

```

In the preceding example, the endpoint (that is, user) `reporter` has `ro` privileges to the `main` database and endpoint `importer` has `rw` access to the `main` database. This means that:
In the preceding example, the `admin` endpoint provides admin-level access to the `main` database, the `reporter` endpoint provides read-only access, and the `importer` endpoint provides read-write access. This means that:

- The `admin` user has full control of the database.
- The `repoter` user has SELECT privileges only.
- The `importer` user has SELECT, INSERT, UPDATE, and DELETE privileges.

## Add MySQL in services.yaml and .magento.app.yaml {#settings}

To enable MySQL, add the following code with your installed version and allocated disk space in MB to `.magento/services.yaml`.

```yaml
mysql:
type: mysql:10.0
disk: 2048
```

To configure the relationships for the environment variable, set a relationship in your `.magento.app.yaml` in the Git branch. For example:
You must add the endpoints defined in the above example to the `relationships` property of the `.magento.app.yaml` file. For example:

```yaml
relationships:
database: "mydatabase:mysql"
database: "mysql:admin"
databasereporter: "mysql:reporter"
databaseimporter: "mysql:importer"
```

Merge and deploy the code to set the configurations for Redis. For information on how these changes affect your environments, see [`services.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_services.html).

{: .bs-callout-info }
- If you configure one MySQL user, you cannot use the [`DEFINER`](http://dev.mysql.com/doc/refman/5.6/en/show-grants.html) access control mechanism for stored procedures and views.
- MySQL errors such as `PDO Exception 'MySQL server has gone away` are usually the result of exhausting your existing disk space. Be sure you have sufficient space allocated to the service in [`.magento/services.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_magento-app.html#disk).

## Verify environment-related relationships {#cloud-es-config-mg}

We use the {{site.data.var.ece}} environment variable [`$MAGENTO_CLOUD_RELATIONSHIPS`]({{ page.baseurl }}/cloud/env/environment-vars_cloud.html), a JSON object, to retrieve environment-related relationships.

{% include cloud/pretty-print-services.md %}
12 changes: 1 addition & 11 deletions guides/v2.2/cloud/project/project-conf-files_services-rabbit.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ relationships:

Merge and deploy the code to set the configurations for RabbitMQ. For information on how these changes affect your environments, see [`services.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_services.html).

## Verify environment-related relationships {#cloud-es-config-mg}

We use the {{site.data.var.ece}} environment variable [`$MAGENTO_CLOUD_RELATIONSHIPS`]({{ page.baseurl }}/cloud/env/environment-vars_cloud.html), a JSON object, to retrieve environment-related relationships.

{% include cloud/pretty-print-services.md %}

## Connect to RabbitMQ for debugging {#connect}

For debugging purposes, it is useful to directly connect to a service instance in one of the following ways:
Expand All @@ -68,11 +62,7 @@ You can do this using [SSH tunneling]({{ page.baseurl }}/cloud/env/environments-
magento-cloud tunnel:open
```

1. Pretty-print the relationships. This lets you see which username and password to use, and you can verify the remote service's port.

```bash
php -r 'print_r(json_decode(base64_decode($_ENV["MAGENTO_CLOUD_RELATIONSHIPS"])));'
```
1. [Verify the relationships]({{page.baseurl}}/cloud/project/project-conf-files_services.html#service-relationships).

1. Enable local port forwarding to RabbitMQ.

Expand Down
48 changes: 24 additions & 24 deletions guides/v2.2/cloud/project/project-conf-files_services-redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,40 @@ We support Redis versions 2.8, 3.0, and 5.0. Redis 3.0 supports up to 64 differe

{% include cloud/service-config-integration-starter.md %}

## Add Redis in configuration files {#settings}
## Enable Redis

To enable Redis, add your installed version and allocated disk space in MB to `.magento/services.yaml` file:
1. Add the required name and type to the `.magento/services.yaml` file.

```yaml
myredis:
type: redis:3.0
```
```yaml
redis:
type: redis:3.2
```

To provide your own Redis configuration, add a `core_config` key in your `.magento/services.yaml` file:
To provide your own Redis configuration, add a `core_config` key in your `.magento/services.yaml` file:

```yaml
cache:
type: redis:3.0
```
```yaml
cache:
type: redis:3.2
```

To configure relationships for an environment variable in your `.magento.app.yaml` file:
1. Configure the relationships in the `.magento.app.yaml` file.

```yaml
runtime:
extensions:
- redis
```yaml
runtime:
extensions:
- redis

relationships:
redis: "myredis:redis"
```
relationships:
redis: "redis:redis"
```

Merge and deploy the code to set the configurations for Redis. For information on how these changes affect your environments, see [`services.yaml`]({{ page.baseurl }}/cloud/project/project-conf-files_services.html).
1. Add, commit, and push your code changes.

## Verify environment-related relationships {#cloud-es-config-mg}
```bash
git add -A && git commit -m "Enable redis service" && git push origin <branch-name>
```

We use the {{site.data.var.ece}} environment variable [`$MAGENTO_CLOUD_RELATIONSHIPS`]({{ page.baseurl }}/cloud/env/environment-vars_cloud.html), a JSON object, to retrieve environment-related relationships.

{% include cloud/pretty-print-services.md %}
1. [Verify the relationships]({{page.baseurl}}/cloud/project/project-conf-files_services.html#service-relationships).

## Using the Redis CLI

Expand Down
Loading