我一直致力于从MarkLogic实例构建配置文件,以通过ml-gradle进行部署。我想在8003完全禁用REST端点。我使用ml-gradle版本2.7.0。我能够使用gradle mlExportResources收集我的大部分配置。
在我的gradle.properties中,我添加了
mlNoRestServer=true
我的build.gradle文件是
plugins {
id "com.marklogic.ml-gradle" version "2.7.0"
id "net.saliman.properties" version "1.4.6"
}
ext {
mlAppConfig {
modulesDatabaseName = "my-modules"
contentDatabaseName = "my-documents"
createTriggersDatabase = false
}
// Here's an example of not creating a REST API server at all - just remove the command
mlAppDeployer.getCommands().remove(mlAppDeployer.getCommand("DeployRestApiServersCommand"))
}
部署在到达REST阶段之前看起来没问题。即使给出了配置,它仍然指的是端口8003。
13:03:10.226 [INFO] [org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor] Initializing ExecutorService
13:03:10.227 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Writing REST server configuration
13:03:10.227 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Default document read transform: null
13:03:10.227 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Transform all documents on read: false
13:03:10.228 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Validate query options: true
13:03:10.228 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Validate queries: true
13:03:10.228 [INFO] [com.marklogic.client.modulesloader.impl.DefaultModulesLoader] Output debugging: false
13:03:10.228 [INFO] [com.marklogic.client.impl.ServerConfigurationManagerImpl] Writing server configuration
13:03:10.229 [DEBUG] [com.marklogic.client.impl.JerseyServices] Putting config/properties/null
13:03:10.229 [DEBUG] [org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager] Get connection: {}->http://localhost:8003, timeout = 0
13:03:10.230 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] [{}->http://localhost:8003] total kept alive: 0, total issued: 0, total allocated: 0 out of 200
13:03:10.230 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] No free connections [{}->http://localhost:8003][null]
13:03:10.230 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Available capacity: 100 out of 100 [{}->http://localhost:8003][null]
13:03:10.231 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Creating new connection [{}->http://localhost:8003]
13:03:10.232 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnectionOperator] Connecting to localhost:8003
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection org.apache.http.impl.conn.DefaultClientConnection@9770e0c closed
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection org.apache.http.impl.conn.DefaultClientConnection@9770e0c shut down
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager] Released connection is not reusable.
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Releasing connection [{}->http://localhost:8003][null]
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Connection org.apache.http.impl.conn.DefaultClientConnection@9770e0c closed
13:03:10.233 [DEBUG] [org.apache.http.impl.conn.tsccm.ConnPoolByRoute] Notifying no-one, there are no waiting threads
13:03:10.233 [INFO] [com.marklogic.client.impl.DatabaseClientImpl] Releasing connection
13:03:10.233 [DEBUG] [com.marklogic.client.impl.JerseyServices] Releasing connection
13:03:10.233 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter] Removed task artifact state for {} from context.
13:03:10.233 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':mlDeployApp'
13:03:10.233 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] :mlDeployApp FAILED
13:03:10.234 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :mlDeployApp (Thread[Daemon worker Thread 11,5,main]) completed. Took 3 mins 12.831 secs.
13:03:10.234 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationWorkerRegistry] Worker root.3 completed (0 in use)
13:03:10.234 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 11,5,main]] finished, busy: 3 mins 12.835 secs, idle: 0.002 secs
13:03:10.235 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
13:03:10.235 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
我没有在端口8003上部署REST服务器时缺少哪些配置?
答案 0 :(得分:1)
从2.7.0开始,您现在可以在gradle.properties中设置mlNoRestServer = true以禁用REST服务器创建 - https://github.com/marklogic-community/ml-gradle/wiki/Property-reference
上述错误归因于以下几行:
13:03:10.228 [INFO] [com.marklogic.client.impl.ServerConfigurationManagerImpl]编写服务器配置 13:03:10.229 [DEBUG] [com.marklogic.client.impl.JerseyServices]输入config / properties / null
你有src / main / ml-modules / rest.properties文件吗?如果是这样,ml-gradle会看到它并认为 - 我需要将其发送到/ v1 / config / properties以更新REST API服务器,但它不存在,并且会产生错误。我的猜测是文件存在;尝试删除它并再次运行mlDeploy。