docker-部署jumpserver

jumpserver

https://jumpserver.org/

Docker 部署 jumpserver 堡垒机

容器部署 jumpserver-1.4.10 服务端 #最好单一个节点

容器运行Mysql 5.6.46 #myql , redis 一个节点

容器运行 redis 4.0.14

 

 

 

 

mysql,redis 节点 (192.168.154.130)

docker pull mysql:5.6.46
docker pull redis:4.0.14


宿主机上操作
mkdir -p /data/mysql     #创建一个存放数据目录,关联容器中的   /var/lib/mysql
mkdir -p /etc/mysql/conf.d/    
vim/etc/mysql/conf.d/mysql.cnf #插入下面两行代码
[mysql]
character-set-server=utf8


mkdir -p /etc/mysql/mysql.conf.d
vim /etc/mysql/mysql.conf.d/mysqld.cnf #插入下面四行代码
[mysqld]
pid-file       = /var/run/mysqld/mysqld.pid
socket         = /var/run/mysqld/mysqld.sock
datadir         = /var/lib/mysql
symbolic-links=0
character-set-server=utf8






启动mysql 容器  
docker run -d -p 3306:3306 -v /data/mysql:/var/lib/mysql -v /etc/mysql/conf.d/mysql.cnf:/etc/mysql/conf.d/mysql.cnf -v /etc/mysql/mysql.conf.d/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -e MYSQL_ROOT_PASSWORD=angel4239360 mysql:5.6.46

登录数据库,创库,授权
mysql -uroot -pangel4239360 -h 192.168.154.130
create database jumpserver default charset 'utf8';     #创建个jumpserver 库
grant all on jumpserver.* to luoluo@'192.168.154.%' identified by 'angel4239360';   #授权账号






启动redis
docker run -d --name redis -p 6379:6379 redis:4.0.14





 

 

 

jumpserver 节点

docker pull jumpserver/jms_all:1.4.10
mkdir -p /opt/jumpserver  


docker run --name jms_all -d -v /opt/jumpserver:/opt/jumpserver/data/media -p 80:80 -p 2222:2222 -e SECRET_KEY=PEHVdLzvZFtDQT733ntHDH1hglXQ9OQKoI1xxAfdDhpRGx3tg7 -e BOOTSTRAP_TOKEN=YDzl55tZPTdclbUh -e DB_HOST=192.168.154.130 -e DB_PORT=3306 -e DB_USER=luoluo -e DB_PASSWORD=angel4239360 -e DB_NAME=jumpserver -e REDIS_HOST=192.168.154.130 -e REDIS_PORT=6379 -e REDIS_PASSWORD= jumpserver/jms_all:1.4.10

 

 

 

 

 

 

 

上一篇:安装MySQL(超详细)


下一篇:mysql密码忘记如何恢复(windows/liunx版本:mysql-8.0.27)