添添呼  |  管理一步到位
免费试用
产品资料-老版呼叫中心(CRM)-安装手册
来源: | 作者:成都添闰 | 发布时间: 2026-10-08 | 60 次浏览 | 🔊 点击朗读正文 ❚❚ ▶ | 分享到:

呼叫中心在线安装手册


以下步骤前提条件:



  • 系统为Ubuntu22.04或其它支持的系统


  • 没有安装 Docker

  • 没有部署过呼叫中心系统或者其它系统


  • 拥有root权限并切换成root

  • 网络连接正常,能联网访问


  • 登录 Docker仓库


[toc]


一、安装前准备


  1. 切换到ROOT(已经登录root请忽略)


以 Ubuntu为例,先登录一个普通用户,再输入 sudo -i 切换到 root


# 输入当前用户密码(非root密码)
# 切换到root后,提示符由$变为#
# 比如登录了一个 XXXX 用户,输入命令后再输入 XXXX 的密码
xxxx@xxxxserver:~$ sudo -i
[sudo] password for xxxx:
root@tianrunserver:~#


免密sudo


# 在普通用户下执行
echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/$USER


2. 磁盘管理


Ubuntu默认使用lvm管理磁盘,安装后使用lsblk查看磁盘状态,可能需要扩容


lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
resize2fs /dev/ubuntu-vg/ubuntu-lv


如果用户需要使用额外的磁盘, 需要提前挂载, 配置在/etc/fstab


3. 管理网络


ip命令


# 查看 IP 地址
ip addr
ip addr show dev eth0
# 临时添加 IP 地址,重启失效
ip addr add 10.102.66.200/24 dev eth0
# 启动和停用网卡
ip link set dev eth0 up
ip link set dev eth0 down
# 查看路由
ip route show
# 临时添加默认路由
ip route add default via 10.102.66.1
# 删除默认路由
ip route del default via 10.102.66.1
# 清空网络
ip addr flush eth0
# 临时配置DNS
vim /etc/resolv.conf


netplan管理网络(Ubuntu)


配置文件/etc/netplan/99_config.yaml(名字可以是其它的,如果需要系统管理需要这个名称)


动态获取 IP


network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: true


静态获取 IP,可以设置 IP,路由,DNS,注意网卡名


network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 10.10.10.2/24
      routes:
        - to: default
          via: 10.10.10.1
      nameservers:
          search: [mydomain, otherdomain]
          addresses: [10.10.10.1, 1.1.1.1]


配置生效运行


netplan apply


NetworkManager管理网络(CentOS/UOS)


nmtui命令是图形化操作,省略步骤


4. 检查时区和时间同步(可选)


时区设置


# 查看时区设置
timedatectl
# 设置时区为上海
timedatectl set-timezone Asia/Shanghai


时间同步服务(Ubuntu)


# 配置
echo "[Time]
NTP=ntp.aliyun.com
FallbackNTP=ntp.tuna.tsinghua.edu.cn" > /etc/systemd/timesyncd.conf
# 启动
systemctl enable systemd-timesyncd
systemctl restart systemd-timesyncd


时间同步服务(CentOS/UOS)


# 安装
yum install chrony
# 配置
echo "server ntp.aliyun.com iburst
stratumweight 0
driftfile /var/lib/chrony/drift
rtcsync
makestep 10 3
bindcmdaddress 127.0.0.1
bindcmdaddress ::1
keyfile /etc/chrony.keys
commandkey 1
generatecommandkey
logchange 0.5
logdir /var/log/chrony" > /etc/chrony.conf

# 启动服务
systemctl start chronyd
systemctl enable chronyd
# 查看状态
chronyc sources


5. 关闭apparmor或selinux


# apparmor(Ubuntu)
systemctl disable apparmor
systemctl stop apparmor

# selinux(CentOS/UOS)
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config


6. 关闭firewall或ufw


# ufw(Ubuntu)
ufw disable

# firewalld(CentOS/UOS)
systemctl stop firewalld
systemctl disable firewalld


7. 系统优化


# TCP 优化
echo "net.ipv4.tcp_fin_timeout=30" > /etc/sysctl.d/20-default.conf
echo "net.ipv4.tcp_keepalive_intvl=10" >> /etc/sysctl.d/20-default.conf
echo "net.ipv4.tcp_keepalive_probes=3" >> /etc/sysctl.d/20-default.conf
echo "net.ipv4.tcp_keepalive_time=60" >> /etc/sysctl.d/20-default.conf
sysctl -p /etc/sysctl.d/20-default.conf

# 最大打开文件数
echo "root soft nofile 65535" > /etc/security/limits.d/20-nofile.conf
echo "root hard nofile 65535" >> /etc/security/limits.d/20-nofile.conf
echo "* soft nofile 65535" >> /etc/security/limits.d/20-nofile.conf
echo "* hard nofile 65535" >> /etc/security/limits.d/20-nofile.conf
# 最大进程数配置
echo "* - nproc 65535" > /etc/security/limits.d/20-nproc.conf
echo "root soft nproc unlimited" >> /etc/security/limits.d/20-nproc.conf
echo "root hard nproc unlimited" >> /etc/security/limits.d/20-nproc.conf
ulimit -SHn 65535

# 如果需要在程序运行时增加
# prlimit --nofile=65535:65535 --pid 39977


8. 删除自动更新程序


防止内网使用服务器卡死


apt remove unattended-upgrades -y


9. openvpn配置(需要手动配置)


apt-get install openvpn
#下载证书(需要在服务器上提前生成sh /soft/install/install/vpn.sh)
cd /etc/openvpn/
wget http://47.104.144.93:81/vpn/files/ca.crt
wget http://47.104.144.93:81/vpn/files/ca.key
wget http://47.104.144.93:81/vpn/files/client.ovpn
wget http://47.104.144.93:81/vpn/files/vpnready
wget http://47.104.144.93:81/vpn/files/$(cat /etc/openvpn/vpnready).crt
wget http://47.104.144.93:81/vpn/files/$(cat /etc/openvpn/vpnready).csr
wget http://47.104.144.93:81/vpn/files/$(cat /etc/openvpn/vpnready).key
sed -i "s/tianr/$(cat /etc/openvpn/vpnready)/g" client.ovpn
rm -rf /etc/openvpn/vpnready
#运行
mv client.ovpn client.conf
systemctl enable openvpn@client
systemctl start openvpn@client


snap卸载


snap list
# snap remove --purge «snap»
apt remove --purge snapd
apt-mark hold snapd
rm -rf /home/*/snap
find / -type d -name snap


禁用 cloud-init


sudo apt purge cloud-init -y
sudo rm -rf /etc/cloud && sudo rm -rf /var/lib/cloud/


二、安装 Docker


  1. 在线自动化安装 Docker 脚本

cd /tmp
curl -fsSL http://117.139.247.192:81/packages/get-docker.sh -o get-docker.sh
sh get-docker.sh --mirror Aliyun # 国际用户可以不加--mirror Aliyun

# 安装iptables依赖,必须安装
apt install ipset fail2ban -y


2. 离线安装docker


离线安装请参考 [打开](./从二进制安装 Docker.md)


3. docker配置


# 镜像加速以及日志大小限制
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "log-driver":"json-file",
  "log-opts": {"max-size":"100m", "max-file":"3"},
  "userland-proxy": true,
  "insecure-registries": ["117.139.247.192:5000"]
}
EOF


4. 启动 Docker


systemctl enable docker # 开机自启
systemctl restart docker

三、初始化环境


  1. 在线下载

docker下载镜像前需登录


docker login 117.139.247.192:5000 # 用户名密码请联系管理员


运行初始化镜像,注意版本


# 下载初始化镜像并运行,第一次部署时需要运行
# 这个镜像主要包含,配置文件和脚本,还有一些默认录音音频文件
docker pull 117.139.247.192:5000/tianrun/init-crm:v6.0.6

# 运行(如果之前运行过,/usr/local/tianrun/env.sh会存在,如果需要重新运行,需要删除这个文件)
docker run -it --rm 
-v /usr/local/tianrun:/usr/local/tianrun 
-v /lib/systemd/system/:/lib/systemd/system/ 
-v /etc/systemd/system/multi-user.target.wants/:/etc/systemd/system/multi-user.target.wants/  
-v /etc/profile.d/:/etc/profile.d/ 
-v /soft/upload:/soft/upload 
117.139.247.192:5000/tianrun/init-crm:v6.0.6

# 加载环境变量
source /etc/profile.d/tianrun_profile.sh

# 一键下载/更新镜像
sh /usr/local/tianrun/pull.sh


2. 离线导入


下载镜像文件


# 导入镜像文件
docker load -i allinone_6.0.6_x86_64.tar.gz

# 运行(如果之前运行过,/usr/local/tianrun/env.sh会存在,如果需要重新运行,需要删除这个文件)
docker run -it --rm 
-v /usr/local/tianrun:/usr/local/tianrun 
-v /lib/systemd/system/:/lib/systemd/system/ 
-v /etc/systemd/system/multi-user.target.wants/:/etc/systemd/system/multi-user.target.wants/  
-v /etc/profile.d/:/etc/profile.d/ 
-v /soft/upload:/soft/upload 
117.139.247.192:5000/tianrun/init-crm:v6.0.6


# 加载环境变量
source /etc/profile.d/tianrun_profile.sh


五、管理服务


1. 守护进程


# 一键下载/更新镜像
systemctl daemon-reload
# 启动服务, 镜像更新好需要重启,start/stop/restart/enable/disable
# 先启动数据库和插件
systemctl start tr-mysql
-- 导入数据库
cd /usr/local/tianrun/base
docker exec -i tr-mysql mysql -uroot -p'CDlifei888!' callcenter < callcenter.sql

systemctl start tr-postgres
-- 导入数据库
cd /usr/local/tianrun/base
docker exec -i tr-postgres psql -U ocean -d ocean < ocean.sql
-- 创建数据库
docker exec -i tr-postgres psql -U ocean -d ocean -c "create database freeswitch"

sh /usr/local/tianrun/base/init.sh # 加载配置

systemctl start tr-nginx
systemctl start tr-rabbitmq
systemctl start crm
systemctl start crm-script
systemctl start ocean
systemctl start freeswitch
systemctl start ippbx
systemctl start tr-iptables


2. 防火墙


vim /usr/local/tianrun/iptables/config-crm.sh # 防火墙主要采用白名单策略,根据业务自行加白


3. 配置文件


可以管理以下内容


网络端口


存储路径


软件版本


vim /usr/local/tianrun/env.sh # 修改后需要重启对应的守护进程


5. 日志文件


存储路径可以在配置中修改


t12 # crm 日志
t13 # ippbx 日志
t14 # fs 日志
t15 # ocean 日志
t16 # crm-script 日志


6. portainer


一个容器管理平台,可以在web上直观的管理容器


docker pull 117.139.247.192:5000/tianrun/portainer-ce:2.11.0-alpine
# 创建一个volume 用于存储 portainer 数据
docker volume create portainer_data
# 启动portainer
docker run -d -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data 117.139.247.192:5000/tianrun/portainer-ce:2.11.0-alpine


7. shellinabox


web上使用的ssh客户端


docker pull 117.139.247.192:5000/tianrun/shellinabox
docker volume create webshell_data
docker volume create webshell_conf
docker volume create webshell_log
docker run --name webshell --restart=always -d -p 5000:5000 
-v webshell_conf:/etc/shellinabox -v webshell_data:/home -v webshell_log:/var/log/supervisor -e SIAB_PORT=5000 -e SIAB_USER=webshell -e SIAB_PASSWORD=CDtianrun888 117.139.247.192:5000/tianrun/shellinabox


访问地址:https://192.168.1.99:5000


登录后需要再使用ssh跳转到宿主机上


ssh tianrun@192.168.1.99


8. adminer


web上使用的数据库客户端


docker run --name adminer --restart=always -d --network=tr-network --link tr-mysql:db -p 38080:8080 117.139.247.192:5000/tianrun/adminer:4.8.1-standalone


访问地址:http://192.168.1.99:38080