安装过程中常见的问题

    • git clone 提示 ssl 错误
    • pip install 提示 ssl 错误
    1. # 参考第一条解决
    • pip install 提示 download 错误
    1. # 一般是由于网络不好, 导致下载文件失败, 重新执行命令即可
    2. # 如果多次重试均无效, 请更换网络环境
    • pip install 提示 Could not find a version that satisfies the requirement xxxxxx==x.x.xx(版本)
    1. # 一般是由于镜像源未同步, -i 指定官方源即可, 如:
    2. $ pip install -r requirement.txt -i https://pypi.org/simple
    3. $ pip install xxxxx==x.x.xx -i https://pypi.org/simple
    • pip install 提示 install for mysqlclient … error /usr/bin/ld: 找不到 -lmariadb
    1. # 如果是 Mariadb 大于 10 版本
    2. $ yum install MariaDB-shared
    • sh make_migrations.sh 时报错 from config import config as CONFIG File "/opt/jumpserver/config.yml", line 38
    1. # 这是由于 config.yml 里面的内容格式不对, 请参考安装文档的说明, 把提示的内容与上一行对齐即可
    • sh make_migrations.sh 时报错 Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
    1. # 一般是由于 py3 环境未载入
    2. $ source /opt/py3/bin/activate
    3.  
    4. # 看到下面的提示符代表成功, 以后运行 Jumpserver 都要先运行以上 source 命令, 以下所有命令均在该虚拟环境中运行
    5. (py3) [root@localhost py3]
    6.  
    7. # 如果已经在 py3 虚拟环境下, 任然报 Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
    8. $ cd /opt/jumpserver/requirements
    9. $ pip install -r requirements.txt
    10. # 然后重新执行 sh make_migrations.sh
    • sh make_migrations.sh 报错 CommandError: Conflicting migrations detected; multiple … django_celery_beat …
    • 执行 ./jms start 后一直卡在 beat: Waking up in 1.00 minute.
    1. # 如果没有error提示进程无法启动, 那么这是正常现象
    2. # 如果不想在前台启动, 可以使用 ./jms start -d 在后台启动
    • 执行 ./jms start 后提示 xxx is stopped
    1. # Error: xxx start error
    2. # xxx is stopped
    3. $ ./jms restart xxx # 如 ./jms restart gunicorn
    • 执行 ./jms start 后提示 WARNINGS: ?: (mysql.W002) MySQL Strict Mode is not set for database connection 'default' …
    1. # 这是严格模式的警告, 可以参考后面的url解决, 或者忽略
    • 启动 Jumpserver 或者 coco 报错 Error: expected '', but found ''
    1. # 这是因为你的 config.yml 文件格式有误
    2. # 常见的错误就是字段为空或者: 后面有一个空格
    3. # SECRET_KEY: xxxxx # 不要忽略: 后面的空格
    • 启动 jumpserver 后, 访问 8080 端口页面显示不正常
    1. # 这是因为你在 config.yml 里面设置了 DEBUG: false
    2. # 跟着教程继续操作, 后面搭建 nginx 代理即可正常访问
    • 执行 ./cocod start 后提示 No module named 'jms'
    1. # 一般是由于 py3 环境未载入
    2.  
    3. # 看到下面的提示符代表成功, 以后运行 Jumpserver 都要先运行以上 source 命令, 以下所有命令均在该虚拟环境中运行
    4. (py3) [root@localhost py3]
    5.  
    6. # 如果已经在 py3 虚拟环境下
    7. $ cd /opt/coco/
    8. $ pip install -r requirements/requirements.txt
    9. # 然后重新执行 ./cocod start 即可
    • 执行 ./cocod start 后提示 Failed register terminal xxxx exist already
    • 执行 ./cocod start 后提示 Failed register terminal unknow: xxxx
    1. # 这是因为当前系统的 hostname 有 coco 不支持的字符, 需要手动指定 coco 的 NAME
    2. $ cd /opt/coco/
    3. $ vi config.yml
    4.  
    5. # 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
    6. # NAME: {{ Hostname }}
    7. NAME: localhost
    8.  
    9. # 保存后重新执行 ./cocod start 即可
    • 运行 ./cocod start 后提示 "detail":"身份认证信息未提供。" Failed register terminal
    1. # 保证 coco 的 BOOTSTRAP_TOKEN 与 jumpserver/config.yml 里面的内容不一致
    2. $ cat /opt/jumpserver/config.yml | grep BOOTSTRAP_TOKEN
    3. $ cat /opt/coco/config.yml | grep BOOTSTRAP_TOKEN
    4.  
    5. # 修改成一致保存后 重新执行 ./cocod start 即可
    • 运行 ./cocod start 后提示 Connect endpoint http://xxxx:8080 error: HTTPConnectionPool(host='xxxx', port=8080)
    1. # 这是因为 coco 无法连接到 jumpserver 报的错误, 确定 http://xxxx:8080 设置正确(配置文件 coco/config.yml)
    2. # 如果 jumpserver 的IP和端口不对, 请手动修改 config.yml 的 CORE_HOST
    • 运行 ./cocod start 后提示 Unexpected error occur: 'AppService' object has no attribute 'get_system_user_cmd_filter_rules'
    1. # 这是因为你的 pip 依赖包未正确安装, 参考本文档第 4 条
    • 通过 nginx 代理的端口访问 jumpserver 页面显示不正常
    1. # 这是因为你没有按照教程进行安装, 修改了安装目录, 需要在 nginx 的配置文件里面修改资源路径
    2. $ vi /etc/nginx/conf.d/jumpserver.conf
    3.  
    4. ...
    5.  
    6. server {
    7. listen 80; # 代理端口, 以后将通过此端口进行访问, 不再通过8080端口
    8.  
    9. proxy_set_header X-Real-IP $remote_addr;
    10. proxy_set_header Host $host;
    11. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    12.  
    13. location /luna/ {
    14. try_files $uri / /index.html;
    15. }
    16.  
    17. location /media/ {
    18. add_header Content-Encoding gzip;
    19. root /opt/jumpserver/data/; # 录像位置, 如果修改安装目录, 此处需要修改
    20. }
    21.  
    22. location /static/ {
    23. root /opt/jumpserver/data/; # 静态资源, 如果修改安装目录, 此处需要修改
    24. }
    25.  
    26. location /socket.io/ {
    27. proxy_pass http://localhost:5000/socket.io/; # 如果coco安装在别的服务器, 请填写它的ip
    28. proxy_buffering off;
    29. proxy_http_version 1.1;
    30. proxy_set_header Upgrade $http_upgrade;
    31. proxy_set_header Connection "upgrade";
    32. }
    33.  
    34. location /coco/ {
    35. proxy_pass http://localhost:5000/coco/; # 如果coco安装在别的服务器, 请填写它的ip
    36. proxy_set_header X-Real-IP $remote_addr;
    37. proxy_set_header Host $host;
    38. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    39. access_log off;
    40. }
    41.  
    42. location /guacamole/ {
    43. proxy_pass http://localhost:8081/; # 如果guacamole安装在别的服务器, 请填写它的ip
    44. proxy_buffering off;
    45. proxy_http_version 1.1;
    46. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    47. proxy_set_header Upgrade $http_upgrade;
    48. proxy_set_header Connection $http_connection;
    49. access_log off;
    50. client_max_body_size 100m; # Windows 文件上传大小限制
    51. }
    52.  
    53. location / {
    54. proxy_pass http://localhost:8080; # 如果jumpserver安装在别的服务器, 请填写它的ip
    55. }
    56. }
    57.  
    58. ...
    • 访问 luna 页面提示 Luna是单独部署的一个程序, 你需要部署luna, coco, 配置nginx做url分发…