1. Preface
This article is based on the summary of the online predecessors.
Environment: SIGNALR2.X,VS2015,WIN10
2. Load Balancing Configuration
The configuration is simple, as long as you add Redis connections to the startup class.
1) First, introduce the SIGNALR package
Install-package Microsoft.AspNet.SignalR.Redis
2) in startup class
usingSystem;usingSystem.Threading.Tasks;usingMicrosoft.AspNet.SignalR;usingMicrosoft.owin;usingOwin; [Assembly:owinstartup (typeof(SignalRDemo.SignalR.StartupSignalR))]namespacesignalrdemo.signalr{ Public classSTARTUPSIGNALR { Public voidConfiguration (Iappbuilder app) {#regionRedis Configuration//Add RedisRedisscaleoutconfiguration redisscaleoutconfiguration =NewRedisscaleoutconfiguration ("ceswebnew.redis.cache.chinacloudapi.cn",6379,"xxxxxxxxxxxxxxxxxxxxxxxxxx/yko=","__REDIS_SIGNALR"); //Connect db, default is 0Redisscaleoutconfiguration.database =3; //Redis for SIGNALRGlobalHost.DependencyResolver.UseRedis (redisscaleoutconfiguration); #endregion //For more information about how to configure an application, visithttp://go.microsoft.com/fwlink/?LinkID=316888App. MAPSIGNALR ();//Start Signalr } }}
C # BS message push load Balancer-signalr&redis configuration (iii)