-
当前环境。
0 16:42:29 root@jumpserver,172.16.2.9:~ # cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core)
-
下载jumpserver安装包。
# /server是我的数据盘。 0 16:42:32 root@jumpserver,172.16.2.9:~ # mkdir -p /server/packages/ 0 16:42:34 root@jumpserver,172.16.2.9:~ # cd /server/packages/ 0 16:42:45 root@jumpserver,172.16.2.9:/server/packages # wget https://github.com/jumpserver/installer/releases/download/v2.8.2/jumpserver-installer-v2.8.2.tar.gz
-
解压。
0 16:43:18 root@jumpserver,172.16.2.9:/server/packages # mkdir -p /server/app 0 16:43:18 root@jumpserver,172.16.2.9:/server/packages # tar xf jumpserver-installer-v2.8.2.tar.gz -C /server/app/ 0 16:45:16 root@jumpserver,172.16.2.9:/server/app # mv jumpserver-installer-v2.8.2 jumpserver
-
配置jumpserver,使相关数据存储在数据盘。
0 16:45:16 root@jumpserver,172.16.2.9:/server/app # mkdir -p /server/app/jumpserver/data /server/data/docker /server/data/jumpserver /server/backup/jumpserver/db_backup # 修改jumpserver的config生成目录。 0 16:48:45 root@jumpserver,172.16.2.9:/server/app # sed -i 's#/opt/jumpserver#/server/app/jumpserver#g' /server/app/jumpserver/scripts/utils.sh /server/app/jumpserver/scripts/7_upgrade.sh /server/app/jumpserver/scripts/const.sh /server/app/jumpserver/jmsctl.sh /server/app/jumpserver/README.md /server/app/jumpserver/config_init/README.md # 修改jumpserver备份db路径。 0 16:50:11 root@jumpserver,172.16.2.9:/server/app # sed -i 's#/opt/jumpserver#/server/backup/jumpserver#g' /server/app/jumpserver/scripts/5_db_backup.sh /server/app/jumpserver/scripts/6_db_restore.sh # 修改jumpserver容器相关路径。 ## 容器镜像、配置文件、构建信息等路径。 0 16:50:18 root@jumpserver,172.16.2.9:/server/app # sed -i 's#/var/lib/docker#/server/data/docker#g' /server/app/jumpserver/config-example.txt /server/app/jumpserver/scripts/2_install_docker.sh 0 16:50:26 root@jumpserver,172.16.2.9:/server/app # sed -i 's#/opt/docker#/server/data/docker#g' /server/app/jumpserver/scripts/2_install_docker.sh ## 容器的volume映射路径。 0 16:50:32 root@jumpserver,172.16.2.9:/server/app # sed -i 's#/opt/jumpserver#/server/app/jumpserver/data#g' /server/app/jumpserver/scripts/1_config_jumpserver.sh /server/app/jumpserver/config-example.txt # 修改mysql测试连接的命令。 0 16:50:35 root@jumpserver,172.16.2.9:/server/app # vim /server/app/jumpserver/scripts/utils.sh command="CREATE TABLE IF NOT EXISTS test(id INT); DROP TABLE test;q"
-
这里为了公共平台数据库统一管理,我们使用外接数据库。部署步骤,登入创建对应数据库。
0 16:57:43 root@mysql-public,172.16.2.4:~ # mysql -uroot -p -S /server/data/mysql_3309/mysql.sock > create database jumpserver default charset 'utf8' collate 'utf8_bin'; > grant all privileges on jumpserver.* to 'jumpserver'@'172.16.%' identified by 'xxxxxxxxxxxxxxx'; > flush privileges;
-
开始安装jumpserver。
0 17:01:49 root@jumpserver,172.16.2.9:/server/app # cd jumpserver/ 0 17:01:57 root@jumpserver,172.16.2.9:/server/app/jumpserver # ./jmsctl.sh install # 观察下相关目录没啥问题就一路回车到第七步骤。 7. 配置 MySQL 是否使用外部 MySQL? (y/n) (默认为 n): y 请输入 mysql 的主机地址 (默认为 mysql): 172.16.2.4 请输入 mysql 的端口 (默认为 3306): 3309 请输入 mysql 的数据库 (默认为 jumpserver): 请输入 mysql 的用户名 (默认为 root): jumpserver 请输入 mysql 的密码 (无默认值): xxxxxxxxxxxxxx mysql: [Warning] Using a password on the command line interface can be insecure. 完成 # 安装完成后会有一些提示信息,挑有用的记一下就可以了。 --------------------------------------------------提示信息-------------------------------------------------------- >>> 安装完成了 1. 可以使用如下命令启动, 然后访问 ./jmsctl.sh start 2. 其它一些管理命令 ./jmsctl.sh stop ./jmsctl.sh restart ./jmsctl.sh backup ./jmsctl.sh upgrade 更多还有一些命令, 你可以 ./jmsctl.sh --help 来了解 3. Web 访问 http://172.16.2.9:8080 https://172.16.2.9:8443 默认用户: admin 默认密码: admin 4. SSH/SFTP 访问 ssh admin@172.16.2.9 -p2222 sftp -P2222 admin@172.16.2.9 5. 更多信息 我们的官网: https://www.jumpserver.org/ 我们的文档: https://docs.jumpserver.org/ -----------------------------------------------------------------------------------------------------------------
-
启动jumpserver
0 17:08:50 root@jumpserver,172.16.2.9:/server/app/jumpserver # ./jmsctl.sh start ERROR: for luna Container "8893d65b927b" is unhealthy. ERROR: Encountered errors while bringing up the project # 如果遇到如上报错,执行下面的命令, 直到出现 Check service status 之后再启动。 0 17:10:38 root@jumpserver,172.16.2.9:/server/app/jumpserver # docker logs -f jms_core 2021-03-31 17:10:53 Check service status: gunicorn -> running at 1158 2021-03-31 17:10:53 Check service status: flower -> running at 1411 2021-03-31 17:10:53 Check service status: daphne -> running at 1666 0 17:12:21 root@jumpserver,172.16.2.9:/server/app/jumpserver # ./jmsctl.sh start jms_redis is up-to-date jms_core is up-to-date Creating jms_guacamole ... done Creating jms_koko ... done Creating jms_luna ... done Creating jms_celery ... done Creating jms_lina ... done Creating jms_nginx ... done
-
web端打开http://172.16.2.9:8080,默认用户: admin 默认密码: admin。
写作不易,转载请注明出处,谢谢~~