部署 JumpServer 01 节点

    • JumpServer_Node_01 服务器信息如下:

    2.1 安装 NFS 依赖包

    1. showmount -e 192.168.100.11
    1. # 将 Core 持久化目录挂载到 NFS, 默认 /opt/jumpserver/core/data, 请根据实际情况修改
    2. # JumpServer 持久化目录定义相关参数为 VOLUME_DIR, 在安装 JumpServer 过程中会提示
    3. mkdir /opt/jumpserver/core/data
    4. mount -t nfs 192.168.100.11:/data /opt/jumpserver/core/data

    2.3 配置 NFS 共享目录开机自动挂载

    1. cd /opt
    2. yum -y install wget
    3. wget https://github.com/jumpserver/installer/releases/download/v3.0.1/jumpserver-installer-v3.0.1.tar.gz
    4. tar -xf jumpserver-installer-v3.0.1.tar.gz
    5. cd jumpserver-installer-v3.0.1

    3.2 修改临时配置文件

    1. vi config-example.txt
    1. ./jmsctl.sh install
    1. ██╗██╗ ██╗███╗ ███╗██████╗ ███████╗███████╗██████╗ ██╗ ██╗███████╗██████╗
    2. ██║██║ ██║████╗ ████║██╔══██╗██╔════╝██╔════╝██╔══██╗██║ ██║██╔════╝██╔══██╗
    3. ██║██║ ██║██╔████╔██║██████╔╝███████╗█████╗ ██████╔╝██║ ██║█████╗ ██████╔╝
    4. ██ ██║██║ ██║██║╚██╔╝██║██╔═══╝ ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██╔══╝ ██╔══██╗
    5. ╚█████╔╝╚██████╔╝██║ ╚═╝ ██║██║ ███████║███████╗██║ ██║ ╚████╔╝ ███████╗██║ ██║
    6. ╚════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝
    7. Version: v3.0.1
    8. 1. 检查配置文件
    9. 配置文件位置: /opt/jumpserver/config
    10. /opt/jumpserver/config/config.txt [ ]
    11. /opt/jumpserver/config/nginx/lb_rdp_server.conf [ ]
    12. /opt/jumpserver/config/nginx/lb_ssh_server.conf [ ]
    13. /opt/jumpserver/config/nginx/cert/server.crt [ ]
    14. /opt/jumpserver/config/nginx/cert/server.key [ ]
    15. 完成
    16. 2. 备份配置文件
    17. 备份至 /opt/jumpserver/config/backup/config.txt.2021-07-15_22-26-13
    18. 完成
    19. >>> 安装配置 Docker
    20. 1. 安装 Docker
    21. 开始下载 Docker 程序 ...
    22. 开始下载 Docker Compose 程序 ...
    23. 完成
    24. 2. 配置 Docker
    25. 完成
    26. 3. 启动 Docker
    27. Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
    28. 完成
    29. >>> 加载 Docker 镜像
    30. Docker: Pulling from jumpserver/koko:v3.0.1 [ OK ]
    31. Docker: Pulling from jumpserver/web:v3.0.1 [ OK ]
    32. Docker: Pulling from jumpserver/redis:6-alpine [ OK ]
    33. Docker: Pulling from jumpserver/mysql:5 [ OK ]
    34. Docker: Pulling from jumpserver/lion:v3.0.1 [ OK ]
    35. >>> 安装配置 JumpServer
    36. 1. 配置网络
    37. 是否需要支持 IPv6? (y/n) (默认为 n): n
    38. 完成
    39. 2. 配置加密密钥
    40. SECRETE_KEY: YTE2YTVkMTMtMGE3MS00YzI5LWFlOWEtMTc2OWJlMmIyMDE2
    41. BOOTSTRAP_TOKEN: YTE2YTVkMTMtMGE3
    42. 完成
    43. 3. 配置持久化目录
    44. 是否需要自定义持久化存储, 默认将使用目录 /opt/jumpserver? (y/n) (默认为 n): n
    45. 完成
    46. 4. 配置 MySQL
    47. 是否使用外部 MySQL? (y/n) (默认为 n): y
    48. 请输入 MySQL 的主机地址 (无默认值): 192.168.100.11
    49. 请输入 MySQL 的端口 (默认为3306): 3306
    50. 请输入 MySQL 的数据库(事先做好授权) (默认为jumpserver): jumpserver
    51. 请输入 MySQL 的用户名 (无默认值): jumpserver
    52. 请输入 MySQL 的密码 (无默认值): KXOeyNgDeTdpeu9q
    53. 完成
    54. 5. 配置 Redis
    55. 是否使用外部 Redis? (y/n) (默认为 n): y
    56. 请输入 Redis 的主机地址 (无默认值): 192.168.100.11
    57. 请输入 Redis 的端口 (默认为6379): 6379
    58. 请输入 Redis 的密码 (无默认值): KXOeyNgDeTdpeu9q
    59. 完成
    60. 6. 配置对外端口
    61. 是否需要配置 JumpServer 对外访问端口? (y/n) (默认为 n): n
    62. 完成
    63. 7. 初始化数据库
    64. Creating network "jms_net" with driver "bridge"
    65. Creating jms_redis ... done
    66. 2021-07-15 22:39:52 Collect static files
    67. 2021-07-15 22:39:52 Collect static files done
    68. 2021-07-15 22:39:52 Check database structure change ...
    69. 2021-07-15 22:39:52 Migrate model change to database ...
    70. 475 static files copied to '/opt/jumpserver/data/static'.
    71. Operations to perform:
    72. Running migrations:
    73. Applying contenttypes.0001_initial... OK
    74. Applying contenttypes.0002_remove_content_type_name... OK
    75. Applying auth.0001_initial... OK
    76. Applying auth.0002_alter_permission_name_max_length... OK
    77. Applying auth.0003_alter_user_email_max_length... OK
    78. Applying auth.0004_alter_user_username_opts... OK
    79. Applying auth.0005_alter_user_last_login_null... OK
    80. Applying auth.0006_require_contenttypes_0002... OK
    81. Applying auth.0007_alter_validators_add_error_messages... OK
    82. Applying auth.0008_alter_user_username_max_length... OK
    83. ...
    84. Applying sessions.0001_initial... OK
    85. Applying terminal.0032_auto_20210302_1853... OK
    86. Applying terminal.0033_auto_20210324_1008... OK
    87. Applying terminal.0034_auto_20210406_1434... OK
    88. Applying terminal.0035_auto_20210517_1448... OK
    89. Applying terminal.0036_auto_20210604_1124... OK
    90. Applying terminal.0037_auto_20210623_1748... OK
    91. Applying tickets.0008_auto_20210311_1113... OK
    92. Applying tickets.0009_auto_20210426_1720... OK
    93. >>> 安装完成了
    94. 1. 可以使用如下命令启动, 然后访问
    95. cd /root/jumpserver-installer-v3.0.1
    96. ./jmsctl.sh start
    97. 2. 其它一些管理命令
    98. ./jmsctl.sh stop
    99. ./jmsctl.sh restart
    100. ./jmsctl.sh backup
    101. ./jmsctl.sh upgrade
    102. 更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解
    103. 3. Web 访问
    104. http://192.168.100.212:80
    105. 默认用户: admin 默认密码: admin
    106. 4. SSH/SFTP 访问
    107. ssh -p2222 admin@192.168.100.212
    108. sftp -P2222 admin@192.168.100.212
    109. 5. 更多信息
    110. 我们的官网: https://www.jumpserver.org/
    111. 我们的文档: https://docs.jumpserver.org/

    3.4 启动 JumpServer 服务

    1. Creating network "jms_net" with driver "bridge"
    2. Creating jms_core ... done
    3. Creating jms_celery ... done
    4. Creating jms_lion ... done
    5. Creating jms_koko ... done
    6. Creating jms_web ... done