Kubernetes 3 masters on ceontos7

이미지
  ===========사전작업=========== hostnamectl set-hostname k8s-m01 vi /etc/hosts 10.0.2.221 k8s-m01 10.0.2.222 k8s-m02 10.0.2.223 k8s-m03 10.0.2.220 k8s-vip ============커널업데이트================== mkdir -p /etc/yum.repos.d/bak cd /etc/yum.repos.d mv *.repo ./bak curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo find . -name "*.repo" -exec sed -i 's/gpgcheck=1/gpgcheck=0/g' {} \; yum -y update rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm yum --enablerepo=elrepo-kernel install -y kernel-ml grub2-mkconfig -o /boot/grub2/grub.cfg grub2-set-default 0 reboot uname -a ======================소프트웨어 설치 준비========= yum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager -y --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo cat <<EOF ...

Centos7 시간 동기화 (NTP)

 yum install ntp firewall-cmd --add-service=ntp --permanent firewall-cmd --reload systemctl start ntpd systemctl enable ntpd

postgres docker 설치

docker search postgres docker pull postgres docker run --name pgsql -d -p 5432:5432 -e POSTGRES_PASSWORD=비밀번호 postgres docker exec -it pgsql bash psql -U postgres CREATE DATABASE first; alter user postgres with password '비밀번호'; l c first ufw allow 5432

Docker 설치 on CentOS8

  dnf install docker-ce docker-ce-cli containerd.io --nobest

Local 과 Remote 저장소 연결 및 작업

cd c:\workdspace  [로컬과 원격저장소 연결] git remote add 별칭 https://github.com/inet815/study.git git remote -v    연결확인 ===========로컬에서 작업======== git push origin --all   로컬 작업의 모든 브랜치를 push ==========리모트와 로컬의 같은 파일을 로컬에서 변경 git push origin master   로컬 작업을 리모트에 푸쉬 하면 충돌 발생 git fetch    리모트의 커밋정보를 가져옮 git merge origin/master    로컬의 마스터와 리모트의 msater를 통합 git diff vim 수정 git commit -a -m "confict resolved GitHub" fetch와 merge를 한번에 하는 Pull 명령어

Remote 저장소를 Local 저장소로 복제

 cd c:\workspace [원격저장소를 로컬로 복제해서 작업] git clone https://gihub.com/inet815/study.git cd study git status

Local Git 사용법

PC에 git 설치 http://git-scm.com git bash 실행 git config --global user.name "이름" git config --global user.email "이메일" c:\ mkdir workspace cd workspace git init   로컬 저장소 초기화    vim hello.py git status   깃 상태 git add hello.py   깃에서 파일 추적하도록 추가 git status   깃 상태 git commit   수정사항 커밋 git branch   브랜치 조회 git branch hotfix   hofix 브랜치 생성 git checkput (-b) hotfix    브랜치 이동   git commit -a    저장소 파일 모두 커밋 git checkout master git merge hotfix    마스터에 hotfix를 병합 touch .gitignore    http://www.gitignore.io/ 에서 OS 별로 생성되는 내용을 복사해서 붙혀넣기 git add .gitignore git commit -m ''added '.gitignore' file"    깃에서 추적이 불필요한 파일/폴더 무시 git checkout master git merge hotfix git commit -a -m "conflict resolved"    충동 발생시 vim으로 수정후 다시 커밋 git log --graph git log --stat