运维八一 运维八一
首页
运维杂记
编程浅尝
周积跬步
专栏
生活
关于
收藏
  • 分类
  • 标签
  • 归档
Source (opens new window)

运维八一

运维,运维!
首页
运维杂记
编程浅尝
周积跬步
专栏
生活
关于
收藏
  • 分类
  • 标签
  • 归档
Source (opens new window)
  • 操作系统

  • 域名解析

  • 公有云

  • CI&CD

  • 数据库

  • 负载均衡&反向代理

  • 存储系统

  • 容器&容器编排

  • 批量管理

  • 邮件系统

  • 监控系统

  • Web服务

  • 虚拟化

  • 防火墙

  • 压测

  • 文件同步

  • 私有云

  • 日志系统

  • 代码仓库&版本管理

  • 安全审计

    • Jumpserver堡垒机安装
      • 1. 准备工作
      • 2. 准备py3和pyhton虚拟环境
      • 3. 安装 Jumpserver
      • 4.安装 SSH Server 和 WebSocket Server: Coco
      • 5. 安装 Web Terminal 前端: Luna
      • 6. 安装 Windows 支持组件
      • 7. 配置 Nginx 整合各组件
      • 其他
    • jumpserver堡垒机使用说明
  • 远程拨号

  • 大数据

  • 统一认证

  • 消息队列

  • Apollo

  • 运维杂记
  • 安全审计
lyndon
2022-09-30
目录

Jumpserver堡垒机安装

# 1. 准备工作

环境:Centos7

设置selinux和防火墙

firewall-cmd --zone=public --add-port=80/tcp --permanent  # nginx 端口
firewall-cmd --zone=public --add-port=2222/tcp --permanent  # 用户SSH登录端口 coco

firewall-cmd --reload  # 重新载入规则

setenforce 0
sed -i "s/enforcing/disabled/g" /etc/selinux/config
1
2
3
4
5
6
7

修改字符集,否则可能报 input/output error的问题,因为日志里打印了中文

localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
echo 'LANG="zh_CN.UTF-8"' > /etc/locale.conf
1
2
3

# 2. 准备py3和pyhton虚拟环境

安装依赖包

$ yum -y install wget gcc epel-release git
1

安装 Python3.6

$ yum -y install python36 python36-devel
1

建立 Python 虚拟环境

因为CentOS 7自带的是Python2,而Yum等工具依赖原来的Python,为了不扰乱原来的环境我们来使用Python虚拟环境

$ cd /opt
$ python3.6 -m venv py3
$ source /opt/py3/bin/activate
1
2
3

看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行

(py3) [root@localhost py3]
1

自动载入 Python 虚拟环境配置

此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv

$ cd /opt
$ git clone https://github.com/kennethreitz/autoenv.git
$ echo 'source /opt/autoenv/activate.sh' >> ~/.bashrc
$ source ~/.bashrc
1
2
3
4

扩展命令:

deactivate 退出py3虚拟环境

# 3. 安装 Jumpserver

下载或Clone项目,项目 git clone时较大,可以选择去Github项目页面直接下载zip包。

$ cd /opt/
$ git clone https://github.com/jumpserver/jumpserver.git
1
2

进入 jumpserver 目录时将自动载入 python 虚拟环境

$ echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env  
$ cd /opt/jumpserver/
1
2

首次进入 jumpserver 文件夹会有提示,按 y 即可

Are you sure you want to allow this? (y/N) y
1

安装依赖 RPM 包

$ cd /opt/jumpserver/requirements
$ yum -y install $(cat rpm_requirements.txt)  # 如果没有任何报错请继续
1
2

安装 Python 库依赖

$ pip install --upgrade pip setuptools
$ pip install -r requirements.txt
1
2

安装Redis, Jumpserver使用Redis做cache和 celery broke

$ yum -y install redis
$ systemctl enable redis
$ systemctl start redis
1
2
3

安装 MySQL(如果使用其他来源的数据库,可以忽略mysql的安装)

本教程使用 Mysql 作为数据库,如果不使用 Mysql 可以跳过相关 Mysql 安装和配置

$ yum -y install mariadb mariadb-devel mariadb-server # centos7下安装的是mariadb
$ systemctl enable mariadb
$ systemctl start mariadb
1
2
3

创建数据库 Jumpserver 并授权

$ DB_PASSWORD=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 24`  # 生成随机数据库密码
$ echo -e "\033[31m 你的数据库密码是 $DB_PASSWORD \033[0m"
$ mysql -uroot -e "create database jumpserver default charset 'utf8'; grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by '$DB_PASSWORD'; flush privileges;"
1
2
3

修改 Jumpserver 配置文件

$ cd /opt/jumpserver
$ cp config_example.yml config.yml
$ SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`  # 生成随机SECRET_KEY
$ BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`  # 生成随机BOOTSTRAP_TOKEN

$ sed -i "s/SECRET_KEY:/SECRET_KEY: $SECRET_KEY/g" /opt/jumpserver/config.yml
$ sed -i "s/BOOTSTRAP_TOKEN:/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/jumpserver/config.yml
$ sed -i "s/# DEBUG: true/DEBUG: false/g" /opt/jumpserver/config.yml
$ sed -i "s/# LOG_LEVEL: DEBUG/LOG_LEVEL: ERROR/g" /opt/jumpserver/config.yml
$ sed -i "s/# SESSION_EXPIRE_AT_BROWSER_CLOSE: false/SESSION_EXPIRE_AT_BROWSER_CLOSE: true/g" /opt/jumpserver/config.yml
$ sed -i "s/DB_PASSWORD: /DB_PASSWORD: $DB_PASSWORD/g" /opt/jumpserver/config.yml

$ echo -e "\033[31m 你的SECRET_KEY是 $SECRET_KEY \033[0m"
$ echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN \033[0m"
1
2
3
4
5
6
7
8
9
10
11
12
13
14

$ vi config.yml # 确认内容有没有错误

# SECURITY WARNING: keep the secret key used in production secret!
# 加密秘钥 生产环境中请修改为随机字符串,请勿外泄
SECRET_KEY:

# SECURITY WARNING: keep the bootstrap token used in production secret!
# 预共享Token coco和guacamole用来注册服务账号,不在使用原来的注册接受机制
BOOTSTRAP_TOKEN:

# Development env open this, when error occur display the full process track, Production disable it
# DEBUG 模式 开启DEBUG后遇到错误时可以看到更多日志
DEBUG: false

# DEBUG, INFO, WARNING, ERROR, CRITICAL can set. See https://docs.djangoproject.com/en/1.10/topics/logging/
# 日志级别
LOG_LEVEL: ERROR
# LOG_DIR:

# Session expiration setting, Default 24 hour, Also set expired on on browser close
# 浏览器Session过期时间,默认24小时, 也可以设置浏览器关闭则过期
# SESSION_COOKIE_AGE: 86400
SESSION_EXPIRE_AT_BROWSER_CLOSE: true

# Database setting, Support sqlite3, mysql, postgres ....
# 数据库设置
# See https://docs.djangoproject.com/en/1.10/ref/settings/#databases

# SQLite setting:
# 使用单文件sqlite数据库
# DB_ENGINE: sqlite3
# DB_NAME:

# MySQL or postgres setting like:
# 使用Mysql作为数据库
DB_ENGINE: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD:
DB_NAME: jumpserver

# When Django start it will bind this host and port
# ./manage.py runserver 127.0.0.1:8080
# 运行时绑定端口
HTTP_BIND_HOST: 0.0.0.0
HTTP_LISTEN_PORT: 8080

# Use Redis as broker for celery and web socket
# Redis配置
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
# REDIS_PASSWORD:
# REDIS_DB_CELERY: 3
# REDIS_DB_CACHE: 4

# Use OpenID authorization
# 使用OpenID 来进行认证设置
# BASE_SITE_URL: http://localhost:8080
# AUTH_OPENID: false  # True or False
# AUTH_OPENID_SERVER_URL: https://openid-auth-server.com/
# AUTH_OPENID_REALM_NAME: realm-name
# AUTH_OPENID_CLIENT_ID: client-id
# AUTH_OPENID_CLIENT_SECRET: client-secret

# OTP settings
# OTP/MFA 配置
# OTP_VALID_WINDOW: 0
# OTP_ISSUER_NAME: Jumpserver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

运行 Jumpserver

$ cd /opt/jumpserver	//新版本更新了运行脚本,使用方式./jms start|stop|status|restart all  后台运行请添加-d参数
$ ./jms start all -d
1
2

运行不报错, 请继续往下操作。

# 4.安装 SSH Server 和 WebSocket Server: Coco

下载或 Clone 项目

$ cd /opt
$ source /opt/py3/bin/activate
$ git clone https://github.com/jumpserver/coco.git
1
2
3

进入 coco 目录时将自动载入 python 虚拟环境

$ cd /opt/coco/
$ echo "source /opt/py3/bin/activate" > /opt/coco/.env
1
2

首次进入 coco 文件夹会有提示,按 y 即可

Are you sure you want to allow this? (y/N) y
1

安装依赖

$ cd /opt/coco/requirements
$ yum -y  install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt
1
2
3

修改配置文件并运行

$ cd /opt/coco
$ mkdir keys logs
$ cp config_example.yml config.yml

$ sed -i "s/BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/coco/config.yml
$ sed -i "s/# LOG_LEVEL: INFO/LOG_LEVEL: ERROR/g" /opt/coco/config.yml
1
2
3
4
5
6

$ vi config.yml

# 项目名称, 会用来向Jumpserver注册, 识别而已, 不能重复
# NAME: {{ Hostname }}

# Jumpserver项目的url, api请求注册会使用
CORE_HOST: http://127.0.0.1:8080

# Bootstrap Token, 预共享秘钥, 用来注册coco使用的service account和terminal
# 请和jumpserver 配置文件中保持一致,注册完成后可以删除
BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>

# 启动时绑定的ip, 默认 0.0.0.0
# BIND_HOST: 0.0.0.0

# 监听的SSH端口号, 默认2222
# SSHD_PORT: 2222

# 监听的HTTP/WS端口号,默认5000
# HTTPD_PORT: 5000

# 项目使用的ACCESS KEY, 默认会注册,并保存到 ACCESS_KEY_STORE中,
# 如果有需求, 可以写到配置文件中, 格式 access_key_id:access_key_secret
# ACCESS_KEY: null

# ACCESS KEY 保存的地址, 默认注册后会保存到该文件中
# ACCESS_KEY_STORE: data/keys/.access_key

# 加密密钥
# SECRET_KEY: null

# 设置日志级别 [DEBUG, INFO, WARN, ERROR, FATAL, CRITICAL]
LOG_LEVEL: ERROR

# 日志存放的目录
# LOG_DIR: logs

# SSH白名单
# ALLOW_SSH_USER: all

# SSH黑名单, 如果用户同时在白名单和黑名单,黑名单优先生效
# BLOCK_SSH_USER:
#   -

# 和Jumpserver 保持心跳时间间隔
# HEARTBEAT_INTERVAL: 5

# Admin的名字,出问题会提示给用户
# ADMINS: ''

# SSH连接超时时间 (default 15 seconds)
# SSH_TIMEOUT: 15

# 语言 [en,zh]
# LANGUAGE_CODE: zh

# SFTP的根目录, 可选 /tmp, Home其他自定义目录
# SFTP_ROOT: /tmp

# SFTP是否显示隐藏文件
# SFTP_SHOW_HIDDEN_FILE: false
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

启动coco:

$ ./cocod start -d	//新版本更新了运行脚本,后台运行请添加 -d 参数,使用方式 ./cocod start|stop|status|restart -d
1

# 5. 安装 Web Terminal 前端: Luna

Luna 已改为纯前端,需要 Nginx 来运行访问,访问(https://github.com/jumpserver/luna/releases)下载对应版本的 release 包,直接解压,不需要编译

解压 Luna

$ cd /opt
$ wget https://github.com/jumpserver/luna/releases/download/1.4.8/luna.tar.gz
$ tar xf luna.tar.gz
$ chown -R root:root luna
1
2
3
4

# 6. 安装 Windows 支持组件

Guacamole 需要 Tomcat 来运行(如果不需要管理 windows 资产,可以直接跳过这一步)。

安装依赖

$ mkdir /usr/local/lib/freerdp/
$ ln -s /usr/local/lib/freerdp /usr/lib64/freerdp
$ rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
$ yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm

$ yum install -y java-1.8.0-openjdk libtool
$ yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel
$ yum install -y ffmpeg-devel freerdp-devel freerdp-plugins pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel ghostscript
1
2
3
4
5
6
7
8
9

编译安装 guacamole 服务

$ cd /opt
$ git clone https://github.com/jumpserver/docker-guacamole.git
$ cd /opt/docker-guacamole/
$ tar -xf guacamole-server-0.9.14.tar.gz
$ cd guacamole-server-0.9.14
$ autoreconf -fi
$ ./configure --with-init-dir=/etc/init.d
$ make && make install
$ cd ..
$ rm -rf guacamole-server-0.9.14
$ ldconfig
1
2
3
4
5
6
7
8
9
10
11

配置 Tomcat

$ mkdir -p /config/guacamole /config/guacamole/lib /config/guacamole/extensions  # 创建 guacamole 目录
$ ln -sf /opt/docker-guacamole/guacamole-auth-jumpserver-0.9.14.jar /config/guacamole/extensions/guacamole-auth-jumpserver-0.9.14.jar
$ ln -sf /opt/docker-guacamole/root/app/guacamole/guacamole.properties /config/guacamole/guacamole.properties  # guacamole 配置文件

$ cd /config
$ wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.38/bin/apache-tomcat-8.5.38.tar.gz
$ tar xf apache-tomcat-8.5.38.tar.gz
$ rm -rf apache-tomcat-8.5.38.tar.gz
$ mv apache-tomcat-8.5.38 tomcat8
$ rm -rf /config/tomcat8/webapps/*
$ ln -sf /opt/docker-guacamole/guacamole-0.9.14.war /config/tomcat8/webapps/ROOT.war  # guacamole client
$ sed -i 's/Connector port="8080"/Connector port="8081"/g' /config/tomcat8/conf/server.xml  # 修改默认端口为 8081
$ sed -i 's/FINE/WARNING/g' /config/tomcat8/conf/logging.properties  # 修改 log 等级为 WARNING

$ cd /config
$ wget https://github.com/ibuler/ssh-forward/releases/download/v0.0.5/linux-amd64.tar.gz
$ tar xf linux-amd64.tar.gz -C /bin/
$ chmod +x /bin/ssh-forward
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

配置环境变量

$ export JUMPSERVER_SERVER=http://127.0.0.1:8080  # http://127.0.0.1:8080 指 jumpserver 访问地址
$ echo "export JUMPSERVER_SERVER=http://127.0.0.1:8080" >> ~/.bashrc
1
2
#BOOTSTRAP_TOKEN 为 Jumpserver/config.yml 里面的 BOOTSTRAP_TOKEN
$ export BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN
$ echo "export BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc
$ export JUMPSERVER_KEY_DIR=/config/guacamole/keys
$ echo "export JUMPSERVER_KEY_DIR=/config/guacamole/keys" >> ~/.bashrc
$ export GUACAMOLE_HOME=/config/guacamole
$ echo "export GUACAMOLE_HOME=/config/guacamole" >> ~/.bashrc
1
2
3
4
5
6
7

启动 Guacamole

$ /etc/init.d/guacd start
$ sh /config/tomcat8/bin/startup.sh
1
2

# 7. 配置 Nginx 整合各组件

安装 Nginx

$ vi /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

$ yum install -y nginx
$ rm -rf /etc/nginx/conf.d/default.conf
$ systemctl enable nginx
1
2
3
4
5
6
7
8
9
10

准备配置文件 修改 /etc/nginx/conf.d/jumpserver.conf

$ vi /etc/nginx/conf.d/jumpserver.conf
server {
    listen 80;  # 代理端口,以后将通过此端口进行访问,不再通过8080端口
    # server_name demo.jumpserver.org;  # 修改成你的域名或者注释掉

    client_max_body_size 100m;  # 录像及文件上传大小限制

    location /luna/ {
        try_files $uri / /index.html;
        alias /opt/luna/;  # luna 路径,如果修改安装目录,此处需要修改
    }

    location /media/ {
        add_header Content-Encoding gzip;
        root /opt/jumpserver/data/;  # 录像位置,如果修改安装目录,此处需要修改
    }

    location /static/ {
        root /opt/jumpserver/data/;  # 静态资源,如果修改安装目录,此处需要修改
    }

    location /socket.io/ {
        proxy_pass       http://localhost:5000/socket.io/;  # 如果coco安装在别的服务器,请填写它的ip
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
    }

    location /coco/ {
        proxy_pass       http://localhost:5000/coco/;  # 如果coco安装在别的服务器,请填写它的ip
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
    }

    location /guacamole/ {
        proxy_pass       http://localhost:8081/;  # 如果guacamole安装在别的服务器,请填写它的ip
        proxy_buffering off;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        access_log off;
    }

    location / {
        proxy_pass http://localhost:8080;  # 如果jumpserver安装在别的服务器,请填写它的ip
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

运行 Nginx

nginx -t   # 确保配置没有问题, 有问题请先解决
1

CentOS 7启动nginx

$ systemctl start nginx
$ systemctl enable nginx
1
2

开始使用 Jumpserver

  • 1.检查应用是否已经正常运行

服务全部启动后,访问 http://IP,访问nginx代理的端口,不要再通过8080端口访问

默认账号: admin 密码: admin

到Jumpserver 会话管理-终端管理 检查 Coco Guacamole 等应用的注册。

  • 2.测试连接

如果登录客户端是 macOS 或 Linux ,登录语法如下:

$ ssh -p2222 admin@192.168.244.144

$ sftp -P2222 admin@192.168.244.144

密码: admin

如果登录客户端是 Windows ,Xshell Terminal 登录语法如下

$ ssh admin@192.168.244.144 2222

$ sftp admin@192.168.244.144 2222

密码: admin

如果能登陆代表部署成功

sftp默认上传的位置在资产的 /tmp 目录下

windows拖拽上传的位置在资产的 Guacamole RDP上的 G 目录下

# 其他

jumpserver 0.3.2版本部署

环境:centos7.4

安装依赖包

yum -y install git python-pip mysql-devel gcc automake autoconf python-devel vim sshpass lrzsz readline-devel zlib-devel openssl-devel
1

安装pip

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
1
2

安装mariadb数据库

yum -y install mariadb mariadb-server
systemctl enable mariadb
systemctl start mariadb
1
2
3

配置MariaDB数据库

mysql_secure_installation
1
首先是设置密码,会提示先输入密码
Enter current password for root (enter for none):<–初次运行直接回车

设置密码
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码

其他配置
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车
1
2
3
4
5
6
7
8
9
10
11
12
13

初始化MariaDB完成,测试登录

mysql -uroot -p123456
1

创建jumpserver数据库

MariaDB [(none)]> create database jumpserver;
MariaDB [(none)]> grant all on jumpserver.* to 'jumpserver'@localhost identified by '1q2w#3e4r';
MariaDB [(none)]> flush privileges;
1
2
3

上传jumpserver-master-0.3.2.zip安装包

unzip jumpserver-master-0.3.2.zip
cd /opt/jumpserver-master/install
python install.py
1
2
3

输入相关信息、回车

遇到报错如下:
报错1:
Found existing installation: pyinotify 0.9.4
Cannot uninstall 'pyinotify'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
安装JumpServer 依赖的python库失败!

原因:旧版本依赖多,不能清晰的删除,此时应该忽略旧版本升级
解决方法:
pip install pyinotify --ignore-installed pyinotify

报错2:
_mysql_exceptions.Warning: Incorrect string value: '\xE6\x9C\xBA\xE6\x88\xBF' for column 'name' at row 1

原因:字符集不兼容,Django默认使用UTF-8,而mysqld那边配置是默认使用了latin1 -default collation
解决方法:修改/etc/my.cnf配置文件,然后重启mysqld或mariadb,删除重建jumpserver库。
    旧版mysql(5.5以前版本):
        在[client]下配置:
            default-character-set=utf8
        在[mysqld]下配置:
            default-character-set=utf8
            init_connect='SET NAMES utf8'
    新版mysql、mariadb等:
        在[mysqld]下配置:
            character_set_server=utf8 

启动JMS

cd /opt/jumpserver-master
./service.sh start
1
2

账号:admin

密码:5Lov@wife

上次更新: 2022/09/30, 15:27:27
搭建SVN服务及实现备份
jumpserver堡垒机使用说明

← 搭建SVN服务及实现备份 jumpserver堡垒机使用说明→

最近更新
01
ctr和crictl显示镜像不一致
03-13
02
alpine镜像集成常用数据库客户端
03-13
03
create-cluster
02-26
更多文章>
Theme by Vdoing | Copyright © 2015-2024 op81.com
苏ICP备18041258号-2
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式