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

Connect to Redis Cluster in Yandex Cloud #211

Closed
abpopov opened this issue Apr 23, 2020 · 7 comments
Closed

Connect to Redis Cluster in Yandex Cloud #211

abpopov opened this issue Apr 23, 2020 · 7 comments

Comments

@abpopov
Copy link

abpopov commented Apr 23, 2020

Hello!
Is there any way to connect to Yandex Cloud

$sentinels = ['tcp://host:port'];
$options = [
'replication' => 'sentinel',
'service' => 'service_name',
'parameters' => [
'password' => ''
]
];

@yii-bot
Copy link

yii-bot commented Apr 23, 2020

Thanks for posting in our issue tracker.
In order to properly assist you, we need additional information:

  • When does the issue occur?
  • What do you see?
  • What was the expected result?
  • Can you supply us with a stacktrace? (optional)
  • Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)

Thanks!

This is an automated comment, triggered by adding the label status:need more info.

@abpopov
Copy link
Author

abpopov commented Apr 23, 2020

We want to use
https://cloud.yandex.ru/docs/managed-redis/operations/cluster-create
and in Yandex cloud help I got

`sudo pear channel-discover pear.nrk.io
sudo pear install nrk/Predis
Пример кода:
require 'Predis/Autoloader.php';
Predis\Autoloader::register();

$sentinels = ['tcp://server:port];
$options = [
'replication' => 'sentinel',
'service' => 'cluster_name',
'parameters' => [
'password' => ''
]
];
$client = new Predis\Client($sentinels, $options);

$client->set('foo', 'bar');`

Can I use yii2-redis to connect to this Yandex cloud redid cluster?

@samdark
Copy link
Member

samdark commented Apr 24, 2020

I think so. Why not?

@abpopov
Copy link
Author

abpopov commented Apr 24, 2020

How?)

Connection config of yii2-redis

'redis' => [ 'class' => 'yii\redis\Connection', 'hostname' => 'localhost', 'port' => 6379, 'database' => 0, ],

@abpopov
Copy link
Author

abpopov commented Apr 24, 2020

I see in YandexCloud FAQ that we can use direct connection.
Is there any way to connect via Redis Sentinel?

@samdark
Copy link
Member

samdark commented Apr 24, 2020

Checked it. I have no idea if current code is suitable. It supports multiple replicas but I have no idea on how to work with sentinel on the low level.

@samdark
Copy link
Member

samdark commented Apr 24, 2020

Here it is: #45

@samdark samdark closed this as completed Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants