git常用命令整理

## 忽略https错误
git -c http.sslverify=false clone https://gitlab.aiqinqin.info/root/jiang.git

## 永久保存用户名和密码
git config --global credential.helper store

##配置全局用户信息
git config --global user.email "qq@qq.com"
git config --global user.name "root"

##git清除用户名密码
git config --system --unset credential.helper

##全局关闭git的ssl认证
git config --system http.sslverify false

##创建一个分支 release-1.0是你自己的版本号
git checkout -b release-1.0

##本地提交修改过的代码
git add .

##版本注释
git commit -m"First commit"

##提交分支
git push origin release-1.0

## 查看本地分支
git branch

## 查看所有分支情况
git branch -a

## 切换到新分支
git checkout branchName

centos下安装etcd集群

环境准备
172.16.50.30(centos7.x)
172.16.50.31(centos7.x)

  • 在172.16.50.30这台机器上面运行
#!/bin/bash
yum install wget -y
cd /opt && wget https://github.com/etcd-io/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz
tar zxvf etcd-v3.3.10-linux-amd64.tar.gz && cd etcd-v3.3.10-linux-amd64
nohup ./etcd --name docker-node1 \
--initial-advertise-peer-urls http://172.16.50.30:2380 \
--listen-peer-urls http://172.16.50.30:2380 \
--listen-client-urls http://172.16.50.30:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://172.16.50.30:2379 \
--initial-cluster-token etcd-cluster \
--initial-cluster docker-node1=http://172.16.50.30:2380,docker-node2=http://172.16.50.31:2380 \
--initial-cluster-state new&
  • 在172.16.50.31这台机器上面运行
#!/bin/bash
yum install wget -y
cd /opt && wget https://github.com/etcd-io/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz
tar zxvf etcd-v3.3.10-linux-amd64.tar.gz && cd etcd-v3.3.10-linux-amd64
nohup ./etcd --name docker-node2 \
--initial-advertise-peer-urls http://172.16.50.31:2380 \
--listen-peer-urls http://172.16.50.31:2380 \
--listen-client-urls http://172.16.50.31:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://172.16.50.31:2379 \
--initial-cluster-token etcd-cluster \
--initial-cluster docker-node1=http://172.16.50.30:2380,docker-node2=http://172.16.50.31:2380 \
--initial-cluster-state new&
  • 查看集群状态
./etcdctl cluster-health