前言及配置 #
配置:
- 腾讯云
- 系统 CentOS 7.6 64bit
- 实例规格 CPU: 2核 内存: 4GB
- 系统盘 60GB SSD云硬盘
- 流量包 1000GB/月(带宽:6Mbps)
迁移后配置:
- 阿里云
- CentOS 8.2 64位
- 2核(vCPU) 2 GiB
- 3 Mbps
- ESSD Entry云盘 40GiB (2120 IOPS)
安装配置服务端 #
在准备好文件之后,就开始安装服务端了,
首先升级系统更新依赖包
yum update
接下来开启防火墙端口:
firewall-cmd --zone=public --add-port=9987/udp --permanent
firewall-cmd --zone=public --add-port=10011/tcp --permanent
firewall-cmd --zone=public --add-port=30033/tcp --permanent
firewall-cmd --reload
一般来说,我们都是以roo权限登陆的服务器,但是由于teamspeak是不能用这一用户运行的,因此我们需要新建一个``用户来运行teamspeak服务端文件:
useradd teamspeak
passwd teamspeak
第二个指令之后会要求你输入新建的这个用户的密码并再次确认,跟着走就行了。
接下来,将之前准备好的服务端文件上传至服务器并解压,同时重命名文件夹(我这里是直接上传解压至/www/ts3server):
tar -xvf teamspeak3-server_linux_amd64-3.6.0.tar.bz2
mv teamspeak3-server_linux_amd64 ts3server
注意,这里服务端的版本号可能随着更新而变化,使用的时候不要直接复制
由于我们是将用teamspeak这一用户来运行服务端文件,因此我们还要把它拷贝给该用户并设置权限: 注意这里请填写自己的路径
cp -R teamspeak3 /www/ts3server/
chown -R teamspeak:teamspeak /www/ts3server/
接下来就是运行服务端文件了,首先切换到我们刚才新建的用户:
su - teamspeak
接下来进入服务端文件所在的目录(也就是我们之前重命名并拷贝过来的那一个):
cd ts3server
接下来先不急着运行,我们先来创建一个新文件。如果这里我们不这么做,那么在运行时服务端会报错,因为它没有读到这个授权文件:
touch .ts3server_license_accepted
在授权文件建立好了之后,我们就可以运行服务端了:
./ts3server_startscript.sh start
运行之后,你可以看到这样一串信息,那么恭喜你,服务端运行成功了
把这一段信息复制下来备用,之后Ctrl +c终止服务即可;
然后直接再输入上面的指令直接继续运行,会提示:‘Starting the TeamSpeak 3 server TeamSpeak 3 server started, for details please view the log file’,这时可以直接关闭连接窗口。
客户端连接、配置 #
安装客户端完毕之后,打开并选择connections–connect,输入服务端IP,即可连接上服务器,第一个连接服务端的用户会被要求输入密钥,之后该用户就被登记为服务器管理员,管理员可以通过客户端对服务器进行设置
数据迁移 #
请遵循来自 ts官网的教程进行迁移
The following files and folders need to copied if you want to retain the respective information:
licensekey.dat
This file contains your license. You may not have this file, in which case you don't have to copy it
query_ip_whitelist.txt
Whitelisted IPs for the query interface
query_ip_blacklist.txt
Blacklisted IPs for the query interface
files/*
Any Icons, Avatars and files that were uploaded to the server. Be sure to copy the entire folder including any subfolders and files inside.
ts3server.sqlitedb
The database. This file is the most important one and contains all the information about virtual servers, users, permissions, channels and groups etc. All Settings of the server instance and its virtual servers are contained in this file.
*.ini
Possibly existing file(s) containing startup parameters and database configuration. These do not exist by default
tsdns/tsdns_settings.ini
The configuration for the TSDNS service. This is only needed if you actually use TSDNS.
我这边的情况是只需要迁移files文件夹与ts3server.sqlitedb数据库文件,这两个都在ts3sever的根目录。
先关闭服务:./ts3server_startscript.sh stop
覆盖进去再启动即可。迁移完毕之后如果使用的是同域名会提醒所有之前连接过的人服务器已变更,无视即可。
*.ini设置文件我并没有更改,因此没有迁移。(黑白名单同理)
安装部分内容来源:https://www.bilibili.com/read/cv1940769