Posts

Git介绍

Git、Github、Gitlab 的区别

Git是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。

是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。

Git使用

部署Git 服务

创建git仓库

git-server上的操作:

[root@localhost ~]# yum install git git-core gitweb -y
[root@localhost ~]# useradd git
[root@localhost ~]# passwd git
[root@localhost ~]# mkdir /git-root/
[root@localhost ~]# cd /git-root/
[root@localhost git-root]# git init --bare shell.git
Initialized empty Git repository in /git-root/shell.git/
[root@localhost git-root]# chown -R git:git shell.git

注意: git init 和 git init –bare 的区别:

Spring Boot集成SpringDoc生成Api文档

以下以 Maven 为例介绍 Spring Boot集成SpringDoc生成Api文档。

  1. 添加依赖
<dependency>
  <groupId>org.springdoc</groupId>
  <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
  1. 配置 annotationProcessor,实现通过 javadoc 生成文档。

每个 maven 模块都需要配置:

Docker安装和配置

Centos7安装Docker

配置宿主机网卡转发

## 配置网卡转发,看值是否为1
$ sysctl -a |grep -w net.ipv4.ip_forward
net.ipv4.ip_forward = 1

## 若未配置,需要执行如下
$ cat <<EOF >  /etc/sysctl.d/docker.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward=1
EOF
$ sysctl -p /etc/sysctl.d/docker.conf

Yum安装配置docker

## 下载阿里源repo文件
$ sudo yum install -y yum-utils
$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/repo/Centos-7.repo
$ sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

$ sudo yum clean all && yum makecache
## yum安装
$ sudo yum install -y docker-ce docker-ce-cli 

## 设置开机自启
systemctl enable docker  
systemctl daemon-reload

## 启动docker
systemctl start docker 

## 查看docker信息
docker info
docker version

## docker-client
which docker

## docker daemon
ps aux |grep docker

安装 Compose plugin:

[译]Minikube 中的 Minions - 面向 Java 开发人员的 Kubernetes 简介

我们希望我们的微服务是可复制、可替换的工作程序,我们可以轻松升级或降级,无需停机,管理也只需最少。我们可能会说我们希望他们是我们的奴才。在本文中,我们将通过一个简单的示例来了解 Kubernetes 通过创建和编排奴才大军可以为我们做些什么。您可以按照本文进行编码,也可以从此处克隆项目。

先决条件

我们需要将微服务容器化,以便在 Kubernetes 中运行它们 — 我们将使用Docker来实现这一点。我们将使用Minikube,而不是使用云托管的 Kubernetes,这样我们就可以在本地进行沙盒处理。

ActiveMQ安装和使用

ActiveMQ 是一个实现了 JMS 协议的开源消息中间件,目前它有两种版本:ActiveMQ “Classic” 和 ActiveMQ Artemis。