diff --git a/docs/en/images/manager-console/add-preheat-job.png b/docs/en/images/manager-console/add-preheat-job.png new file mode 100644 index 00000000000..2a1fa47958f Binary files /dev/null and b/docs/en/images/manager-console/add-preheat-job.png differ diff --git a/docs/en/images/manager-console/preheat-job-detail.png b/docs/en/images/manager-console/preheat-job-detail.png new file mode 100644 index 00000000000..73f3c4402db Binary files /dev/null and b/docs/en/images/manager-console/preheat-job-detail.png differ diff --git a/docs/en/images/manager-console/preheat-list.png b/docs/en/images/manager-console/preheat-list.png new file mode 100644 index 00000000000..f762788b91c Binary files /dev/null and b/docs/en/images/manager-console/preheat-list.png differ diff --git a/docs/en/preheat/console.md b/docs/en/preheat/console.md index 0860bd92b25..55367dcd2ba 100644 --- a/docs/en/preheat/console.md +++ b/docs/en/preheat/console.md @@ -1,3 +1,65 @@ -# WIP console +# console -TODO +Use preheat console for preheating. +First access Dragonfly Manager Console e.g. `http://dragonfly-manager:8080/service/task` +and create preheat task for preheating. + +If the `scheduler_cluster_ids` does not selected, it means to preheat all scheduler clusters. + +![add-preheat-job](../images/manager-console/add-preheat-job.png) + +View preheat task list. + +![preheat-list](../images/manager-console/preheat-list.png) + +View preheat task details by Click `Description`. + +![preheat-list](../images/manager-console/preheat-job-detail.png) + +## FAQ + +### Create preheat task throw error + +If create preheat task throw error,html alert `http error`,network response http status code is `500`, +Check whether Redis has write permission. + +Dragonfly Manager error logs like: + +```bash +2022-02-15T08:30:01.123Z ERROR job/preheat.go:159 create preheat group job failed +READONLY You can't write against a read only replica. +d7y.io/dragonfly/v2/manager/job.(*preheat).createGroupJob +/go/src/d7y.io/dragonfly/v2/manager/job/preheat.go:159 +d7y.io/dragonfly/v2/manager/job.(*preheat).CreatePreheat +/go/src/d7y.io/dragonfly/v2/manager/job/preheat.go:128 +d7y.io/dragonfly/v2/manager/service.(*rest).CreatePreheatJob +/go/src/d7y.io/dragonfly/v2/manager/service/job.go:71 +d7y.io/dragonfly/v2/manager/handlers.(*Handlers).CreateJob +/go/src/d7y.io/dragonfly/v2/manager/handlers/job.go:40 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +d7y.io/dragonfly/v2/manager/middlewares.Error.func1 +/go/src/d7y.io/dragonfly/v2/manager/middlewares/error.go:42 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1 +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/recovery.go:99 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/gin-gonic/gin.LoggerWithConfig.func1 +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/logger.go:241 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/mcuadros/go-gin-prometheus.(*Prometheus).HandlerFunc.func1 +/go/pkg/mod/github.com/mcuadros/go-gin-prometheus@v0.1.0/middleware.go:364 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/gin-gonic/gin.(*Engine).handleHTTPRequest +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:555 +github.com/gin-gonic/gin.(*Engine).ServeHTTP +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:511 +net/http.serverHandler.ServeHTTP +/usr/local/go/src/net/http/server.go:2878 +net/http.(*conn).serve +/usr/local/go/src/net/http/server.go:1929 +``` diff --git a/docs/zh-CN/preheat/console.md b/docs/zh-CN/preheat/console.md index 0860bd92b25..5accbba12e5 100644 --- a/docs/zh-CN/preheat/console.md +++ b/docs/zh-CN/preheat/console.md @@ -1,3 +1,62 @@ -# WIP console +# console -TODO +用户使用 Dragonfly Manager Console 进行预热。 +首先访问 Dragonfly Manager Console e.g. `http://dragonfly-manager:8080/service/task` 创建预热任务。 + +如果不选择 `Scheduler Cluster` 则是对所有 Scheduler 进行预热。 + +![add-preheat-job](../../en/images/manager-console/add-preheat-job.png) + +查看预热任务列表 + +![preheat-list](../../en/images/manager-console/preheat-list.png) + +点击 `Description` 查看预热详情 + +![preheat-list](../../en/images/manager-console/preheat-job-detail.png) + +## FAQ + +### 创建预热任务报错 + +如果创建预热任务报错,接口返回500,页面提示 `http error`,需要排查 redis 是否具有写权限。 +Dragonfly Manager 日志报错类似 + +```bash +2022-02-15T08:30:01.123Z ERROR job/preheat.go:159 create preheat group job failed +READONLY You can't write against a read only replica. +d7y.io/dragonfly/v2/manager/job.(*preheat).createGroupJob +/go/src/d7y.io/dragonfly/v2/manager/job/preheat.go:159 +d7y.io/dragonfly/v2/manager/job.(*preheat).CreatePreheat +/go/src/d7y.io/dragonfly/v2/manager/job/preheat.go:128 +d7y.io/dragonfly/v2/manager/service.(*rest).CreatePreheatJob +/go/src/d7y.io/dragonfly/v2/manager/service/job.go:71 +d7y.io/dragonfly/v2/manager/handlers.(*Handlers).CreateJob +/go/src/d7y.io/dragonfly/v2/manager/handlers/job.go:40 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +d7y.io/dragonfly/v2/manager/middlewares.Error.func1 +/go/src/d7y.io/dragonfly/v2/manager/middlewares/error.go:42 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1 +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/recovery.go:99 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/gin-gonic/gin.LoggerWithConfig.func1 +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/logger.go:241 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/mcuadros/go-gin-prometheus.(*Prometheus).HandlerFunc.func1 +/go/pkg/mod/github.com/mcuadros/go-gin-prometheus@v0.1.0/middleware.go:364 +github.com/gin-gonic/gin.(*Context).Next +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/context.go:168 +github.com/gin-gonic/gin.(*Engine).handleHTTPRequest +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:555 +github.com/gin-gonic/gin.(*Engine).ServeHTTP +/go/pkg/mod/github.com/gin-gonic/gin@v1.7.7/gin.go:511 +net/http.serverHandler.ServeHTTP +/usr/local/go/src/net/http/server.go:2878 +net/http.(*conn).serve +/usr/local/go/src/net/http/server.go:1929 +```