使用多个主机设置Redis Sentinel

时间:2019-05-27 05:00:27

标签: laravel redis redis-sentinel

我正在尝试将我的应用程序连接到Redis前哨,但我注意到可能有多个主机可容纳您的前哨。这是否意味着我的应用已连接到多个标记,或者如果第一个主机不可用,它将使用下一个主机吗?

https://github.com/monospice/laravel-redis-sentinel-drivers#specifying-multiple-hosts

  

指定多个主机

     

为连接提供多个主机   通过环境变量,将任何 protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Get Screen Dimensions var dm = Resources.DisplayMetrics; var widthDP = dm.WidthPixels / dm.Density; var heightDP = dm.HeightPixels / dm.Density; Android.Util.Log.Info("MyApp", $"Screen Width x Screen Height = {widthDP}dp X {heightDP}dp"); // Add 10 Buttons in a ScrollView var sv = new ScrollView(this); var ll = new LinearLayout(this) { Orientation = Android.Widget.Orientation.Vertical }; sv.AddView(ll); for (int i = 0; i < 10; i++) { var btn = new Button(this); btn.SetBackgroundColor(Color.Blue); btn.Text = $"Button #{i+1}"; btn.Tag = i+1; btn.Click += (sender, e) => { Android.Util.Log.Info("MyApp", $"Button # {btn.Tag} + Clicked!"); }; // Make each button 50% of the total screen width and 20% of the *total* screen height var lp = new LinearLayout.LayoutParams(Convert.ToInt32(widthDP * .50), Convert.ToInt32(heightDP * .20)); lp.SetMargins(0, 10, 0, 0); // Top margin of 10 btn.LayoutParameters = lp; ll.AddView(btn); } SetContentView(sv); } 变量的值设置为   主机名或IP地址的逗号分隔字符串:

*_HOST

0 个答案:

没有答案