我不能让artifactory用mysql在docker中工作。下面是我得到的错误。
我首先创建一个地方来保存artifactory的文件: # sudo mkdir /opt/artifactory/docker_volume
使用外部mysql示例设置compose文件(使用stack示例也不起作用,因为stack示例从未启动)。
artifactory-oss-mysql.yml:
version: '3'
services:
artifactory:
image: docker.bintray.io/jfrog/artifactory-oss:6.1.0
ports:
- 8081:8081
volumes:
- /opt/artifactory/docker_volume:/var/opt/jfrog/artifactory
- /opt/artifactory/mysql-connector-java-8.0.11/mysql-connector-java-8.0.11.jar:/var/opt/jfrog/artifactory/tomcat/common/lib/mysql-connector-java-8.0.11.jar
environment:
- DB_TYPE=mysql
- DB_USER=artifactory
- DB_HOST=mysql
- DB_PASSWORD=xxx
- DB_URL=jdbc:mysql://my_sql:3306/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true
restart: always
ulimits:
nproc: 65535
nofile:
soft: 32000
hard: 40000
启动堆栈: # docker stack deploy -c artifactory-oss-mysql.yml artifactory
你会注意到 docker_volume
主人变了,一切都变了。唯一的例外是mysql连接器( /var/opt/jfrog/artifactory/tomcat/common/lib/mysql-connector-java-8.0.11.jar
),保留根所有权。
# ls -al
drwxr-xr-x 5 root root 4096 Jul 17 17:47 .
drwxr-xr-x 16 root root 4096 Jul 17 15:40 ..
drwxr-xr-x 8 1030 1030 4096 Jul 17 17:47 docker_volume
每个子目录都是空的(tomcat中的连接器除外):
/opt/artifactory/docker_volume # ls -al
total 32
drwxr-xr-x 8 1030 1030 4096 Jul 17 17:47 .
drwxr-xr-x 5 root root 4096 Jul 17 17:47 ..
drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 access
drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 backup
drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 data
drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 etc
drwxr-xr-x 2 1030 1030 4096 Jul 17 17:47 logs
drwxr-xr-x 3 1030 1030 4096 Jul 17 17:47 tomcat
``` `# docker service logs zh3fiophtdvu` ```
Preparing to run Artifactory in Docker
=====================================
2018-07-17 21:13:06 [44 entrypoint-artifactory.sh] Dockerfile for this image can found inside the container.
2018-07-17 21:13:06 [45 entrypoint-artifactory.sh] To view the Dockerfile: 'cat /docker/artifactory-oss/Dockerfile.artifactory'.
2018-07-17 21:13:06 [50 entrypoint-artifactory.sh] Checking open files and processes limits
2018-07-17 21:13:06 [53 entrypoint-artifactory.sh] Current max open files is 1048576
2018-07-17 21:13:06 [65 entrypoint-artifactory.sh] Current max open processes is unlimited
2018-07-17 21:13:06 [75 entrypoint-artifactory.sh] Checking if /var/opt/jfrog/artifactory is mounted
2018-07-17 21:13:06 [80 entrypoint-artifactory.sh] /var/opt/jfrog/artifactory is mounted
2018-07-17 21:13:06 [86 entrypoint-artifactory.sh] Setting up data directories if missing
2018-07-17 21:13:06 [97 entrypoint-artifactory.sh] Create artifactory user if missing
2018-07-17 21:13:06 [100 entrypoint-artifactory.sh] User does not exist. Creating it...
2018-07-17 21:13:06 [137 entrypoint-artifactory.sh] Checking permissions on /opt/jfrog/artifactory
2018-07-17 21:13:06 [143 entrypoint-artifactory.sh] /opt/jfrog/artifactory is owned by root:root. Setting to artifactory:artifactory.
2018-07-17 21:13:06 [150 entrypoint-artifactory.sh] Checking permissions on /var/opt/jfrog/artifactory
2018-07-17 21:13:06 [159 entrypoint-artifactory.sh] /var/opt/jfrog/artifactory is already owned by artifactory:artifactory.
2018-07-17 21:13:06 [282 entrypoint-artifactory.sh] Checking DB_TYPE
2018-07-17 21:13:06 [285 entrypoint-artifactory.sh] DB_TYPE is set to mysql
2018-07-17 21:13:06 [34 entrypoint-artifactory.sh] ERROR: No mysql connector found
1条答案
按热度按时间i5desfxk1#
为了更好地理解和解决您的问题,我会尝试以下方法:
删除
ulimits.nofile
部分chown -R 1030:1030
为您所需的卷这似乎是一个许可问题。