Jump Server在docker中安装部署
安装部署:
1.准备机器:
官方环境要求:
硬件配置: 2个CPU核心, 4G 内存, 50G 硬盘(最低)
操作系统: Linux 发行版 x86_64
Python = 3.6.x
Mysql Server ≥ 5.6
Mariadb Server ≥ 5.5.56
Redis
1 安装机器:ubuntu18.04.3
2 Jump Server:10.0.0.70 2C-4G
3 Mysql/redis :10.0.0.71 1C-1G
4两台机器都需要安装docker,安装docker步骤省略阿里云镜像站可以下载
10.0.0.71mysql机器配置
#下载redis和mysql
root@ubuntu1804:~# apt install lrzsz
root@ubuntu1804:~# docker pull mysql:5.6.47
root@ubuntu1804:~# docker pull redis #mysql.cnf配置文件:
#将容器中的Mysql配置文件在宿主机上通过-v挂载容器中。
root@ubuntu1804:~# mkdir /etc/mysql/mysql.conf.d -p
root@ubuntu1804:~# cd /etc/mysql/mysql.conf.d/
root@ubuntu1804:/etc/mysql/mysql.conf.d# vim mysqld.cnf
#把容器的mysql配置文件复制下来
#Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #
# The MySQL Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html [mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
#log-error = /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0 character-set-server=utf8 这一行必须要加上 #mysql.cnf配置文件
root@ubuntu1804:/etc/mysql/mysql.conf.d# vim /etc/mysql/mysql.conf.d/mysql.cnf
[mysql]
default-character-set=utf8 #创建数据目录并且运行mysql容器
root@ubuntu1804:/etc/mysql/mysql.conf.d# mkdir /data/mysql -p root@ubuntu1804:~# docker run -it -d -p 3306:3306 -v /etc/mysql/mysql.conf.d/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -v /etc/mysql/conf.d/mysql.cnf:/etc/mysql/conf.d/mysql.cnf -v /data/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD="magedu.com" mysql:5.6.47
1.启动redis并暴露端口
root@ubuntu1804:~# docker run -it -d -p 6379:6379 redis
2.验证redis root@ubuntu1804:~# apt install redis-server
root@ubuntu1804:~# redis-cli -h 10.0.0.71
10.0.0.71:6379> info
# Serve #验证mysql
从10.0.0.70即jump server服务器访问数据库,验证数据库编码,验证字符集是否是utf-8
root@ubuntu1804:~# apt install mysql-client
root@ubuntu1804:~# mysql -uroot -pmagedu.com -h 10.0.0.71
mysql: [Warning] Using a password on the command line interface can be insecure. mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec) #验证数据库编码
mysql> show variables like "%character%";show variables like "%collation%";
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec) +----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_general_ci |
| collation_server | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec) mysql> exit
Bye
创建Jump Server 数据库 mysql -uroot -pmagedu.com -h10.0.0.71
create database jumpserver default charset 'utf8';
grant all on jumpserver.* to 'jumpserver'@'%' identified by 'magedu.com'; #生成加密密钥
#生成随机加密密钥和初始化token。
root@ubuntu1804:~# if [ "$SECRET_KEY" = "" ]; then SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`; echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc; echo $SECRET_KEY; else echo $SECRET_KEY; fi PGlVEfo5GdEF766FMNdByQiS3ELJD49HUK5iZ7QFg6CsZJlCLn root@ubuntu1804:~# if [ "$BOOTSTRAP_TOKEN" = "" ]; then BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`; echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc; echo $BOOTSTRAP_TOKEN; else echo $BOOTSTRAP_TOKEN; fi
N8LunBBco2OUfWBj #验证数据库
root@ubuntu1804:~# mysql -ujumpserver -pmagedu.com -h10.0.0.71
mysql: [Warning] Using a password on the command line interface can be insecure. #下载jumpserver镜像:不带版本号,默认下载最新版jumpserver
docker pull jumpserver/jms_all:1.5.6 建jumpserver 容器
root@ubuntu1804:~# docker run --name all -v /opt/jumpserver:/opt/jumpserver/data/media -p 80:80 -p 2222:2222 -e SECRET_KEY=XHK7dhQ4nmEPqE0rqWupOm2FtYIEeD1DmU9EiNyfl3pypEtgjK -e BOOTSTRAP_TOKEN=z7QorguuusCTGx0H -e DB_HOST=10.0.0.71 -e DB_PORT=3306 -e DB_USER='jumpserver' -e DB_PASSWORD="magedu.com" -e DB_NAME=jumpserver -e REDIS_HOST=10.0.0.71 -e REDIS_PORT=6379 -e REDIS_PASSWORD= jumpserver/jms_all:1.5.6
#容器启动完成
SUCCESS
Tomcat started.
Jumpserver ALL 1.5.6
官网 http://www.jumpserver.org
文档 http://docs.jumpserver.org
有问题请参考 http://docs.jumpserver.org/zh/docs/faq.html
进入容器命令 docker exec -it jms_all /bin/bash #jumps server 使用:
默认账户:admin
默认密码:admin

Jump Server在docker中安装部署的更多相关文章
- 在Docker中安装和部署MongoDB集群
此文已由作者袁欢授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 在Docker中安装mongodb 采用的mongodb镜像:https://registry.hub.doc ...
- docker微服务部署之:四、安装docker、docker中安装mysql和jdk1.8、手动构建镜像、部署项目
docker微服务部署之:三,搭建Zuul微服务项目 1.Centos7安装Docker 详见:Centos7安装Docker 2.Docker中安装jdk1.8 详见:使用Docker构建jdk1. ...
- Docker:安装部署RabbitMQ
前言 今天原本想讲解SpringBoot集成RabbitMQ的,临近开始写时才发现家里的电脑根本没有安装RabbitMQ呀.这下只好利用已有的阿里云服务器,直接Docker安装一下了,顺道记录下,算是 ...
- Ubuntu中安装部署Intel CS WebRTC
1环境要求 组件 版本要求 OS CentOS* 7.4, Ubuntu 14.04/16.04 LTS Node 8.11.* (推荐8.11.1) MongoDB 2.4.9 Boost 1.65 ...
- Linux或Docker里安装minio / Docker中安装h5ai
此文为单节点搭建操作 Linux中搭建minio 对象存储服务器 下载minio安装包 wget https://dl.minio.io/server/minio/release/linux-amd6 ...
- Azure DevOps Server 入门实践与安装部署
一,引言 最近一段时间,公司希望在自己的服务器上安装本地版的 Azure DevOps Service(Azure DevOps Server),用于项目内的测试,学习.本着学习的目的,我也就开始学习 ...
- 在docker中安装mysql
#!/bin/sh # 安装docker # 在docker中安装mysql # 解决了docker容器中无法输入中文的问题 ##########################安装docker # ...
- 在Docker中安装配置Oracle12c并实现数据持久化
在Docker中安装配置Oracle12c并实现数据持久化 选定镜像,并pull到系统中,一定要先配置加速,不然超级慢 eric@userver:~$ docker pull sath89/oracl ...
- 在Docker中安装.NET Core(使用命令行工具)
在Docker中安装.NET Core目前共有两种方法:1,使用命令行工具安装2,使用VS2017来安装 本文主要介绍使用命令行工具来安装: 1,安装Docker(如果本机已经有Docker环境,可以 ...
随机推荐
- jquery的ajax发送请求后前端不能实时更新
在IE下用Ajax请求某一页面,通常会因为缓存的原因而返回上一次的结果,造成混乱(比如说多次请求却没有响应). 错误代码如下: $.get("fetch.php") .done(f ...
- Docker下使用centos无法使用systemctl怎么办
提交正在使用的容器: docker commit [ContainerId] 提交停止正在运行无法使用Systemctl的容器: docker stop [ContainerId] 删除这个容器(可选 ...
- Spring(IOC、AOP和事务)
目录 Spring介绍 Spring IOC 传统代码对象管理的弊端 实现过程 bean标签属性介绍 对象创建方式 工厂bean bean的作用域 SpringBean的生命周期*** 依赖注入 注解 ...
- Python初学者随笔(一)_ 用Python写的第一个游戏“猜数字”
如标题所写,这篇随笔主要记录下学习Python过程中用Python写的第一个游戏--"猜数字"_跟着"小甲鱼"学Python,链接: https://b23.t ...
- 【poj 1182】食物链(图论--带权并查集)
题意:有3种动物A.B.C,形成一个"A吃B, B吃C,C吃A "的食物链.有一个人对N只这3类的动物有M种说法:第一种说法是"1 X Y",表示X和Y是同类. ...
- 大数据去重(data deduplication)方案
数据去重(data deduplication)是大数据领域司空见惯的问题了.除了统计UV等传统用法之外,去重的意义更在于消除不可靠数据源产生的脏数据--即重复上报数据或重复投递数据的影响,使计算产生 ...
- 鸟哥的linux私房菜——第七章学习(Linux 磁盘与文件系统管理)
1.1).文件系统特征 我们称呼一个可被挂载的数据为一个文件系统而不是一个分区! 文件系统通常会将这两部份的数据分别存放在不同的区块,权限与属性放置到 inode 中,至于实际数据则放置到 data ...
- l2-002 链表去重 (未解决)
L2-002. 链表去重 时间限制 300 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 给定一个带整数键值的单链表L,本题要求你编写程序,删除 ...
- 牛客多校第八场E Explorer(左开右闭线段树+可撤回并查集)题解
题意: 传送门 有\(n\)个点构成一个无向图,每条边有\(L_i,R_i\)表示这条边只能允许编号为\(L_i\dots R_i\)的人通过,现在问你最多有几个人能从\(1\)走到\(n\). 思路 ...
- Linux 驱动框架---cdev字符设备驱动和misc杂项设备驱动
字符设备 Linux中设备常见分类是字符设备,块设备.网络设备,其中字符设备也是Linux驱动中最常用的设备类型.因此开发Linux设备驱动肯定是要先学习一下字符设备的抽象的.在内核中使用struct ...