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

Commit be33207

Browse files
committed
Plugin Updates from Alan
1 parent 84bbc50 commit be33207

19 files changed

+164
-619
lines changed

README.md

Lines changed: 2 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,2 @@
1-
##
2-
## What Does a Delphix Plugin Do?
3-
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.
4-
5-
The Delphix virtualization SDK (https://github.com/delphix/virtualization-sdk) provides an interface for building custom data source integrations for the Delphix Dynamic Data Platform. The end users can design/implement a custom plugin which enable them to use custom data source like MySQL, MongoDB, Cassandra, MySQL or something else similar to as if they are using a built-in dataset type with Delphix Engine.
6-
7-
## MySQL Plugin
8-
MySQL plugin is developed to virtualize MySQL data source leveraging the following built-in MySQL technologies:
9-
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.
13-
14-
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.
99-
100-
101-
### <a id="upload-plugin"></a>Steps to build, upload and run unit tests for plugin
102-
103-
1. Build the source code. It generates the build with name `artifacts.json`:
104-
```bash
105-
dvp build
106-
```
107-
108-
2. Upload the `artifacts.json` ( generated in step 3 ) on Delphix Engine:
109-
```bash
110-
dvp upload -e <Delphix_Engine_Name> -u <username> --password <password>
111-
```
112-
113-
114-
### <a id="run_unit_test_case"></a>Download plugin logs
115-
#### Plugin Logs:
116-
Download the plugin logs using below command:
117-
118-
```dvp download-logs -c plugin_config.yml -e <Delphix_Engine_Name> -u admin --password <password>```
119-
120-
121-
### <a id="tested-versions"></a>Tested Versions
122-
- 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
125-
126-
### <a id="support-features"></a>Supported Features
127-
- MySQL Replication
128-
- MySQL Tablespace Hotbackup
129-
- MySQL Manual Backup Ingestion
130-
131-
### <a id="unsupported-features"></a>Unsupported Features
132-
- MySQL Clusters
133-
- Sharded MySQL Databases
134-
135-
136-
### <a id="contribute"></a>How to Contribute
137-
138-
Please read [CONTRIBUTING.md](./CONTRIBUTING.md) to understand the pull requests process.
139-
140-
### <a id="statement-of-support"></a>Statement of Support
141-
142-
This software is provided as-is, without warranty of any kind or commercial support through Delphix. See the associated license for additional details. Questions, issues, feature requests, and contributions should be directed to the community as outlined in the [Delphix Community Guidelines](https://delphix.github.io/community-guidelines.html).
143-
144-
### <a id="license"></a>License
145-
146-
This is code is licensed under the Apache License 2.0. Full license is available [here](./LICENSE).
147-
1+
# msyql_sdk_plugin
2+
MySQL SDK Plugin for Delphix

plugin_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ pluginType: STAGED
77
entryPoint: plugin_runner:plugin
88
srcDir: src
99
schemaFile: schema.json
10-
buildNumber: 1.00.0
10+
buildNumber: 1.68.0

schema.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,20 @@
8686
"type": "string",
8787
"prettyName": "DB User",
8888
"description": "DB user for the virtual database",
89-
"default": "delphix1"
89+
"default": "delphixdb"
9090
},
9191
"vdbPass": {
9292
"type": "string",
9393
"format": "password",
9494
"prettyName": "DB Password",
9595
"description": "DB user password for the virtual database",
96-
"default": "delphix"
96+
"default": "Delphix_123"
9797
},
9898
"baseDir": {
9999
"type": "string",
100100
"prettyName": "BaseDir",
101101
"description": "Path of the MySQL Installation, where binaries (./bin) exists",
102-
"default": "/opt/mysql57/mysql57d"
102+
"default": "/usr"
103103
},
104104
"port": {
105105
"type": "string",
@@ -111,7 +111,7 @@
111111
"type": "string",
112112
"prettyName": "VDB Server ID",
113113
"description": "Server ID for the MySQL VDB",
114-
"default": "200"
114+
"default": "201"
115115
},
116116
"config_settings_prov" : {
117117
"type" : "array",
@@ -142,8 +142,8 @@
142142
"mPath": {
143143
"type": "string",
144144
"prettyName": "Mount Location",
145-
"description": "NFS Mount folder for Delphix",
146-
"default": "/home/mysql/delphix/mount3"
145+
"description": "Unique NFS Mount folder for Delphix",
146+
"default": "/mnt/provision/mysql_vdb"
147147
}
148148
}
149149
},
@@ -202,26 +202,26 @@
202202
"type": "string",
203203
"prettyName": "Source DB Host IP address",
204204
"description": "* Required if using Replication Method",
205-
"default": "neomysqlsrc.dlpxdc.co"
205+
"default": "localhost"
206206
},
207207
"mountPath": {
208208
"type": "string",
209209
"prettyName": "Mount Location on Staging Host",
210-
"description": "NFS mount directory on the Staging Host",
211-
"default": "/home/mysql/delphix/mount"
210+
"description": "Unique NFS mount directory on the Staging Host",
211+
"default": "/mnt/provision/mysql_stage"
212212
},
213213
"sourceUser": {
214214
"type": "string",
215215
"prettyName": "Source DB UserName",
216216
"description": "* Required if Delphix is taking backups",
217-
"default": "delphix1"
217+
"default": "delphixdb"
218218
},
219219
"sourcePass": {
220220
"type": "string",
221221
"format": "password",
222222
"prettyName": "Source Connection Password",
223223
"description": "* Required if Delphix is taking backups",
224-
"default": "delphix"
224+
"default": "Delphix_123"
225225
},
226226
"logSync": {
227227
"default": true,
@@ -240,7 +240,7 @@
240240
"format": "password",
241241
"prettyName": "Replication User's Password",
242242
"description": "* Required if using Replication Method with LogSync",
243-
"default": "delphix"
243+
"default": "Delphix_123"
244244
},
245245
"stagingUser": {
246246
"type": "string",
@@ -253,7 +253,7 @@
253253
"format": "password",
254254
"prettyName": "Staging DB Password",
255255
"description": "Staging DB User's Password",
256-
"default": "***REMOVED***"
256+
"default": "Delphix_123"
257257
},
258258
"serverId": {
259259
"type": "string",
@@ -265,7 +265,7 @@
265265
"type": "string",
266266
"prettyName": "Source DB",
267267
"description": "* Name of the Source DB to backup. Required for Simple Tablespace Backup Method",
268-
"default": ""
268+
"default": "delphixdb"
269269
},
270270
"sourceTables": {
271271
"type": "string",
@@ -277,13 +277,13 @@
277277
"type": "string",
278278
"prettyName": "Source scp Username",
279279
"description": "* Required for Simple Tablespace Backup Method",
280-
"default": "mysql"
280+
"default": "delphix"
281281
},
282282
"scpPass": {
283283
"type": "string",
284284
"prettyName": "Source scp Password",
285285
"description": "* Required for Simple Tablespace Backup Method",
286-
"default": "mysql"
286+
"default": "delphix"
287287
},
288288
"stagingPort": {
289289
"type": "string",
@@ -295,7 +295,7 @@
295295
"type": "string",
296296
"prettyName": "MySQL Base Directory",
297297
"description": "Base Directory of MySQL Installation (Location of /bin/mysql)",
298-
"default": "/opt/mysql57/mysql57d"
298+
"default": "/usr"
299299
}
300300
}
301301
},

src/common/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self):
2424

2525
@staticmethod
2626
def find_binary_path():
27-
return "find / -not \( -path /etc -prune \) -name mysqld -type f -print 2>&1 | grep -v 'Permission denied'"
27+
return "find / ! -path \"/etc/*\" ! -path \"/var/lock/*\" -name mysqld -type f -print 2>&1 | grep -v 'Permission denied'"
2828

2929
@staticmethod
3030
def find_install_path(binary_path):
@@ -171,4 +171,4 @@ def __init__(self):
171171
binary_path = "/opt/mysql/bin"
172172
hostname = "hostname"
173173
port = "3320"
174-
print "find_install_path: ", CommandFactory.find_install_path(binary_path), "\n"
174+
print "find_install_path: ", CommandFactory.find_install_path(binary_path), "\n"

0 commit comments

Comments
 (0)