可能是什么问题?也许我需要向binarystore.xml 添加更多参数。我也不明白为什么如果我指定了 9000,它会尝试连接到端口 443。
binarystore.xml 文件:
<config version="2">
<chain template="s3-storage-v3"/>
<provider id="s3-storage-v3" type="s3-storage-v3">
<endpoint>http://s3_minio_ip:9000</endpoint>
<identity>username</identity>
<credential>password</credential>
<path></path>
<bucketName>test</bucketName>
</provider>
</config>
启动Artifactory时遇到错误:
2024-10-21T09:28:22.624Z [jfrt ] [WARN ] [f030324f462f1e16] [ifactoryApplicationContext:288] [art-init ] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'blobInfoServiceImpl' defined in URL [jar:file:/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-addons-common-7.59.13.jar!/org/artifactory/addon/common/blobinfo/BlobInfoServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'replicatorServiceImpl' defined in URL [jar:file:/opt/jfrog/artifactory/app/artifactory/tomcat/webapps/artifactory/WEB-INF/lib/artifactory-addons-common-7.59.13.jar!/org/artifactory/addon/common/replicator/ReplicatorServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'artifactDistributionStatusWriterServiceImpl': Unsatisfied dependency expressed through field 'taskService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'taskServiceImpl': Unsatisfied dependency expressed through field 'addonsManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'addonsManagerImpl': Unsatisfied dependency expressed through method 'setEntitlementService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'JFConnectServiceImpl': Unsatisfied dependency expressed through method 'setAccessService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accessServiceImpl': Unsatisfied dependency expressed through method 'setCentralConfigService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'centralConfig': Unsatisfied dependency expressed through field 'authService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityServiceImpl': Unsatisfied dependency expressed through method 'setBuildService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'buildServiceImpl': Unsatisfied dependency expressed through method 'setUploadService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'uploadServiceImpl': Unsatisfied dependency expressed through method 'setTrafficService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'trafficServiceImpl': Unsatisfied dependency expressed through method 'setRepositoryService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'repositoryServiceImpl': Unsatisfied dependency expressed through field 'storageService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'storageServiceImpl': Unsatisfied dependency expressed through method 'setBinaryStore' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'artifactoryBinaryServiceImpl': Unsatisfied dependency expressed through method 'setBinaryService' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'binaryInternalService': Invocation of init method failed; nested exception is com.amazonaws.SdkClientException: Unable to execute HTTP request:Connect to 172.17.14.223:443 [/172.17.14.223] failed: Connection refused
2024-10-21T09:28:22.636Z [jfrt ] [ERROR] [f030324f462f1e16] [ctoryContextConfigListener:126] [art-init ] - Application could not be initialized: Connection refused
java.lang.reflect.InvocationTargetException: null
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener.configure(ArtifactoryContextConfigListener.java:267)
at org.artifactory.lifecycle.webapp.servlet.ArtifactoryContextConfigListener$1.run(ArtifactoryContextConfigListener.java:122)
从错误来看,表明AWS SDK正在尝试使用端口443进行连接;但是,在配置中,我们指定了端口 9000。默认情况下,Artifactory 使用 HTTPS(端口 443),可以通过 binstore.xml 中的 useHttp 参数控制。
尝试更新binarystore.xml,如下所示并进行测试:
<config version="2">
<chain template="s3-storage-v3"/>
<provider id="s3-storage-v3" type="s3-storage-v3">
<endpoint>http://s3_minio_ip</endpoint>
<useHttp>true</useHttp>
<port>9000</port>
<identity>username</identity>
<credential>password</credential>
<path>filestore</path>
<enablePathStyleAccess>true</enablePathStyleAccess>
<bucketName>test</bucketName>
</provider>
</config>
有关每个参数的更多信息,您可以参考 JFrog wiki:Amazon S3 模板参数。
此外,确认 Artifactory/服务器的代理变量。如果到 S3(s3_minio) 的连接不需要代理,则端点应包含在 no_proxy 变量中。