使用Podman部署Jumpserver
准备环境
安装MySQL 8
sudo su - rootwget http://repo.mysql.com/mysql-apt-config_0.8.26-1_all.debapt install ./mysql-apt-config_0.8.26-1_all.debapt updateapt install mysql-serversystemctl start mysqlsystemctl enable mysqlsystemctl restart mysql
具体安装教程可参考:MySQL 8安装教程
数据库配置
create database jumpserver default charset \'utf8\';set global validate_password_policy=LOW;ALTER USER \'jumpserver\'@\'%\' IDENTIFIED WITH \'mysql_native_password\' BY \'xxxxxxx\';grant all on jumpserver.* to \'jumpserver\'@\'%\';flush privileges;
安装Redis
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpgecho "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.listsudo apt-get updatesudo apt-get install redis
编辑Redis配置文件 /etc/redis/redis.conf
:
port 9309requirepass xxxxbind * -::*protected-mode no
启动Redis服务:
systemctl enable --now redis-server
安装Podman
sudo apt install -y software-properties-commonsudo apt install -y podmanpodman --version
创建映射文件夹
mkdir -p /opt/jumpserver/koko/datamkdir -p /opt/jumpserver/lion/datamkdir -p /opt/jumpserver/core/datamkdir -p /opt/py3/bin/activate
初始化数据库
podman run --name jms_all --rm \\ -v /opt/jumpserver/core/data:/opt/jumpserver/data \\ -v /opt/jumpserver/koko/data:/opt/koko/data \\ -v /opt/jumpserver/lion/data:/opt/lion/data \\ -e SECRET_KEY=50位随机字符,不包含特殊字符 \\ -e BOOTSTRAP_TOKEN=24位随机字符,不包含特殊字符 \\ -e LOG_LEVEL=ERROR \\ -e DB_HOST=xxx \\ -e DB_PORT=9306 \\ -e DB_USER=jumpserver \\ -e DB_PASSWORD=xxxxxx \\ -e DB_NAME=jumpserver \\ -e REDIS_HOST=xxx \\ -e REDIS_PORT=9309 \\ jumpserver/jms_all:v3.4.3 init_db
运行项目
podman run --name jms_all -d \\ -v /opt/jumpserver/core/data:/opt/jumpserver/data \\ -v /opt/jumpserver/koko/data:/opt/koko/data \\ -v /opt/jumpserver/lion/data:/opt/lion/data \\ -p 9866:80 \\ -p 2222:2222 \\ -p 30000-30100:30000-30100 \\ -e SECRET_KEY=xxx \\ -e BOOTSTRAP_TOKEN=xxx \\ -e LOG_LEVEL=ERROR \\ -e DB_HOST=xxx \\ -e DB_PORT=9306 \\ -e DB_USER=jumpserver \\ -e DB_PASSWORD=xxx \\ -e DB_NAME=jumpserver \\ -e REDIS_HOST=xxx \\ -e REDIS_PORT=9309 \\ --privileged=true \\ jumpserver/jms_all:v3.4.3
以上是部署Jumpserver的基本步骤,确保根据实际情况修改配置信息。
有问题及时联系站长,QQ:1240555208
更多优质资源在QQ群里,可以进群领取:467392290~
© 版权声明
THE END
暂无评论内容