云原生之使用docker部署Subsonic音乐流媒体服务

举报
江湖有缘 发表于 2022/12/24 17:00:42 2022/12/24
【摘要】 云原生之使用docker部署Subsonic音乐流媒体服务

一、Subsonic介绍

Subsonic由挪威人Sindre Mehus采用Java语言编写而成。它具有一个强大的自动转换格式引擎,可通过将其即时转换为MP3来流式传输各种有损和无损格式。

二、检查本地环境

1.检查docker版本


[root@jeven ~]# docker version
Client: Docker Engine - Community
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:04:24 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 18:02:38 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.12
  GitCommit:        a05d175400b1145e5e6a735a6710579d181e7fb0
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[root@jeven ~]# 


2.检查docker状态

[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2022-12-13 23:18:38 CST; 1 weeks 3 days ago
     Docs: https://docs.docker.com
 Main PID: 123665 (dockerd)
    Tasks: 60
   Memory: 2.3G
   CGroup: /system.slice/docker.service
           ├─  1023 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 4567 -container-ip 172.31.0.3 -container-port 4...
           ├─  1028 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 4567 -container-ip 172.31.0.3 -container-port 4567
           ├─ 53581 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.17.0.2 -container-port 8...
           ├─ 53587 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.17.0.2 -container-port 8080
           ├─123665 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
           ├─130971 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 27117 -container-ip 172.31.0.2 -container-port ...
           └─130977 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 27117 -container-ip 172.31.0.2 -container-port 27017...

Dec 21 20:39:47 jeven dockerd[123665]: time="2022-12-21T20:39:47.594384282+08:00" level=warning msg="Failed to allocate a...in use"
Dec 21 20:39:47 jeven dockerd[123665]: time="2022-12-21T20:39:47.615584401+08:00" level=error msg="dbd5f6fc57c7375eac0a3b...tainer"
Dec 21 20:39:47 jeven dockerd[123665]: time="2022-12-21T20:39:47.615657859+08:00" level=error msg="Handler for POST /v1.41/conta...
Dec 21 21:07:33 jeven dockerd[123665]: time="2022-12-21T21:07:33.613099698+08:00" level=info msg="Container failed to exi...58d0d33
Dec 21 21:07:33 jeven dockerd[123665]: time="2022-12-21T21:07:33.672082582+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:07:33 jeven dockerd[123665]: time="2022-12-21T21:07:33.846567176+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:10:10 jeven dockerd[123665]: time="2022-12-21T21:10:10.815865446+08:00" level=info msg="Container failed to exi...175193d
Dec 21 21:10:10 jeven dockerd[123665]: time="2022-12-21T21:10:10.869591511+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:10:11 jeven dockerd[123665]: time="2022-12-21T21:10:11.021561879+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:15:51 jeven dockerd[123665]: time="2022-12-21T21:15:51.852283668+08:00" level=info msg="ignoring event" contain...Delete"
Hint: Some lines were ellipsized, use -l to show in full.


三、下载subsonic镜像

[root@jeven ~]#docker pull cyrilix/subsonic
Unable to find image 'cyrilix/subsonic:latest' locally
latest: Pulling from cyrilix/subsonic
c73ab1c6897b: Pull complete 
1ab373b3deae: Pull complete 
b542772b4177: Pull complete 
0bcc3741ab14: Pull complete 
421d624d778d: Pull complete 
26ad58237506: Pull complete 
8dbabc90b2b8: Pull complete 
982930be204d: Pull complete 
80869be51738: Pull complete 
b71ce0f0260c: Pull complete 
b18814a5c704: Pull complete 
444f958494eb: Pull complete 
6f92b6053b75: Pull complete 
a008355a31fd: Pull complete 
f6248f1e863f: Pull complete 
Digest: sha256:7e40c4c48997f956133da3a8aa1a4ca8f31947130d80b0b5ae822f460f740124
Status: Downloaded newer image for cyrilix/subsonic:latest

四、创建subsonic容器

1.创建subsonic容器

docker run \
  -d --name subsonic \
  --publish 8080:8080 \
  --volume "/data/subsnoic/music:/opt/music/:ro" \
   cyrilix/subsonic


2.查看subsonic容器状态


[root@jeven ~]# docker ps
CONTAINER ID   IMAGE              COMMAND                  CREATED          STATUS          PORTS                                           NAMES
069e3a0a7ed0   cyrilix/subsonic   "catalina.sh run"        43 minutes ago   Up 43 minutes   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp       subsonic




3.查看容器subsonic运行日志

[root@jeven ~]# docker logs subsonic 
24-Dec-2022 08:14:31.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.30
24-Dec-2022 08:14:31.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 3 2018 20:04:09 UTC
24-Dec-2022 08:14:31.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.30.0
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-1160.80.1.el7.x86_64
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_162-8u162-b12-1~deb9u1-b12
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.contextPath=/
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.home=/opt/data
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.defaultMusicFolder=/opt/music/
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.defaultPodcastFolder=/opt/podcast/
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.defaultPlaylistFolder=/opt/playlist/
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.5.2].
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
24-Dec-2022 08:14:31.840 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0f  25 May 2017]
24-Dec-2022 08:14:31.889 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
24-Dec-2022 08:14:31.901 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Dec-2022 08:14:31.907 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
24-Dec-2022 08:14:31.908 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Dec-2022 08:14:31.911 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 302 ms
24-Dec-2022 08:14:31.923 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Dec-2022 08:14:31.924 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.30
24-Dec-2022 08:14:31.942 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/ROOT.war]
24-Dec-2022 08:14:49.248 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
24-Dec-2022 08:15:02.019 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished in [30,076] ms
24-Dec-2022 08:15:02.020 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
24-Dec-2022 08:15:02.028 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [8] ms
24-Dec-2022 08:15:02.028 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
24-Dec-2022 08:15:02.142 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [114] ms
24-Dec-2022 08:15:02.143 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
24-Dec-2022 08:15:02.161 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [18] ms
24-Dec-2022 08:15:02.161 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
24-Dec-2022 08:15:02.170 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [9] ms
24-Dec-2022 08:15:02.176 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
24-Dec-2022 08:15:02.201 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
24-Dec-2022 08:15:02.242 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 30331 ms



五、访问Subsonic

admin/admin

image.png

image.png

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。