'프로그램 사용 > postgreSQL' 카테고리의 다른 글
| postgres 문자열 타입 (0) | 2019.08.09 |
|---|---|
| postgresql - 테이블 형상 보기 (0) | 2019.08.08 |
| pgfutter (0) | 2019.08.06 |
| postgres \COPY (0) | 2019.08.06 |
| union sql (0) | 2019.06.28 |
| postgres 문자열 타입 (0) | 2019.08.09 |
|---|---|
| postgresql - 테이블 형상 보기 (0) | 2019.08.08 |
| pgfutter (0) | 2019.08.06 |
| postgres \COPY (0) | 2019.08.06 |
| union sql (0) | 2019.06.28 |
import schema에 다가 csv 파일등을 넣어주는 녀석
go로 짰고 받아보니.. elf 실행파일인데...
테스트로 해보니까 걍 테이블을 text로 생성해 버린다.
그래도 최대 자릿수 찾을줄 알았는데 그게 아니라 아쉽네

[링크 : https://github.com/lukasmartinelli/pgfutter]
+
csv가 아닌 tsv의 경우 아래처럼 사용자 delimiter에 탭을 지정해주면 된다.
| pgfutter csv -d $'\t' traffic_violations.csv |
| postgresql - 테이블 형상 보기 (0) | 2019.08.08 |
|---|---|
| psql 테이블 목록보기 (0) | 2019.08.08 |
| postgres \COPY (0) | 2019.08.06 |
| union sql (0) | 2019.06.28 |
| postgresql csv update (0) | 2019.06.26 |
아..
예전에 된거 같아서 때려박아 보는데 relation이 없다고 나와서 급 멘붕..
| postgres=# \COPY PERSON FROM 'person.csv' DELIMITER E'\t' CSV HEADER QUOTE E'\b' ; 오류: "person" 이름의 릴레이션(relation)이 없습니다 |
원하던 글은 아니지만 다른글에서 원인 발견
copy는 생성된 테이블에 데이터를 넣어주는 매크로/함수인거지 테이블을 생성해주지 않음
[링크 : https://stackoverflow.com/questions/21018256/]
+
2019.09.02
\copy와 copy는 다른 명령이구나..
| 힌트: COPY FROM 명령은 PostgreSQL 서버 프로세스가 한 파일을 읽어 처리합니다. 클라이언트 쪽에 있는 파일을 읽어 처리 하려면, psql의 \copy 내장 명령어를 사용하세요. |
| psql 테이블 목록보기 (0) | 2019.08.08 |
|---|---|
| pgfutter (0) | 2019.08.06 |
| union sql (0) | 2019.06.28 |
| postgresql csv update (0) | 2019.06.26 |
| postgresql csv import (0) | 2019.06.25 |
|
$ sudo systemctl restart nfs-server $ sudo systemctl status nfs-server Jul 17 06:15:52 minikube exportfs[15642]: exportfs: /nfs-volume does not support NFS export |
| $ mount rootfs on / type rootfs (rw) devtmpfs on /dev type devtmpfs (rw,relatime,size=955872k,nr_inodes=238968,mode=755) sysfs on /sys type sysfs (rw,relatime) proc on /proc type proc (rw,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755) cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer) cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct) cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio) cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices) cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event) cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset) cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids) cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory) cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb) cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio) debugfs on /sys/kernel/debug type debugfs (rw,relatime) mqueue on /dev/mqueue type mqueue (rw,relatime) nfsd on /proc/fs/nfsd type nfsd (rw,relatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev) fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M) /dev/sda1 on /mnt/sda1 type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/boot2docker type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/docker type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/containers type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/log type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/kubelet type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/cni type ext4 (rw,relatime,data=ordered) /dev/sda1 on /data type ext4 (rw,relatime,data=ordered) /dev/sda1 on /tmp/hostpath_pv type ext4 (rw,relatime,data=ordered) /dev/sda1 on /tmp/hostpath-provisioner type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/minikube type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/toolbox type ext4 (rw,relatime,data=ordered) /dev/sda1 on /var/lib/minishift type ext4 (rw,relatime,data=ordered) /c/Users on /c/Users type vboxsf (rw,nodev,relatime) |
| nfs-kernel-server cannot work with a FUSE folder like an encrypted ecryptfs home directory. |
| rootfs is a special tempfs image used in initram, and stays in this instance because you have an encrypted LVM setup. Normally, init would overwrite rootfs with the actual mounted / file system, but Fedora may not have that fixed with your setup. There is no harm in it. |
[링크 : https://serverfault.com/questions/275988/what-is-rootfs]
| nfs version 과 sparse file (0) | 2019.02.22 |
|---|---|
| svc: failed to register lockdv1 RPC service (errno 111) (0) | 2015.02.10 |
| nfs mount 시 옵션들 (0) | 2012.12.11 |
| mount.nfs: access denied by server while mounting (0) | 2012.06.08 |
| showmount (0) | 2012.06.08 |
| rancher (0) | 2020.10.06 |
|---|---|
| kubernetes delete pods with namespace (0) | 2019.07.16 |
| kubernetes ImagePullBackOff 에러 (0) | 2019.07.16 |
| yaml (0) | 2019.07.16 |
| kubectl (0) | 2019.07.16 |
도움말을 보는데 많이 생략된 느낌이라.. 해보긴 좀 귀찮고.. -_-
namespace를 지우면 거기 들어있는 pods도 같이 삭제된다.
| >kubectl help delete pod Delete resources by filenames, stdin, resources and names, or by resources and label selector. JSON and YAML formats are accepted. Only one type of the arguments may be specified: filenames, resources and names, or resources and label selector. Some resources, such as pods, support graceful deletion. These resources define a default period before they are forcibly terminated (the grace period) but you may override that value with the --grace-period flag, or pass --now to set a grace-period of 1. Because these resources often represent entities in the cluster, deletion may not be acknowledged immediately. If the node hosting a pod is down or cannot reach the API server, termination may take significantly longer than the grace period. To force delete a resource, you must pass a grace period of 0 and specify the --force flag. IMPORTANT: Force deleting pods does not wait for confirmation that the pod's processes have been terminated, which can leave those processes running until the node detects the deletion and completes graceful deletion. If your processes use shared storage or talk to a remote API and depend on the name of the pod to identify themselves, force deleting those pods may result in multiple processes running on different machines using the same identification which may lead to data corruption or inconsistency. Only force delete pods when you are sure the pod is terminated, or if your application can tolerate multiple copies of the same pod running at once. Also, if you force delete pods the scheduler may place new pods on those nodes before the node has released those resources and causing those pods to be evicted immediately. Note that the delete command does NOT do resource version checks, so if someone submits an update to a resource right when you submit a delete, their update will be lost along with the rest of the resource. Examples: # Delete a pod using the type and name specified in pod.json. kubectl delete -f ./pod.json # Delete resources from a directory containing kustomization.yaml - e.g. dir/kustomization.yaml. kubectl delete -k dir # Delete a pod based on the type and name in the JSON passed into stdin. cat pod.json | kubectl delete -f - # Delete pods and services with same names "baz" and "foo" kubectl delete pod,service baz foo # Delete pods and services with label name=myLabel. kubectl delete pods,services -l name=myLabel # Delete a pod with minimal delay kubectl delete pod foo --now # Force delete a pod on a dead node kubectl delete pod foo --grace-period=0 --force # Delete all pods kubectl delete pods --all Options: --all=false: Delete all resources, including uninitialized ones, in the namespace of the specified resource types. -A, --all-namespaces=false: If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. --cascade=true: If true, cascade the deletion of the resources managed by this resource (e.g. Pods created by a ReplicationController). Default true. --field-selector='': Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type. -f, --filename=[]: containing the resource to delete. --force=false: Only used when grace-period=0. If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation. --grace-period=-1: Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). --ignore-not-found=false: Treat "resource not found" as a successful delete. Defaults to "true" when --all is specified. -k, --kustomize='': Process a kustomization directory. This flag can't be used together with -f or -R. --now=false: If true, resources are signaled for immediate shutdown (same as --grace-period=1). -o, --output='': Output mode. Use "-o name" for shorter output (resource/name). -R, --recursive=false: Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. -l, --selector='': Selector (label query) to filter on, not including uninitialized ones. --timeout=0s: The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object --wait=true: If true, wait for resources to be gone before returning. This waits for finalizers. Usage: kubectl delete ([-f FILENAME] | [-k DIRECTORY] | TYPE [(NAME | -l label | --all)]) [options] Use "kubectl options" for a list of global command-line options (applies to all commands). |
아무튼 찾아보니 --namespce 옵션에 값을 주어 특정 ns상의 pods를 삭제할 수 있어 보인다.
| kubectl delete --all pods --namespace=foo kubectl delete --all namespaces |
[링크 : https://stackoverflow.com/questions/33509194/command-to-delete-all-pods-in-all-kubernetes-namespaces]
| rancher (0) | 2020.10.06 |
|---|---|
| kubernetes selector (0) | 2019.07.16 |
| kubernetes ImagePullBackOff 에러 (0) | 2019.07.16 |
| yaml (0) | 2019.07.16 |
| kubectl (0) | 2019.07.16 |
git으로 로컬에 저장해두고 push 안한 상태에서
pull 하려고 하면 발생하는 에러
(본인이 직접 container 생성하는게 아니라면 볼일이 없을 듯)
[링크 : https://managedkube.com/.../imagepullbackoff/2019/02/23/imagepullbackoff.html]
| kubernetes selector (0) | 2019.07.16 |
|---|---|
| kubernetes delete pods with namespace (0) | 2019.07.16 |
| yaml (0) | 2019.07.16 |
| kubectl (0) | 2019.07.16 |
| 우분투에 쿠버네티스 설치하기(minikube 사용없이) (0) | 2019.07.15 |
저...언혀 사람이 쓰기 안편한데...
내가 사람이 아닌건가?!
(아니 난.. XML이나 JSON이 훨 편한데? ㅠㅠ)
[링크 : https://yaml.org/]
+
헐.. JSON의 슈퍼셋이 YAML이라니.. YAML이 더 큰거였다니!?!
|
Technically YAML is a superset of JSON. This means that, in theory at least, a YAML parser can understand JSON, but not necessarily the other way around. See the official specs, in the section entitled "YAML: Relation to JSON". |
[링크 : https://stackoverflow.com/questions/1726802/]
+
어짜피 그게 그거라 docker에서도 json으로 쓰면 yml이랑 상관없이 알아서 읽는 듯?
| kubernetes delete pods with namespace (0) | 2019.07.16 |
|---|---|
| kubernetes ImagePullBackOff 에러 (0) | 2019.07.16 |
| kubectl (0) | 2019.07.16 |
| 우분투에 쿠버네티스 설치하기(minikube 사용없이) (0) | 2019.07.15 |
| win10에서 hyper-v 끄기 (0) | 2019.07.15 |
docker 처럼 명령어가 넘쳐나는구만
C:>kubectl
kubectl controls the Kubernetes cluster manager.
Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/
Basic Commands (Beginner):
create Create a resource from a file or from stdin.
expose Take a replication controller, service, deployment or pod and expose it as a new
Kubernetes Service
run Run a particular image on the cluster
set Set specific features on objects
Basic Commands (Intermediate):
explain Documentation of resources
get Display one or many resources
edit Edit a resource on the server
delete Delete resources by filenames, stdin, resources and names, or by resources and
label selector
Deploy Commands:
rollout Manage the rollout of a resource
scale Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job
autoscale Auto-scale a Deployment, ReplicaSet, or ReplicationController
Cluster Management Commands:
certificate Modify certificate resources.
cluster-info Display cluster info
top Display Resource (CPU/Memory/Storage) usage.
cordon Mark node as unschedulable
uncordon Mark node as schedulable
drain Drain node in preparation for maintenance
taint Update the taints on one or more nodes
Troubleshooting and Debugging Commands:
describe Show details of a specific resource or group of resources
logs Print the logs for a container in a pod
attach Attach to a running container
exec Execute a command in a container
port-forward Forward one or more local ports to a pod
proxy Run a proxy to the Kubernetes API server
cp Copy files and directories to and from containers.
auth Inspect authorization
Advanced Commands:
diff Diff live version against would-be applied version
apply Apply a configuration to a resource by filename or stdin
patch Update field(s) of a resource using strategic merge patch
replace Replace a resource by filename or stdin
wait Experimental: Wait for a specific condition on one or many resources.
convert Convert config files between different API versions
kustomize Build a kustomization target from a directory or a remote url.
Settings Commands:
label Update the labels on a resource
annotate Update the annotations on a resource
completion Output shell completion code for the specified shell (bash or zsh)
Other Commands:
api-resources Print the supported API resources on the server
api-versions Print the supported API versions on the server, in the form of "group/version"
config Modify kubeconfig files
plugin Provides utilities for interacting with plugins.
version Print the client and server version information
Usage:
kubectl [flags] [options]
Use "kubectl <command> --help" for more information about a given command.
Use "kubectl options" for a list of global command-line options (applies to all commands).| kubernetes ImagePullBackOff 에러 (0) | 2019.07.16 |
|---|---|
| yaml (0) | 2019.07.16 |
| 우분투에 쿠버네티스 설치하기(minikube 사용없이) (0) | 2019.07.15 |
| win10에서 hyper-v 끄기 (0) | 2019.07.15 |
| minikube (0) | 2019.07.15 |
Dockerfile
COPY .(host) .(container)
CMD 는 ENTRYPOINT의 일부(둘다 지정시)
CMD
The CMD instruction has three forms:
CMD ["executable","param1","param2"] (exec form, this is the preferred form)
CMD ["param1","param2"] (as default parameters to ENTRYPOINT)
CMD command param1 param2 (shell form) <<<<< SHELL FORM
docker run -it ubuntu bash
는 cmd를 엎어 씀
entrypoint는 덮어 쓸수 없음(그렇기에 entry point없이 cmd만으로 된것으로 확인할수 있음)
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/bash"
],
"ArgsEscaped": true,
"Image": "sha256:ae950a0376fe6c4d08fa7ff395f50f4a909e26e9f2d865d8641cda024161c6ee",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": null
},
----
docker run help
--entrypoint string Overwrite the default ENTRYPOINT of the image
[링크 : https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact]
복수개의 Run
FROM golang:1.11-alpine AS build
# Install tools required for project
# Run `docker build --no-cache .` to update dependencies
RUN apk add --no-cache git
RUN go get github.com/golang/dep/cmd/dep
# List project dependencies with Gopkg.toml and Gopkg.lock
# These layers are only re-built when Gopkg files are updated
COPY Gopkg.lock Gopkg.toml /go/src/project/
WORKDIR /go/src/project/
# Install library dependencies
RUN dep ensure -vendor-only
# Copy the entire project and build it
# This layer is rebuilt when a file changes in the project directory
COPY . /go/src/project/
RUN go build -o /bin/project
# This results in a single layer image
FROM scratch
COPY --from=build /bin/project /bin/project
ENTRYPOINT ["/bin/project"]
CMD ["--help"]
[링크 : https://docs.docker.com/develop/develop-images/dockerfile_best-practices/]
| 도커 cpu 갯수 제한 (0) | 2024.03.22 |
|---|---|
| docker snap 버전 문제 (0) | 2022.10.12 |
| docker remote (0) | 2019.07.15 |
| UTS name space (0) | 2019.07.15 |
| LXC LXD (0) | 2019.07.15 |