Serv-u FTP遷移(windows_to_windwos)

需求分析

公司服務器要作維護,部分服務器須要進行遷移處理,其中就包括Ser-v FTP服務器。vue

確認環境信息

角色 ip 系統版本 sql版本 Serv-U版本 ODBC account/password
舊服務器 192.168.1.18 Server 2003 R2 Enterprise x64 Edition Service Pack 2 community-5.7.10.0 ServU v15.1.2 5.1.13-winx64 heyt/hero922175
新服務器 192.168.1.179 (192.168.1.18)   community-5.7.10.0 ServU v15.1.2 5.1.13-winx64 administrator/Thinkiveftp18

原外網映射:218.17.161.51:18022mysql

備份服務器應用

備份分爲四個個部分:應用、配置文件、數據庫和附件。sql

應用/配置文件備份

應用安裝在E盤 E:\Serv_U\ 內chrome

E:\Serv_U\.
    ├─FTP_Workspace
    │  └─發佈目錄-文件路徑說明
    ├─LOG
    └─Serv_IN
        └─Serv-U

將Serv_IN目錄總體壓縮複製數據庫

附件備份

附件採用windows磁盤映射的方式,掛載至\192.168.1.252\ftpdatawindows

  • account:ftpdata
  • password:thinkive20060808

數據庫備份

  • 使用工具有份
    瀏覽器

  • 命令行備份服務器

mysqldump -u root -p `serv_u` > backup.sql
#回車後,輸入密碼
Enter password: ******

遷移還原

  • 將應用備份上傳到新服務器中,目錄同原始目錄保持一致
    • 原始目錄
F:.
├─FTP_Workspace
│  └─發佈目錄-文件路徑說明
├─LOG
└─Serv_IN
    └─Serv-U
[client]
loose-default-character-set = utf8

[mysql]
default-character-set = utf8
tee=E:\\Serv_U\\tools\\Mysql\\mysql\\logsquery.log
no-auto-rehash

[mysqld]
basedir = E:\\Serv_U\\tools\\Mysql\\mysql\\mysql-5.6.32-winx64
datadir = E:\\Serv_U\\tools\\Mysql\\mysql\\data
port = 3306
socket = E:\\Serv_U\\tools\\Mysql\\mysql\\logs\\mysql.sock
event_scheduler = 0

#GTID
gtid_mode = on
enforce_gtid_consistency = on

#timeout
interactive_timeout = 28800
wait_timeout = 28800

#character set
character-set-server = utf8
open_files_limit = 65535
max_connections = 500
max_connect_errors = 100000

#logs
log-output=file
slow_query_log = 1
slow_query_log_file = E:\\Serv_U\\tools\\Mysql\\mysql\\logs\\slow.log
log-error = E:\\Serv_U\\tools\\Mysql\\mysql\\logs\\error.log
log_warnings = 2
long_query_time = 1
#log-slow-admin-statements = 1
#log-queries-not-using-indexes = 1
log-slow-slave-statements = 1

#binlog
binlog_format = row
log-bin = mybinlog
binlog_cache_size = 4M
max_binlog_size = 1G
max_binlog_cache_size = 2G
sync_binlog = 1
max_allowed_packet = 4M
expire_logs_days = 10

#relay log
skip_slave_start = 1
max_relay_log_size = 1G
relay_log_purge = 1
relay_log_recovery = 1
log_slave_updates
#slave-skip-errors=1032,1053,1062

#buffers & cache
table_open_cache = 2048
table_definition_cache = 2048
table_open_cache = 2048
max_heap_table_size = 96M
sort_buffer_size = 2M
join_buffer_size = 2M
thread_cache_size = 256

query_cache_size = 0
query_cache_type = 0
query_cache_limit = 256K
query_cache_min_res_unit = 512
thread_stack = 192K
tmp_table_size = 96M
key_buffer_size = 8M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 32M

#innodb
innodb_buffer_pool_size = 1G
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 64M
innodb_log_file_size = 256M
innodb_log_files_in_group = 2
innodb_max_dirty_pages_pct = 50
innodb_file_per_table = 1
innodb_rollback_on_timeout
innodb_status_file = 1
innodb_io_capacity = 2000
transaction_isolation = READ-COMMITTED

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
  • 修改系統變量
    • Path後添加 mysql bin文件夾的路徑
    • 新建系統變量,變量名:MYSQL_HOME 變量值 E:\Serv_U\tools\Mysql\mysql\mysql-5.6.32-winx64
  • mysqld —install mysql —defaults-file=E:\Serv_U\tools\Mysql\mysql\mysql-5.6.32-winx64\my.ini
  • 端口暴露同原始一致:3306
  • 啓動命令:net start mysql
  • 關閉命令:net stop mysql
  • 設置MySQL數據庫root用戶密碼
mysqladmin.exe -uroot -p password "thinkive"
Enter password:【直接回車】
Warning: Using a password on the command line interface can be insecure.
  • 清理用戶
bin>mysql -uroot -p
Logging to file 'D:\MySQL\logs\query.log'
Enter password: thinkive
......
mysql> delete from mysql.user where user!='root' or host!='localhost';
mysql> truncate mysql.db;
mysql> drop database test;
mysql> flush privileges;
  • 設置root遠程鏈接
mysql> grant all privileges on *.* to root@"%" identified by 'thinkive' with grant option;
mysql> flush privileges;
  • 恢復數據庫文件

    • 工具直接導入(新數據庫)
      • 打開heidisql - > 鏈接新數據庫 -> 工具 -> 加載sql文件
    • 命令行導入數據(新數據庫)
      mysql -u root -p < backup.sql
  • 安裝ODBC配置數據源

    • 雙擊安裝 mysql-connector-odbc-5.1.13-winx64.msi
    • 開始 -> 管理工具 -> 數據源管理器 -> 系統DSN -> 添加 serv_u 數據源
  • 映射系統磁盤

    • 個人電腦 -> 工具 -> 映射網絡驅動器 -> 驅動器盤符選擇Z -> \192.168.1.252\ftpdata -> 輸入帳號/密碼進行添加
  • 添加Serv-u至windows服務

sc create "Serv-U File Server" binpath= "E:\Serv_U\Serv_IN\Serv-U\Serv-U.exe -service"
sc config "Serv-U File Server" start= auto
sc start "Serv-U File Server"

重啓服務

  • 添加 Serv-U File Server 至系統服務
    • 「E:\Serv_U\Serv_IN\Serv-U\Serv-U.exe」 -service
  • 設置系統服務登陸
    • 打開Serv-U File Server服務屬性,指定系統管理員帳號進行登陸
  • 運行FTP目錄下Serv-U-Tray.exe,添加系統運行控制檯
  • 安裝chrome瀏覽器
  • 界面右下角系統運行控制檯,右鍵選擇系統瀏覽器進行運行(進入系統管理頁面-只有該頁面能夠設置羣組及目錄權限)
  • 雙擊已製做好的快捷啓動應用
    • open.exe

Serv-U使用

  • 訪問和登陸Serv-U

    • 啓動Serv-U服務後,瀏覽器直接訪問 http://Serv-U服務器ip:80端口 便可訪問和登陸Serv-U。
    • 注:若是網頁沒法訪問,請先關閉Serv-U所在電腦的防火牆嘗試刷新網頁訪問。
    • Serv-U默認管理,登陸服務器
      • E:\Serv_U\Serv_IN\Serv-U\Serv-U-Tray.exe -administrator
      • 配置Serv_U羣組分配羣組權限,只能使用改方式操做
  • Serv-U數據庫

    • heidisql工具訪問
      • 網絡類型:默認選擇MySQL。
      • 主機名/IP:127.0.0.1:mysql端口
      • 用戶名: root
      • 密 碼:xxxxxx
      • 數據庫:serv_u
        • 數據庫存儲目錄: 默認在
          • C:\Program Files\MySQL\MySQL Server 5.0\Data

異常處理

Server 2003 R2 Enterprise x64 Edition Service Pack 2 正常狀況下是沒法打開瀏覽器的,須要安裝如下插件:

相關文章
相關標籤/搜索