Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yii2-sphinx multiple server handling #42

Closed
klimov-paul opened this issue Aug 30, 2015 · 1 comment
Closed

Yii2-sphinx multiple server handling #42

klimov-paul opened this issue Aug 30, 2015 · 1 comment
Labels
type:enhancement Enhancement

Comments

@klimov-paul
Copy link
Member

klimov-paul commented Aug 30, 2015

Migrated from yiisoft/yii2#4849

@tibee :

since yii2-sphinx extends yii2 db handling capabilities, it does already support multiple master and multiple slave servers for load balancing and read-write separation.

However, since Sphinx does not support replication, cannot be configured that way as for example, MySQL replication. So, if I need to run multiple servers for load balancing, I have to set up multiple servers (as logical masters, without logical slaves), and I would need to write in every master.

My component config would be:

 'sphinx' => [
        'class' => 'yii\sphinx\Connection',
        'masters' => [
            ['dsn' => 'mysql:host=192.168.1.20;port=4300'],
            ['dsn' => 'mysql:host=192.168.1.21;port=4300'],
        ],
        'masterConfig' => [
            'username' => '',
            'password' => '',
        ],
    ],

The current implementation chooses only one master on a write operation, causing inconsistency.
A feature request would be the high-level support of multiple servers, meaning a loop would do the write operations on ALL masters.

@klimov-paul
Copy link
Member Author

I do not consider this issue as general enough.
For the Sphinx it is much more common to use distibuted indexes.
Also the possible fix should be provided at yii\db\* layer not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

1 participant