升级文档

升级及迁移请保持 SECRET_KEY 与旧版本一致,否则会导致数据库加密数据无法解密

环境说明

  • 从 v2.5 开始,要求 MySQL >= 5.7
  • 从 v2.6 开始,要求 Redis >= 6
  • 推荐使用外置 数据库 和 Redis,方便日后扩展升级
DBVersionCacheVersion
MySQL>= 5.7Redis>= 6.0
MariaDB>= 10.2

升级说明

要求说明

  • jumpserver 版本 >= v2.6.0
  • jumpserver 版本 < v2.6.0 的请先参考上面的迁移文档迁移到最新版本

升级步骤

操作步骤

  1. cd /opt
  2. yum -y install wget
  3. wget https://github.com/jumpserver/installer/releases/download/v2.13.0/jumpserver-installer-v2.13.0.tar.gz
  4. tar -xf jumpserver-installer-v2.13.0.tar.gz
  5. cd jumpserver-installer-v2.13.0
  1. ./jmsctl.sh upgrade
  1. 是否将版本更新至 v2.13.0 ? (y/n) (默认为 n): y
  2. 1. 检查配置变更
  3. 配置文件位置: /opt/jumpserver/config
  4. /opt/jumpserver/config/config.txt [ ]
  5. /opt/jumpserver/config/core/config.yml [ ]
  6. /opt/jumpserver/config/koko/config.yml [ ]
  7. /opt/jumpserver/config/mariadb/mariadb.cnf [ ]
  8. /opt/jumpserver/config/mysql/my.cnf [ ]
  9. /opt/jumpserver/config/nginx/lb_http_server.conf [ ]
  10. /opt/jumpserver/config/nginx/lb_rdp_server.conf [ ]
  11. /opt/jumpserver/config/nginx/lb_ssh_server.conf [ ]
  12. /opt/jumpserver/config/redis/redis.conf [ ]
  13. /opt/jumpserver/config/nginx/cert/server.crt [ ]
  14. /opt/jumpserver/config/nginx/cert/server.key [ ]
  15. 完成
  16. 2. 检查程序文件变更
  17. 完成
  18. 3. 升级镜像文件
  19. Docker: Pulling from jumpserver/core:v2.13.0 [ OK ]
  20. Docker: Pulling from jumpserver/koko:v2.13.0 [ OK ]
  21. Docker: Pulling from jumpserver/web:v2.13.0 [ OK ]
  22. Docker: Pulling from jumpserver/redis:6-alpine [ OK ]
  23. Docker: Pulling from jumpserver/mysql:5 [ OK ]
  24. Docker: Pulling from jumpserver/lion:v2.13.0 [ OK ]
  25. 完成
  26. 4. 备份数据库
  27. 正在备份...
  28. mysqldump: [Warning] Using a password on the command line interface can be insecure.
  29. [SUCCESS] 备份成功! 备份文件已存放至: /opt/jumpserver/db_backup/jumpserver-2021-03-19_08:32:39.sql
  30. 5. 进行数据库变更
  31. 表结构变更可能需要一段时间, 请耐心等待
  32. 检测到 JumpServer 正在运行, 是否需要关闭并继续升级? (y/n) (默认为 n): y
  33. Stopping jms_core ... done
  34. Stopping jms_koko ... done
  35. Stopping jms_lion ... done
  36. Stopping jms_web ... done
  37. Stopping jms_celery ... done
  38. Removing jms_core ... done
  39. Removing jms_koko ... done
  40. Removing jms_lion ... done
  41. Removing jms_web ... done
  42. Removing jms_celery ... done
  43. 2021-03-19 08:32:44 Collect static files
  44. 2021-03-19 08:32:44 Collect static files done
  45. 2021-03-19 08:32:44 Check database structure change ...
  46. 2021-03-19 08:32:44 Migrate model change to database ...
  47. 473 static files copied to '/opt/jumpserver/data/static'.
  48. Operations to perform:
  49. Apply all migrations: acls, admin, applications, assets, audits, auth, authentication, captcha, common, contenttypes, django_cas_ng, django_celery_beat, jms_oidc_rp, ops, orgs, perms, sessions, settings, terminal, tickets, users
  50. Running migrations:
  51. No migrations to apply.
  52. # 有时候是下方红色的提示,忽略即可,不需要做处理。
  53. Your models have changes that are not yet reflected in a migration, and so won't be applied.
  54. Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
  55. 完成
  56. 6. 清理镜像
  57. 是否需要清理旧版本镜像文件? (y/n) (默认为 n): y
  58. Untagged: jumpserver/core:v2.11.3
  59. Untagged: jumpserver/luna:v2.11.3
  60. Untagged: jumpserver/lina:v2.11.3
  61. Untagged: jumpserver/koko:v2.11.3
  62. Untagged: jumpserver/lion:v2.11.3
  63. 完成
  64. 7. 升级成功, 可以重新启动程序了
  65. cd /opt/jumpserver-installer-v2.13.0
  66. ./jmsctl.sh start
  1. ./jmsctl.sh start