硬派網絡計費企業版 2.0 升級 3.0 教程

1. 安裝環境

操做系統建議:centos7linux

服務器配置建議: CPU:1核心(或以上),內存:2G(或以上),硬盤:50G(或以上)redis

不要與生產環境同一個服務器,避免影響生產環境,除非肯定執行升級sql

2. 下載軟件

cd /opt curl http://www.toughstruct.net/download/toughee-stable-linux-x64.tar.xz -o /opt/toughee-linux-x64.tar.xz數據庫

3. 部署系統

cd /opt tar xvf toughee-linux-x64.tar.xzjson

解壓縮獲得 /opt/toughee 目錄centos

注意: /opt/toughee 是默認目錄,若是要修改此目錄,必須同時修改 Makefile 和 radiusctl, toughee.conf 文件中的對應路徑。服務器

執行 make all 安裝curl

cd /opt/toughee make allurl

首次使用還需初始化數據庫,根據實際狀況修改 /opt/toughee/etc/toughee.json 的數據庫配置,默認採用 sqlite 數據庫。centos7

/opt/toughee/radiusctl initdb -c /opt/toughee/etc/toughee.json

4. 運行系統

service toughee start

全部日誌在 /var/toughee 目錄

5. 導入企業版2.0的數據

注意修改 /opt/toughee/etc/toughee.json 中 system 選項下的 secret 值,和老系統保持一致,避免密碼沒法加解密

執行升級腳本

/opt/toughee/radiusctl importe2 -i oldconfig.json -c /opt/toughee/etc/toughee.json -r 1000

說明:

/opt/toughee/radiusctl importe2 是導入腳本程序 -i oldconfig.json 是指企業版2.0的配置文件,通常是 /etc/radiusd.json -c /opt/toughee/etc/toughee.json 是指當前的新配置文件 -r 1000 表示一次批量插入數據的最大數,對於 sqlite,最大隻能49條。

須要保證安裝服務器能訪問企業版2.0的數據庫,腳本會自動分析數據並插入新數據庫

6. 使用系統

系統使用的端口能夠在 /opt/toughee/etc/toughee.json 中修改

默認端口以下:

  • 16370 默認 redis 服務端口,與 toughee.json 配置相符合
  • 1816 默認管理控制檯端口,能夠經過http://服務器地址:1816 訪問
  • 1819 默認自助服務端口,能夠經過http://服務器地址:1819 訪問
  • 1812 默認 Radius 認證端口,提供路由器接入設備訪問
  • 1813 默認 Radius 記帳端口,提供路由器接入設備訪問
相關文章
相關標籤/搜索