Hello Team,
OUR ABP CONFIGURATION:
ABP Framework version: v7.0.0 UI type: MVC DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): Tiered MVC Exception message and stack trace
We have deployed application on staging and production both environment, following are the URLS:
Staging http://web.stage.careermaps.co.uk/
Production https://g2c.careermaps.co.uk/
Both are using redis configuration: redis.mindmill.co.uk defined in appsettings.json for redis configuration
In GTCManagementWebModule,GTCManagementHostModule and GTCManagementAuthModule,
We have defined different names for application name like : GemsStaging, GemsProduction (below attached screenshot for the same)
But after deploying both the staging and production sites, only one of them works at a time. (Attached error screenshot), if we stop staging the website then the production site will work and if we stop the production site then staging will work.
Any idea how we can use common redis server configuration for both environment staging and production
16 Answer(s)
-
0
Hi,
Can you share the error logs?
-
0
Sure, which site logs should I send, staging one or production one?
-
0
Also share the email where I need to send logs
-
0
Hi,
Both of them, thanks. shiwei.liang@volosoft.com
-
0
Hello Team,
Shared logs above over email, please confirm if you received logs, shared links of all URLs for staging and production.
-
0
Hello Team,
Any updates
-
0
Hi,
You can consider configure the
InstanceName
Configure<RedisCacheOptions>(options => { var instanceName = string.Empty; if (hostingEnvironment.IsProduction()) { instanceName = "Production"; } if (hostingEnvironment.IsStaging()) { instanceName = "Staging"; } options.InstanceName = instanceName; });
-
0
Hello,
Which place need to add this code. As can not see this RedisCacheOptions declared or used any of the module pages (Authservermodule, WebModule)
-
0
You need to configure every project that uses Redis (AuthServer,Web, HttpApi.Host)
-
0
Hello
This needs to be added before we setup applicationname and connection with redis right? Check screenshot and code and confirm please.
private void ConfigureDataProtection( ServiceConfigurationContext context, IConfiguration configuration, IWebHostEnvironment hostingEnvironment) { Configure<RedisCacheOptions>(options => { options.InstanceName = "Production"; }); var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("GemsProduction"); if (!hostingEnvironment.IsDevelopment()) { var redis = ConnectionMultiplexer .Connect(configuration["Redis:Configuration"]); dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "GemsProduction-Protection-Keys"); } }
-
0
Hi
Yes, it is.
-
0
Or you can specify a different database number to isolate the staging and production environment
appsettings.staging.json
"Redis": { "Configuration": "redis.mindmill.co.uk,defaultDatabase=1" }
appsettings.production.json
"Redis": { "Configuration": "redis.mindmill.co.uk,defaultDatabase=2" }
-
0
Thanks, Just need to add in appsettings part, no need to change in configuration side of code, right?
Configure<RedisCacheOptions>(options => { options.InstanceName = "Production"; }); var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("GemsProduction"); if (!hostingEnvironment.IsDevelopment()) { var redis = ConnectionMultiplexer .Connect(configuration["Redis:Configuration"]); dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "GemsProduction-Protection-Keys"); }
-
0
Hi,
Yes
-
0
Thanks, Let me try and redeploy this and will update you on the impact. Meanwhile can you check the other ticket also where I have posted reply.
-
0
ok
Meanwhile can you check the other ticket also where I have posted reply.
Where?