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

Help needed on hybrid setup - Sentinel cluster shared on Laravel & Java App #38

Open
jab1000 opened this issue Jan 17, 2022 · 0 comments

Comments

@jab1000
Copy link

jab1000 commented Jan 17, 2022

We run a 3 server Redis Sentinel cluster which is shared between a laravel app and also a java application.

Presently right now, database 0 is used for the java web application with the remaining databases being laravel. Below are the configuration settings from our laravel env file:

	CACHE_DRIVER=redis-sentinel
	SESSION_DRIVER=redis-sentinel
	REDIS_DRIVER=redis-sentinel

	QUEUE_DRIVER=redis-sentinel
	QUEUE_CONNECTION=redis-sentinel
	HORIZON_DRIVER=redis-sentinel

	REDIS_HOST=172.3.4.1,172.3.4.2,172.3.4.3
	REDIS_PORT=26379
	REDIS_SENTINEL_SERVICE=mymaster

	REDIS_CACHE_DATABASE=1
	REDIS_SESSION_DATABASE=2
	REDIS_QUEUE_DATABASE=3

We have a few new laravel jobs which we need to delete/remove a cached key set by the java application. The redis prefix in the java application is not set, but the prefix is auto-added with the default laravel configuration for redis database/cache config files.

What would be the best way for laravel to access these "java application set keys" in Redis?

We did try creating another database config setting under redis area but it throws errors in production that it isn't defined. Extra cache attribute added:

   'javaCache' => [
        'url' => env('REDIS_URL'),
        'host' => env('REDIS_HOST', '127.0.0.1'),
        'password' => null,
        'port' => '6379',
        'database' => '0',
        'prefix'=>'',
    ]

Do we need a hybrid setup per your readme front page -- granted after reading it a couple of times, I am not sure I understand what to change though unfortunately.

Thanks for your help & feedback!

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

1 participant