'전체 글'에 해당되는 글 24건

  1. 2020.03.16 git command
  2. 2020.03.13 POD 과 local machine 간 file copy
  3. 2020.03.13 mongodb 로그인, 조회 명령

git command

etc 2020. 3. 16. 17:24

# 환경설정, --global , --local

$ git config --global user.name "MyName"

$ git config --global user.email "MyMail@gmail.com"

 

# config 확인

$ git config --list

 

# 초기화

$ git init

# 초기화 + 디렉토리 자동생성 -dir_name

$ git init -dir_name

 

# 현재 git 상태

$ git status

 

# add : working tree -> stage

$ git add filename

 

# 변경사항 확인, working tree <-> stage, commit 이후에는 안됨..

$ git diff

 

# commit 내용 확인

$ git log

# commit된 파일까지 함께 보기

$ git log --stat

 

# commit : stage -> repository

$ git commit -m "message1"

 

# commit : working tree --> repository, 한번 commit 한 파일만 가능

$ git commit -am "message1"

 

# commit 메세지 수정

$ git commit --amend

 

 

# chechout, working tree 수정 되돌리기. 복구 안됨

$ git chechout

 

# stage 되돌리기, add 이후에 사용, 

$ git reset HEAD 파일명

 

# commit 되돌리기, working tree에만 수정내용이 존재하는 상태가 됨

$ git reset HEAD^

 

# 특정 commit으로 되돌리기

$ git reset --hard 커밋해시

 

# 커밋 삭제하지 않고 되돌리기

$ git revert 커밋해시

 

'etc' 카테고리의 다른 글

ssh key로 서버 접속  (0) 2020.05.18
bash Prompt 설정  (0) 2020.05.18
ubuntu user 생성  (0) 2020.04.20
ansible로 ubuntu user 생성  (0) 2020.02.19
Posted by jerymy
,

실행중인 pod 내부로 파일을 복사하거나 pod 내부의 파일을 로컬로 복사하는 방법

 

kubectl 명령을 실행하는 머신으로 POD 내부의 파일 copy

# POD에서 로컬로 file copy
$ kubectl cp namespaces/pod:dir/dir/mysql.cnf /dir/mysql.cnf

# sample 1
$ kubectl cp rm/rm-mysql-db-mysql-2342424324:etc/mysql/mysql.cnf.d/mysqld.cnf .
-> pod 안의 /etc/mysql/mysql.cnf.d 폴더의 mysqld.cnf 파일을 로컬 컴퓨터 . 디렉토리로 copy
-> windoww 경우 C드라이브 루트로 copy됨.

# sample 2
$ kubectl cp network-sdn/mysql-5c7f69846f-pmt8b:tmp/db-data.sql /root/ocp/db-data.sql
-> pod 이름 뒤에 : "/" 제외 해야 하며, local에 "."으로 하면 안되는 경우 있음 -> 전체 경로 표시 필요

# 로컬 file을 POD으로 copy
$ kubectl cp .filename namespaces/podname:directory/directory/filename.ccc 

 

'kubernetes' 카테고리의 다른 글

Install minikube with Driver none and cri-dockerd on CentOS 9  (0) 2024.06.07
install containerd-based k8s using Ansible  (0) 2023.03.10
minikube on ubuntu  (0) 2020.04.17
ingress controller log  (0) 2020.02.13
Posted by jerymy
,

NoSQL database

JSON 형태 구조 

 

RDBMS    : 테이블(Table), 데이터(Row)

mongodb : 테이블(Collection), 데이터(Document)

# 로그인
$ mongo admin -u root -p {password}
MongoDB shell version v4.0.12

# db 조회
> show dbs
admin     0.000GB
config    0.000GB
db-users  0.000GB
local     0.000GB

# db 선택
> use db-users
switched to db db-users

# collection(table) 조회
> show collections
or > show tables
users --> 조회된 collection(table)

# 내용 조회(현재DB.collection)
> db.users.find()

# JSON 형태 보기
> db.user.find().pretty()

'Open Source' 카테고리의 다른 글

Keycloak(User Federation) - LDAP 연계  (0) 2020.06.08
LDAP install on minikube  (0) 2020.06.08
Keycloak install on minikube  (0) 2020.06.08
install tekton on minikube  (0) 2020.04.21
Presto db 접근 방법  (0) 2020.03.31
Posted by jerymy
,