@@ -36,20 +36,30 @@ stop the elasticsearch container and modify /usr/share/elasticsearch/config/elas
36
36
restart the elasticsearch container, and in the pymyelarepl container,
37
37
38
38
```
39
- (for test) cd pymyelarepl && python test/test .py
39
+ (for test) cd pymyelarepl && python test/test_basic .py
40
40
41
- (after executing some sql in the mysql container, for example) cd pymyelarepl && python example/run.py
41
+
42
+ (after executing the following sql in the mysql container as root without password, for example) cd pymyelarepl && python example/run.py
43
+
44
+ CREATE DATABASE test;
45
+ use test;
46
+ CREATE TABLE test4 (id int NOT NULL AUTO_INCREMENT, data VARCHAR(255), data2 VARCHAR(255), PRIMARY KEY(id));
47
+ INSERT INTO test4 (data, data2) VALUES ("Hello", "World");
48
+ UPDATE test4 SET data="World", data2="Hello" WHERE id=1;
49
+ DELETE FROM test4 WHERE id=1;
42
50
```
43
51
44
52
45
53
<br >
46
54
47
- the results of the two cases are like the below, which means data is replicated successfully:
55
+ the results of the two cases are similar to the below, which means data is replicated successfully:
48
56
49
57
```
50
58
{'errors': False, 'took': 12, 'items': [{'create': {'_index': 'basic_replication', '_id': '1', '_version': 1, 'result': 'created', '_shards': {'total': 2, 'successful': 1, 'failed': 0}, '_seq_no': 6, '_primary_term': 1, 'status': 201}}, {'create': {'_index': 'basic_replication', '_id': '2', '_version': 1, 'result': 'created', '_shards': {'total': 2, 'successful': 1, 'failed': 0}, '_seq_no': 7, '_primary_term': 1, 'status': 201}}]}
51
59
{'errors': False, 'took': 11, 'items': [{'update': {'_index': 'basic_replication', '_id': '1', '_version': 2, 'result': 'updated', '_shards': {'total': 2, 'successful': 1, 'failed': 0}, '_seq_no': 8, '_primary_term': 1, 'status': 200}}, {'update': {'_index': 'basic_replication', '_id': '2', '_version': 2, 'result': 'updated', '_shards': {'total': 2, 'successful': 1, 'failed': 0}, '_seq_no': 9, '_primary_term': 1, 'status': 200}}]}
52
60
{'errors': False, 'took': 2, 'items': [{'delete': {'_index': 'basic_replication', '_id': '1', '_version': 3, 'result': 'deleted', '_shards': {'total': 2, 'successful': 1, 'failed': 0}, '_seq_no': 10, '_primary_term': 1, 'status': 200}}, {'delete': {'_index': 'basic_replication', '_id': '2', '_version': 3, 'result': 'deleted', '_shards': {'total': 2, 'successful': 1, 'failed': 0}, '_seq_no': 11, '_primary_term': 1, 'status': 200}}]}
61
+
62
+ (blocked for the example)
53
63
```
54
64
55
65
0 commit comments