参考链接
(4条消息) 【个人学习总结】使用docker搭建Teamspeak服务器_blcurtain的博客-CSDN博客_teamspeak3 docker
(⊙﹏⊙)哎呀,崩溃啦! (tdeh.top)
TeamSpeak服务器搭建与使用 - 缘梦の镇 (cmsboy.cn)
Openwrt X86 docker运行甜糖-软路由,x86系统,openwrt(x86),Router OS 等-恩山无线论坛 - Powered by Discuz! (right.com.cn)
Teamspeak3 服务器端安装教程,由ROCBRAUN编辑整理
安装docker
sudo wget -qO- https://get.docker.com/ | bash
安装成功执行下面语句,如果有类似回显,说明安装成功
docker --version
Docker version 18.06.1-ce, build e68fc7a
systemctl enable docker # 开机自动启动docker
systemctl start docker # 启动docker
systemctl restart docker # 重启dokcer
docker run -e TS3SERVER_LICENSE=view teamspeak
docker run -dit -p 9987:9987/udp -p 10011:10011 -p 30033:30033 -e TS3SERVER_LICENSE=accept teamspeak
密钥获取
在var/lib/docker/container/里面找到最新的日志
搭建属于自己的 TeamSpeak 服务器 - 知乎 (zhihu.com)
软路由
软路由服务
守护进程重启 sudo systemctl daemon-reload
重启docker服务 systemctl restart docker
重启docker服务 sudo service docker restart
root@OpenWrt:~# systemctl restart docker
-bash: systemctl: command not found
In OpenWrt, the default init system is not systemd, which provides "systemctl" command. Instead, OpenWrt uses the procd init system, and the command to restart a service is different.
To restart Docker service in OpenWrt, you can use the following command:
在OpenWrt中,默认的init系统不是systemd, systemd提供了“systemctl”命令。相反,OpenWrt使用procd init系统,重启服务的命令是不同的。
在OpenWrt中重启Docker服务,可以使用以下命令:
/etc/init.d/docker restart
This will restart the Docker service using the init script provided by OpenWrt.
The error message "No such file or directory" indicates that the Docker service is not installed on your OpenWrt system, or it was not installed correctly.
root@OpenWrt:~# opkg list-installed | grep docker
docker - 20.10.17-1
dockerd - 20.10.17-1
luci-app-dockerman - v0.5.25-1
luci-i18n-dockerman-zh-cn - v0.5.25-1
luci-lib-docker - v0.3.4-1
login
在OpenWrt上,根用户的默认shell是“ash”,它不支持“su”命令。相反,您可以使用“登录”命令切换到root用户帐号。要切换到root用户帐号:请使用以下命令:
系统将提示您输入root用户密码。输入正确的密码后,您将以root用户登录,并拥有完全的管理权限。
请注意,默认情况下,“login”命令可能不会安装在您的系统上。如果是这样的话,你可以使用以下命令使用“opkg”包管理器安装它:
opkg update
opkg install busybox
如果该命令返回“/bin/login”或“/usr/bin/login”这样的路径,那么“login”命令已经安装在您的系统上,您可以使用它切换到root用户帐户。
如果该命令没有返回路径或返回错误消息,您可能需要尝试安装或重新安装“busybox”包,以确保“login”命令在您的系统上可用
root@OpenWrt:~# which login
/bin/login
root@OpenWrt:~# login
要使用 "teamspeak" 镜像启动一个 Docker 容器,您可以使用以下命令:
docker run --name teamspeak-server -p9987:9987/udp -p 10011:10011 -p 30033:30033 -d teamspeak
此命令将使用名称为 "teamspeak-server" 的容器和 "teamspeak" 镜像启动 TeamSpeak 服务器。"-p" 选项将容器的端口映射到主机系统上的相应端口,以便客户端可以连接到 TeamSpeak 服务器。"-d" 选项以分离模式运行容器,使其在后台运行。
root@OpenWrt:~# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
teamspeak latest b210d36a31e3 4 months ago 26.9MB
root@OpenWrt:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
703b9bb1e504 teamspeak "entrypoint.sh ts3se…" 5 hours ago Up 39 minutes 0.0.0.0:10011->10011/tcp, :::10011->10011/tcp, 0.0.0.0:9987->9987/udp, :::9987->9987/udp, 0.0.0.0:30033->30033/tcp, :::30033->30033/tcp optimistic_shtern
root@OpenWrt:~#
2
root@OpenWrt:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
703b9bb1e504 teamspeak "entrypoint.sh ts3se…" 5 hours ago Up 39 minutes 0.0.0.0:10011->10011/tcp, :::10011->10011/tcp, 0.0.0.0:9987->9987/udp, :::9987->9987/udp, 0.0.0.0:30033->30033/tcp, :::30033->30033/tcp optimistic_shtern
这个输出显示了一个名为 "optimistic_shtern" 的 Docker 容器,它使用 "teamspeak" 镜像运行 TeamSpeak 服务器,并已经在运行中。该容器已经运行了 39 分钟,它正在侦听 TCP 端口 10011 和 30033,以及 UDP 端口 9987。
要停止容器,可以使用以下命令:
查看日志
要查看 "optimistic_shtern" 容器的日志,您可以使用以下命令:
docker logs optimistic_shtern
这将输出容器的日志信息,您可以在其中查看 TeamSpeak 服务器的输出。如果您想实时监视日志,请使用以下命令:
docker logs -f optimistic_shtern
这将跟随容器的日志输出,并在新的日志行添加时将其输出到控制台。要停止实时监视,请按 "Ctrl+C"。
root@OpenWrt:~# docker logs optimistic_shtern
2023-02-27 04:03:53.723189|INFO |ServerLibPriv | |TeamSpeak 3 Server 3.13.7 (2022-06-20 12:21:53)
2023-02-27 04:03:53.723435|INFO |ServerLibPriv | |SystemInformation: Linux 5.4.203 #0 SMP Sun Jul 31 05:25:41 2022 x86_64 Binary: 64bit
2023-02-27 04:03:53.723541|INFO |ServerLibPriv | |Using hardware aes
2023-02-27 04:03:53.723889|INFO |DatabaseQuery | |dbPlugin name: SQLite3 plugin, Version 3, (c)TeamSpeak Systems GmbH
2023-02-27 04:03:53.723982|INFO |DatabaseQuery | |dbPlugin version: 3.11.1
2023-02-27 04:03:53.724252|INFO |DatabaseQuery | |checking database integrity (may take a while)
2023-02-27 04:03:53.737406|INFO |SQL | |db_CreateTables() tables created
------------------------------------------------------------------
I M P O R T A N T
------------------------------------------------------------------
Server Query Admin Account created
loginname= "serveradmin", password= "NDjQWXhF"
apikey= "BACz2VUZeU_CivxGeQcU60gKyhk51TEWj8_kQBT"
------------------------------------------------------------------
2023-02-27 04:03:53.774346|WARNING |Accounting | |Unable to open licensekey.dat, falling back to limited functionality
2023-02-27 04:03:53.788095|INFO |Accounting | |Licensing Information
2023-02-27 04:03:53.788166|INFO |Accounting | |licensed to : Anonymous
2023-02-27 04:03:53.788217|INFO |Accounting | |type : No License
2023-02-27 04:03:53.788255|INFO |Accounting | |starting date : Tue Feb 1 00:00:00 2022
2023-02-27 04:03:53.788307|INFO |Accounting | |ending date : Thu Jul 1 00:00:00 2027
2023-02-27 04:03:53.788350|INFO |Accounting | |max virtualservers: 1
2023-02-27 04:03:53.788379|INFO |Accounting | |max slots : 32
2023-02-27 04:03:55.068452|INFO | | |Puzzle precompute time: 1249
2023-02-27 04:03:55.069141|INFO |FileManager | |listening on 0.0.0.0:30033, [::]:30033
2023-02-27 04:03:55.070120|INFO |VirtualSvrMgr | |executing monthly interval
2023-02-27 04:03:55.070427|INFO |VirtualSvrMgr | |reset virtualserver traffic statistics
2023-02-27 04:03:55.074763|INFO |Query | |Using a query thread pool size of 2
2023-02-27 04:03:55.101589|INFO |VirtualServerBase|1 |listening on 0.0.0.0:9987, [::]:9987
2023-02-27 04:03:55.102307|WARNING |VirtualServer |1 |--------------------------------------------------------
2023-02-27 04:03:55.102363|WARNING |VirtualServer |1 |ServerAdmin privilege key created, please use the line below
2023-02-27 04:03:55.102419|WARNING |VirtualServer |1 |token=iTZ6Qh1IqqJzRhQd+Nr6ste0UXy0w8+s9OHs8ojL
2023-02-27 04:03:55.102465|WARNING |VirtualServer |1 |--------------------------------------------------------
------------------------------------------------------------------
I M P O R T A N T
------------------------------------------------------------------
ServerAdmin privilege key created, please use it to gain
serveradmin rights for your virtualserver. please
also check the doc/privilegekey_guide.txt for details.
token=iTZ6Qh1IqqJzRhQd+Nr6ste0UXy0w8+s9OHs8ojL
------------------------------------------------------------------
2023-02-27 04:03:55.102715|INFO |Query | |listening for query on 0.0.0.0:10011, [::]:10011
2023-02-27 04:03:55.102937|INFO |CIDRManager | |updated query_ip_allowlist ips: 127.0.0.1/32, ::1/128,
2023-02-27 04:03:59.311642|INFO | | |myTeamSpeak identifier revocation list was downloaded successfully - all related features are activated
2023-02-27 08:26:26.779128|INFO |ServerMain | |Received signal SIGTERM, shutting down.
2023-02-27 08:26:26.780243|INFO |VirtualServerBase|1 |stopped
2023-02-27 08:26:27.864438|INFO |ServerLibPriv | |TeamSpeak 3 Server 3.13.7 (2022-06-20 12:21:53)
2023-02-27 08:26:27.865043|INFO |ServerLibPriv | |SystemInformation: Linux 5.4.203 #0 SMP Sun Jul 31 05:25:41 2022 x86_64 Binary: 64bit
2023-02-27 08:26:27.865142|INFO |ServerLibPriv | |Using hardware aes
2023-02-27 08:26:27.866191|INFO |DatabaseQuery | |dbPlugin name: SQLite3 plugin, Version 3, (c)TeamSpeak Systems GmbH
2023-02-27 08:26:27.866523|INFO |DatabaseQuery | |dbPlugin version: 3.11.1
2023-02-27 08:26:27.867203|INFO |DatabaseQuery | |checking database integrity (may take a while)
2023-02-27 08:26:27.989970|WARNING |Accounting | |Unable to open licensekey.dat, falling back to limited functionality
2023-02-27 08:26:28.005905|INFO |Accounting | |Licensing Information
2023-02-27 08:26:28.006007|INFO |Accounting | |licensed to : Anonymous
2023-02-27 08:26:28.006045|INFO |Accounting | |type : No License
2023-02-27 08:26:28.006080|INFO |Accounting | |starting date : Tue Feb 1 00:00:00 2022
2023-02-27 08:26:28.006130|INFO |Accounting | |ending date : Thu Jul 1 00:00:00 2027
2023-02-27 08:26:28.006169|INFO |Accounting | |max virtualservers: 1
2023-02-27 08:26:28.006226|INFO |Accounting | |max slots : 32
2023-02-27 08:26:29.212531|INFO | | |Puzzle precompute time: 1174
2023-02-27 08:26:29.213087|INFO |FileManager | |listening on 0.0.0.0:30033, [::]:30033
2023-02-27 08:26:29.216664|INFO |Query | |Using a query thread pool size of 2
2023-02-27 08:26:29.301151|INFO |VirtualServerBase|1 |listening on 0.0.0.0:9987, [::]:9987
2023-02-27 08:26:29.301481|INFO |Query | |listening for query on 0.0.0.0:10011, [::]:10011
2023-02-27 08:26:29.301632|INFO |CIDRManager | |updated query_ip_allowlist ips: 127.0.0.1/32, ::1/128,
可以访问
这个日志条目表示 TeamSpeak 服务器已经更新了允许连接到服务器的 IP 地址列表。在这种情况下,允许连接到服务器的 IP 地址是 127.0.0.1 和 ::1,这些 IP 地址分别对应于本地主机的 IPv4 和 IPv6 地址。
这个日志条目中的 "CIDRManager" 表示 IP 地址范围的管理器,"query_ip_allowlis" 是一个配置选项,用于指定允许连接到服务器的 IP 地址列表。如果您想更改此列表,可以编辑 TeamSpeak 服务器的配置文件,并修改 "query_ip_allowlis" 选项的值。
正在连接到服务器 192.168.1.1
<16:30:13> Welcome to TeamSpeak, check www.teamspeak.com for latest information
<16:30:13> 已连接到服务器: "TeamSpeak ]I[ Server"
<16:30:15> 服务器连接断开
<16:30:27> 正在连接到服务器 172.17.0.2
<16:30:27> Welcome to TeamSpeak, check www.teamspeak.com for latest information
解释
要在软路由上搭建 TeamSpeak 服务器,您需要遵循以下步骤:
确定您的软路由是否支持运行 TeamSpeak 服务器。请查看您的路由器的规格和文档,以确定它是否满足 TeamSpeak 服务器的最低要求。
在软路由上安装 Linux 操作系统。请查看您的路由器的规格和文档,以查看它是否支持安装 Linux 操作
添加运行TeamSpeak程序的用户,出于安全性的考虑,TeamSpeak服务器并不建议使用 root 用户来执行,所以我们可以创建一个用户 teamspeak 来单独执行TeamSpeak服务器程序。使用如下命令创建用户 teamspeak 并为其设置密码
useradd teamspeak
passwd teamspeak //密码随意填写
花生壳软路有,穿透。
2.TeamSpeak的一些端口开放
端口 | 协议 | 说明 |
9987 | UDP | 默认语音服务端口 |
10011 | TCP | ServerQuery raw 端口 |
10022 | TCP | ServerQuery SSH 端口(3.3.0 以上版本服务端) |
30033 | TCP | 文件传输端口(上传每个房间的头像这个端口就必须开) |
41144 | TCP | TSDND |
而实在想用中文的,有大佬在做官方汉化包,网址是https://github.com/jitingcn/TS3-Translation_zh-CN/releases,客户端以及汉化包都转存至我的服务器可以高速下载了点我直达