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?
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Both of them, thanks. shiwei.liang@volosoft.com
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
You can consider configure the
InstanceNameConfigure<RedisCacheOptions>(options => { var instanceName = string.Empty; if (hostingEnvironment.IsProduction()) { instanceName = "Production"; } if (hostingEnvironment.IsStaging()) { instanceName = "Staging"; } options.InstanceName = instanceName; });Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
You need to configure every project that uses Redis (AuthServer,Web, HttpApi.Host)
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
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"); } }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi
Yes, it is.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
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" }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
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"); }Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Yes
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
ok
Meanwhile can you check the other ticket also where I have posted reply.
Where?
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
