Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 7177f1f

Browse files
authored
Merge pull request #3 from delphix/develop
Develop
2 parents 84bbc50 + 95c8df1 commit 7177f1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+2119
-1437
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ src/generated/*
1111
*.pyc
1212
*generated*
1313
.DS_Store
14-
__pycache__/
14+
__pycache__/
15+
*.iml
16+
artifact.json

17+

README.md

+16-96
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
##
1+
# MySQLLinux
2+
23
## What Does a Delphix Plugin Do?
34
Delphix is a data management platform that provides the ability to securely copy and share datasets. Using virtualization, you will ingest your data sources and create virtual data copies, which are full read-write capable database instances that use a small fraction of the resources a normal database copy would require. The Delphix engine has built-in support for interfacing with certain types of datasets, such as Oracle, SQL Server and ASE.
45

@@ -7,105 +8,27 @@ The Delphix virtualization SDK (https://github.com/delphix/virtualization-sdk) p
78
## MySQL Plugin
89
MySQL plugin is developed to virtualize MySQL data source leveraging the following built-in MySQL technologies:
910
Features:
10-
- Environment Discovery: MySQL plugin can discover environments where MySQL server is installed.
11-
- Ingesting Data: Create a dSource using differnt methods specified below.
12-
- VDB Creation: Single node MySQL VDB can be provisioned from the dsource snapshot.
11+
- Environment Discovery: MySQL plugin can discover environments where MySQL server is installed.
12+
- Ingesting Data: Create a dSource using differnt methods specified below.
13+
- VDB Creation: Single node MySQL VDB can be provisioned from the dsource snapshot.
1314

1415
Different Ways to Ingest Data ( Dsource creation )
15-
- Replication with Delphix initiated Backup: Delphix takes an initial backup from source DB to ingest data and create a dSource. Delphix also sets up a master-slave replication to keep this dSource in sync with the source database. User can select the databases they want to virtualize
16-
- Replication with User Provided Backup: User provides a backup file from source DB to ingest data and create a dSource. Delphix sets up a master-slave replication to keep this dSource in sync with your source database.
17-
- User Provided Backup with no Replication: User provides a backup file from source DB to ingest data and create a dSource. When a new backup is available, user initiates a resync of the dSource to ingest data from the new backup.
18-
- Manual Backup Ingestion: Delphix creates an empty seed datanase and User manually ingests a backup to create a dSource.
19-
- Simple Tablespace Backup/Subsetting: Allows to create a dSource using a specific list of tables from source database.
20-
21-
22-
### Table of Contents
23-
1. [Prerequisites](#requirements-plugin)
24-
2. [Build and Upload Plugin](#upload-plugin)
25-
3. [Download logs](#run_unit_test_case)
26-
4. [Tested Versions](#tested-versions)
27-
5. [Supported Features](#support-features)
28-
6. [Unsupported Features](#unsupported-features)
29-
7. [How to Contribute](#contribute)
30-
8. [Statement of Support](#statement-of-support)
31-
9. [License](#license)
32-
33-
34-
### <a id="requirements-plugin"></a>Prerequisites
35-
**Software Requirements**
36-
1. jq - This toolkit requires jq to be configured on Staging and Target Hosts.
37-
38-
**MySQL instance requirements**
39-
1. Binary logging must be enabled on MySQL source instance.
40-
2. Server ID for the source must be greater than 0.
41-
42-
**MySQL database user with following privileges**
43-
1. delphixdb
44-
This MySQL user must be configured to have following privilege from the Delphix Engine IP, the staging host IP and localhost
45-
To grant the privilege for this user, use the following command:
46-
47-
```js
48-
SQL> GRANT SELECT, SHUTDOWN, SUPER, RELOAD, REPLICATION CLIENT,REPLICATION SLAVE,SHOW VIEW, EVENT, TRIGGER on *.* to 'delphix'@'%';
49-
```
50-
51-
OR
52-
53-
```js
54-
SQL> GRANT ALL PRIVILEGES ON *.* TO '<delphix>'@'%';
55-
```
56-
57-
#### _Staging Host Specific Requirements_
58-
59-
**O/S user with following privileges**
60-
1. Regular o/s user. should be able to ps all processes.
61-
2. Should be in the same primary and secondary groups as mysql user ( or the MySQL binary owner )
62-
3. Execute access on all files within MySQL installation folder - Min permission level 775 recommended.
63-
4. Sudo privileges for mount, umount. See sample below assuming `delphix_os` is used as delphix user.
64-
Example sudoers file entry
65-
```shell
66-
Defaults:delphix_os !requiretty
67-
delphix_os ALL=NOPASSWD: \
68-
/bin/mount, /bin/umount, /bin/mkdir, /bin/rmdir, /bin/ps
69-
```
70-
71-
**Other Staging Host Requirements**
72-
73-
1. Same version as Source MySQL Binaries installed.
74-
2. A MySQL config file (my.cnf) to be used for the Staging DB instance must be available under Delphix Toolkit Directory.
75-
3. Empty folder on host to hold delphix toolkit [ approximate 2GB free space ]
76-
4. Empty folder on host to mount nfs filesystem. This is just and empty folder with no space requirements and act as base folder for nfs mounts.
77-
78-
79-
#### _Target Requirements_
80-
81-
**O/S user with following privileges**
82-
1. Regular o/s user. should be able to ps all processes.
83-
2. Should be in the same primary and secondary groups as mysql user ( or the MySQL binary owner )
84-
3. Execute access on all files within MySQL installation folder - Min permission level 775 recommended.
85-
4. Sudo privileges for mount, umount. See sample below assuming `delphix_os` is used as delphix user.
86-
Example sudoers file entry
87-
```shell
88-
Defaults:delphix_os !requiretty
89-
delphix_os ALL=NOPASSWD: \
90-
/bin/mount, /bin/umount, /bin/mkdir, /bin/rmdir, /bin/ps
91-
```
92-
93-
**Other Staging Host Requirements**
94-
95-
1. Same version as Source MySQL Binaries installed.
96-
2. A MySQL config file (my.cnf) to be used for the Staging DB instance must be available under Delphix Toolkit Directory.
97-
3. Empty folder on host to hold delphix toolkit [ approximate 2GB free space ]
98-
4. Empty folder on host to mount nfs filesystem. This is just and empty folder with no space requirements and act as base folder for nfs mounts.
16+
- Replication with Delphix initiated Backup: Delphix takes an initial backup from source DB to ingest data and create a dSource. Delphix also sets up a master-slave replication to keep this dSource in sync with the source database. User can select the databases they want to virtualize
17+
- Replication with User Provided Backup: User provides a backup file from source DB to ingest data and create a dSource. Delphix sets up a master-slave replication to keep this dSource in sync with your source database.
18+
- User Provided Backup with no Replication: User provides a backup file from source DB to ingest data and create a dSource. When a new backup is available, user initiates a resync of the dSource to ingest data from the new backup.
19+
- Manual Backup Ingestion: Delphix creates an empty seed datanase and User manually ingests a backup to create a dSource.
9920

21+
MySQL Plugin documentation can be found at https://delphix.github.io/mysqllinux/
10022

10123
### <a id="upload-plugin"></a>Steps to build, upload and run unit tests for plugin
10224

103-
1. Build the source code. It generates the build with name `artifacts.json`:
25+
1. Build the source code. It generates the build with name `artifacts.json`:
10426
```bash
10527
dvp build
10628
```
107-
108-
2. Upload the `artifacts.json` ( generated in step 3 ) on Delphix Engine:
29+
dvp version 2.1 required.
30+
31+
2. Upload the `artifacts.json` ( generated in step 1 ) on Delphix Engine:
10932
```bash
11033
dvp upload -e <Delphix_Engine_Name> -u <username> --password <password>
11134
```
@@ -120,19 +43,17 @@ Download the plugin logs using below command:
12043

12144
### <a id="tested-versions"></a>Tested Versions
12245
- Delphix Engine: 6.0.4.0 and above
123-
- MySQL Version: 5.7.7, 5.7.9, 5.7.10, 5.7.12
124-
- Linux Version: RHEL 6.x
46+
- MySQL Versions 5.7.x above 5.7.6.
47+
- Linux Version: RHEL 6.x, 7.x
12548

12649
### <a id="support-features"></a>Supported Features
12750
- MySQL Replication
128-
- MySQL Tablespace Hotbackup
12951
- MySQL Manual Backup Ingestion
13052

13153
### <a id="unsupported-features"></a>Unsupported Features
13254
- MySQL Clusters
13355
- Sharded MySQL Databases
13456

135-
13657
### <a id="contribute"></a>How to Contribute
13758

13859
Please read [CONTRIBUTING.md](./CONTRIBUTING.md) to understand the pull requests process.
@@ -144,4 +65,3 @@ This software is provided as-is, without warranty of any kind or commercial supp
14465
### <a id="license"></a>License
14566

14667
This is code is licensed under the Apache License 2.0. Full license is available [here](./LICENSE).
147-

artifact.json

+45-90
Large diffs are not rendered by default.
File renamed without changes.

docs/Pipfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
mkdocs==0.17.5
8+
mkdocs-material==2.9.2
9+
markdown-include==0.5.1
10+
mkdocs-awesome-pages-plugin==1.2.0
11+
12+
[requires]
13+
python_version = "3.7"
14+
15+
[dev-packages]

docs/_config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-minimal

docs/docs/.pages

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
arrange:
2+
- index.md
3+
- Pre-Requisites
4+
- PluginInstallation.md
5+
- Discovery.md
6+
- Linking
7+
- Provisioning.md
8+
- Release_Notes

docs/docs/Discovery.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Discovery
2+
3+
Environment discovery/refresh is a process that enables the MySQL Plugin to determine MySQL installation details on a host.
4+
Database discovery/refresh is initiated during the environment set up process.
5+
6+
Whenever there is any change (installing a new database home) to an already set up environment in the Delphix application,
7+
we need to perform an environment discovery/refresh.
8+
9+
10+
## Prerequisites
11+
12+
- Installation of the MySQL Plugin is required before the Discovery.
13+
14+
## Refreshing an Environment
15+
16+
Environment refresh will update the metadata associated with that environment and push Delphix Toolkit on to the host.
17+
18+
1. Login to the **Delphix Management** application.
19+
2. Click **Manage**.
20+
3. Select **Environments**.
21+
4. In the Environments panel, click the name of the environment you want to refresh.
22+
5. Select the **Refresh** icon.
23+
6. In the Refresh confirmation dialog select **Refresh**.
24+
25+
![Screenshot](./image/Image9.png)
26+
27+
Once an environment refresh completes successfully, Delphix will discover all MySQL installations on the environment.
28+
These installations are referred to as "repositories"
29+
30+
31+
## Add Source Config
32+
33+
34+
As noted avove, environments contain `repositories`, that are MySQL installations in the environment.
35+
Each environment may have any number of repositories associated with it.
36+
37+
The next step in the virtualization process is to add a `SourceConfig`.
38+
A `SourceConfig` object defines the configuratino of the dSource and is required to create a dSource.
39+
You can create any number of `SourceConfig` objects using a repository, which represent known database instances.
40+
41+
For the MySQL plugin, Source config is must be created manually.
42+
43+
### How to create Source Config
44+
45+
*Source Config is created on the Staging Environment*
46+
47+
1. Login to the **Delphix Management** application.
48+
2. Click **Manage**.
49+
3. Select **Environments**.
50+
4. Select the repository.
51+
5. Click on **+** icon (Shown in next image).
52+
![Screenshot](./image/Image10.png)
53+
54+
6. Add required details in the `Add database` section.
55+
56+
- Enter source data directory in section **Data Directory**.
57+
- Enter source port number in **Port** section.
58+
- Enter MySQL base directory on the source host in **Base Directory** section.
59+
- Enter dsource name in **MySQL dSource Name** section.
60+
61+
![Screenshot](./image/Image11.png)
62+
63+
64+
## What's Next?
65+
66+
67+
Now that your environments are all added and a Source Config has been created,
68+
please proceed to [Linking](/Linking/Replication_Mode/index.html) page to see how we can create the dSource.

docs/docs/Linking/.pages

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
arrange:
2+
- Replication_Mode.md
3+
- Manual_Ingestion_Mode.md
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Manual Ingestion
2+
3+
In Manual Ingestion Mode, Delphix creates a seed (empty) staging database.
4+
Customer users will be responsible to manually ingest data into this staging db.
5+
All other management operations can be performed through Delphix. A snapshot can be taken either manually
6+
or via a SnapSync policy once the data is restored into the seed staging database.
7+
8+
### Pre-Requisites
9+
10+
- Staging environment must be added to Delphix.
11+
- A Source Config must be created on the staging environment-MySQL repository.
12+
- <span class="code_title">[Recommended] </span>
13+
As every organization's MySQL configuration is different,
14+
Delphix expects a starter *my.cnf* file to be present in Delphix Toolkit Directory when creating a staging database.
15+
Delphix will use this *my.cnf* file and modify it as per the configuration provided during the the dsource creation process.
16+
17+
This is recommended to reduce the possibility of errors while restoring the backup from the source database.
18+
19+
!!! warning
20+
It may take upto 5 minutes after successful dSource creation for the status to show as Active.
21+
22+
23+
### Creating dSource
24+
25+
1. Login to **Delphix Management** application.
26+
2. Click **Manage** > **Datasets**.
27+
3. Select **Add dSource**.
28+
29+
![Screenshot](../../image/add-dsource.png)
30+
31+
32+
4. In the Add dSource wizard, select the MySQL source configuration which is created on the staging host.
33+
5. Select *Manual Ingestion* in the dSource Type dropdown.
34+
6. Provide the additional details required for dsource creation
35+
- Staging DB Server ID
36+
37+
Server ID for the dsource (stagind db. For Replication Mode,
38+
this server id must be greater than the source db server id.
39+
40+
- Staging DB Port
41+
42+
Port for the dsource (staging db).
43+
44+
- Staging Initialization Password
45+
46+
Password to use while initializing the dsource (staging db).
47+
This password will be assigned to the *'root'@'localhost'*
48+
49+
- MySQL Base Directory
50+
51+
MySQL installation directory. This is where the location of */bin/mysql*
52+
53+
- Mount Location on Staging Host
54+
55+
This is the mount directory for Delphix on the staging host.
56+
This location should be unique and empty.
57+
58+
- Source DB UserName
59+
60+
Delphix db user on the source database. In Manual Ingestion mode, Delphix does not connect to the source db.
61+
Delphix will be using this db user to manage the dsource and other time travel operations.
62+
This user must be part of the source db backup that will be restored into the staging db.
63+
64+
- Source DB Password
65+
66+
Password for the source db user.
67+
68+
8. On dSource Configuration screen, select the dataset group where the dSource will be placed and click *Next*.
69+
9. On the Data Management screen, select the staging environment and the environment user and click *Next*.
70+
10. On the Policies screen, select the Snapsync and Retention policies for the dSource and click *Next*.
71+
11. On the Hooks screen, add any pre-sync and (or) post-sync hooks as required and click *Next*.
72+
12. Review the dSource configuration on the Summary screen and Submit. The Linking process has commenced.
73+
74+
![Screenshot](../../image/dsource-creation.png)
75+
76+
77+
Once the dSource creation is successful, the <span class="code_title">*Timeflow*</span> tab should show the initial snapshot.
78+
79+
Done, What's Next?
80+
----------------
81+
Alright, we have created a MySQL dSource. Next step - Provision a VDB.
82+

0 commit comments

Comments
 (0)