我有一组应用程序服务器,其中每个library(shiny)
library(readxl)
library(shinydashboard)
library(plotly)
date<-c(as.Date("2020-09-15", "%Y-%m-%d"),as.Date("2020-09-14", "%Y-%m-%d"),
as.Date("2020-09-13", "%Y-%m-%d"),as.Date("2020-09-12", "%Y-%m-%d"))
value<-c(5,6,7,8)
value2<-c(0.2,0.3,0.4,0.5)
df<-data.frame(date,value,value2)
ui <- dashboardPage(
dashboardHeader(title = "Dashboard Demo"),
dashboardSidebar(
sidebarMenu(
dateRangeInput('dateRange',
label = paste('Date range input'),
start = min(df$date)+1, end = max(df$date),
min = min(df$date), max = max(df$date),
separator = " - ", format = "dd/mm/yy",
startview = 'year'
)
)
),
dashboardBody(
plotlyOutput("plot")
)
)
server <- shinyServer(function(input, output, session) {
output$plot<-renderPlotly({
TATd <-subset(df, date>=input$dateRange[1]&date<=input$dateRange[2])
# Minimal theme + blue fill color
p<-ggplot(data=TATd, aes(x=date, y=value)) +
geom_bar(stat="identity", fill="steelblue")+
theme_minimal()+ labs(x = "Date of Specimen Collection",y="Total Tests per Day")
ggplotly(p)
})
})
shinyApp(ui, server)
服务器都已复制A
的所有会话,每个B
已复制了B
服务器的所有会话。如果A
发生故障,我需要确保故障转移到A
,如果B
发生故障,我需要确保故障转移到B
。
A
有人知道如何使用NGINX配置这种故障转移/负载平衡吗?
谢谢。