飘在云端

东西南北,海角天涯

· seafile · · 319次浏览

记一次seafile升级步骤

目标:seafile Pro 7.1.1 Beta 升级到 7.1.3 Pro
最后更新:2020-5-22 20:37:22,依葫芦画瓢,从7.1.3升级到7.1.4,一次成功。

下面教程仅适用维护版本升级,如7.1.0-7.1.1.,不适用其他版本升级,如次版本升级就是 7.0.11-7.1.1,主版本升级就是6.x.x-7.x.x,

  1. CD 到如下路径,/root/seafile/installed 路径中的seafile为部署seafile的顶层目录,如我的seafile部署在 /root/seafile,顶层目录就是seafile,installed为按照官方的最佳部署实践创建的目录,用于存放下载升级的安装包。
  2. https://customer.seafile.com/downloads/登录你的seafile账号,下载你需要升级的seafile版本,注意对应发行的Linux版本,下载seafile到 /root/seafile/installed,根据自身部署的路径进行修改

    axel --insecure -a -n 16 https://download.seafile.com/seafhttp/files/c19d97b9-e125-4dd2-a35e-46674a8af459/seafile-pro-server_7.1.3_x86-64_CentOS.tar.gz

  3. 修改权限,自行修改命令对应版本号,解压:

    chmod 777 seafile-pro-server_7.1.3_x86-64_CentOS.tar.gz
    tar zxvf seafile-pro-server_7.1.3_x86-64_CentOS.tar.gz -C ../

  4. 清理seafile缓存,停止seafile 相关服务,停止 elasticsearch 服务,注意,如果是部署为systemd之类的系统服务,自行停止对应的服务

    rm -rf /tmp/seahub_cache/*
    /root/seafile/seafile-server-latest/seahub.sh stop
    /root/seafile/seafile-server-latest/seafile.sh stop
    ps -ef | grep elasticsearch | awk '{print "kill " $2}' | sh

  5. CD到解压完的新版本seafil的目录,如 /root/seafile/seafile-pro-server-7.1.3,执行升级脚本

    upgrade/minor-upgrade.sh

  6. 接着返回成功结果

     [root@302 seafile-pro-server-7.1.3]# upgrade/minor-upgrade.sh
         
      -------------------------------------------------------------
     This script would do the minor upgrade for you.
     Press [ENTER] to contiune
     -------------------------------------------------------------  
     renaming the gunicorn.conf to gunicorn.conf.py ...
     Done
     ------------------------------
     migrating avatars ...   
     DONE
     ------------------------------
      Moving the elasticsearch's configuration file ...
     "/root/seafile/seafile-server-latest/pro/elasticsearch/config/jvm.options" -> "/root/seafile/seafile-pro-server-7.1.3/pro/elasticsearch/config/jvm.options"
     updating seafile-server-latest symbolic link to /root/seafile/seafile-pro-server-7.1.3 ...
     DONE
     ------------------------------
    

    7.启动seafile相关服务,启动seafile搜索插件 elasticsearch ,注意,由于elasticsearch 从5.x起不支持root身份运行,所以得专门创个普通用户来运行elasticsearch
    备注:只要升级了seafile,并且运行在root权限下,那么每次升级,都需要重新赋权,因为升级脚本把elasticsearch插件目录权限给覆盖回root权限,所以要手动赋权,chown -R elasticsearch:elasticsearch elasticsearch,前面2个elasticsearch为用户名和用户组,第三个为插件目录的路径,这里我CD到了这个插件路径,所以没有填写完整路径。
    新建名为elasticsearch的普通用户,设置该用户密码为elasticsearch
    adduser elasticsearch
    passwd elasticsearch
    把seafile下的那个搜索插件的目录赋权给新用户,命令行末尾的elasticsearch为插件目录路径,我这里填了相对路径,如果没CD到elasticsearch插件所在的目录,请使用完整路径,如/root/seafile/seafile-server-latest/pro/elasticsearch

    chown -R elasticsearch:elasticsearch elasticsearch

    至于seafile下面的logs目录里面的相关elasticsearch日志报错,一堆root权限运行的报错警告不理他,全部无视,因为我的seafile是root权限下运行的,启动时默认调用elasticsearch,导致一堆报错, 是正常的,我们切换回elasticsearch这个普通用户,来单独启动elasticsearch这个搜索插件:
    切换为elasticsearch这个普通用户,启动elasticsearch:

    su elasticsearch
    nohup /root/seafile/seafile-server-latest/pro/elasticsearch/bin/elasticsearch &
    exit

    接着ps aux |grep elasticsearch |grep -v grep ,检查elasticsearch是否正在运行,如果返回空内容,说明启动失败,需要查看seafile/logs/下面的日志文件,返回一大串 elasticsearch 的进程信息,说明启动成功。
    重建搜索索引,重建搜索索引的所用时间,与你的seafile上存储的文件数据量成正比关系,并启动seafile服务:
    /root/seafile/seafile-server-latest/pro/pro.py search --clear
    /root/seafile/seafile-server-latest/pro/pro.py search --update
    /root/seafile/seafile-server-latest/seafile.sh start
    /root/seafile/seafile-server-latest/seahub.sh start

    我这里:4核2.6Ghz, 60G的数据,SSD RAID 0 200 GiB,重建索引用了9分钟,估计VPS超卖严重......

    升级后无异常,好像也没多了什么功能,得去翻翻更新日志看修复了什么和增加什么新功能特性:


7.1.4(2020/05/14)
[修复]修复了当用户数大于500时列出LDAP导入的用户的问题

[修复]修复了访问文件夹共享链接的密码和默认路径

生成共享链接时,将预览和下载用作默认权限

支持选择和下载共享链接中的多个文件

在系统管理员中显示共享链接的过期时间

[多租户]支持在组织管理面板中对用户和库进行排序

FUSE扩展现在支持多个存储后端

[修复]修复公共库中的文件下载链接

[修复]修复seaf-backup-cmd.sh

其他UI改进和修复

7.1.3 (2020/04/08)
库管理员可以查看库的所有共享链接

在管理面板中对库和用户进行排序

删除组织中的所有用户和库

[修复]修复了多个存储后端功能中的一些错误

其他用户界面修复
评论 (0条)