프로그램 사용/nfs2019. 2. 22. 08:17

nfs 에서도 sparse file을 지원은 하는데 NFS v4.2 이후부터라고

NFS V4.2 ? Feature

● Sparse File Support ? Sparse files are ones which

have allocated or uninitialized blocks in the file.

(1.4.3)

● SEEK - Find the Next Data or Hole

● NFS: Implement SEEK (Sep 2014)

● READ_PLUS - READ Data or Holes from a File

● No published upstream patches yet

● Prototype patches improve performance with reading holes

(See Anna’s keynote graph).  

[링크 : https://events.static.linuxfound.org/sites/events/files/slides/Vault2017.pdf]


특정 버전으로 제한하는 법은 아래와 같은데 소수점 버전은 없네?

To specify NFS version, use -o option


# mount -t nfs -o vers=4 192.168.1.10:/mnt/data /data

or

# mount -t nfs -o vers=3 192.168.1.10:/mnt/data /data 

[링크 : https://computingforgeeks.com/configure-nfsv3-and-nfsv4-on-centos-7/]


버전 확인하기

근데 여전히 소수점 버전은 확인이 불가능 하다.

 nfsstat

[링크 : https://unix.stackexchange.com/questions/115918/how-to-determine-if-nfs-mount-is-mounted-as-v3-or-v4]

'프로그램 사용 > nfs' 카테고리의 다른 글

rootfs 와 nfs-server  (0) 2019.07.17
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
Posted by 구차니
프로그램 사용/squid2019. 2. 19. 23:56

프록시 설정하려면 귀찮은데

그걸 해소하기 위한 방법으로 게이트웨이 아이피에다가 proxy 까는 것 처럼

클라이언트 측의 설정 없이 프록시 하는 법을 찾는 중


[링크 : https://www.cyberciti.biz/tips/linux-setup-transparent-proxy-squid-howto.html]

[링크 : https://linuxtechlab.com/squid-transparent-proxy-server-complete-configuration/]


+

방화벽에서 걸러서 프록시로 던져주는 것이 컨셉인듯

[링크 : https://blog.naver.com/kazami20/56490157]


이제 웹브라우저의 도구 -> 인터넷 옵션 -> 연결 -> 랜설정 -> 사용자랜에 프록시 사용을 체크한뒤

자신의 리눅스 프락시로 ip주소를 적고 포트를 3128로 지정해주고 인터넷을 하면

이제부터 보이는 웹 사이트 화면은 먼저 프락시에서 페이지를 읽어온뒤에 윈도우 웹브라우저로

보여지는것이다.

이와 같은 브라우저에서의 프락시 설정을 하지 않고 사용하고 싶을때 패킷필터 방화벽설정을

하여서 80포트로 가는 패킷을 3128번 포트로 리다이렉트하는 방법이 있다.

이것을 Transparent Proxy(투명 프락시)라고 하는데 이것을 설정하는 것은 쉬우며

젤 아래에 설정을 추가할 부분을 추가한다.


------------ Proxy mode 로 사용시 설정 끝 -----------------------------


squid데몬 스타트

/etc/rc.d/init.d/squid start



--------------------- 투명 프락시 사용할시 ---------------------------


투명 프락시를 사용할 경우에는 내부 네트워크(192.168.0.0)가 필요하고

공인 아피를 가진 리눅스가 한대 있다고 가정하고 이 리눅스에는 랜카드가 두개 있어야한다.

즉 리눅스 gateway서버로 돌아가는 리눅스가 한대 필요하다. gateway설정은 kldp를 참조하라.

gateway설정은 잘 되어있다고 보고

아래와 같은 설정을 게이트웨이의 iptables룰에 추가한다.


혹시 모르므로 아래같은 마스크레이드 룰이 적용 안되었다면 적용해라


iptables -t nat -A POSTROUTING -p TCP -s 0/0 --dport 21 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP -d 0/0 --dport 20 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 25 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 110 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 22 -j MASQUERADE

iptables -t nat -A POSTROUTING -p TCP --dport 23 -j MASQUERADE


echo "###################################################################################"

echo "###                Transparent Proxy with Squid                  ###"

echo "### iptables -t nat -A PREROUTING -p TCP --dport 80 -j REDIRECT --to-port 3128  ###"

echo "###################################################################################"



그리고 squid.conf에 다음의 설정을 추가한다.


httpd_accel_host virtual

httpd_accel_port 80

httpd_accel_with_proxy on

httpd_accel_uses_host_header on 

[링크 : http://coffeenix.net/board_view.php?cata_code=0&bd_code=129&bpage=]

Posted by 구차니
프로그램 사용/squid2019. 2. 18. 17:44

묘하게 비문인가. 오타인가 이해가 안되고 번역도 잘 안되고...


min / percent / max는 명시적 만료시간(explicit expiry time)이 정의되지 않은 애들에 대한 설정으로  

패킷캡쳐를 해보니 HTTP 내부에 이런 식으로 응답이 오는 걸 확인하였는데

요기에 expires나 Cache-Control : max-age 등에 값이 없을 경우에 대한 녀석으로 생각된다.

[링크 : https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html]


usage: refresh_pattern [-i] regex min percent max [options]


By default, regular expressions are CASE-SENSITIVE.  To make

them case-insensitive, use the -i option.

>>>>>

기본적으로 정규표현식은 대소문자를 구분합니다. 대소문자를 구분하지 않으려면 -i 옵션을 사용하시기 바랍니다.


'Min' is the time (in minutes) an object without an explicit

expiry time should be considered fresh. The recommended

value is 0, any higher values may cause dynamic applications

to be erroneously cached unless the application designer

has taken the appropriate actions.

>>>>>

'Min' 명시적 만료시간이 존재하지 않는 객체에 대해 신선하다고 간주되어야 할 시간 (분단위) 입니다.

추천되는 값은 0으로, 그 이상의 값은 어플리케이션 디자이너가 적절한 행동을 취해야하지 않는다면

다이나믹 어플리케이션에서 오류가 있는 캐시를 야기할 수 있습니다.

(다이나믹 웹에서 갱신되지 않는 옛 데이터를 캐시할 수 있다?)


'Percent' is a percentage of the objects age (time since last

modification age) an object without explicit expiry time

will be considered fresh.

>>>>>

'Percent'는 명시적 만료시간이 존재하지 않는 객체에 대해 신선하다고 간주되어야 할 나이(마지막 수정일로 부터의 나이)의 비율입니다.

(나중에 나올 LM Factor 인가?)


'Max' is an upper limit on how long objects without an explicit

expiry time will be considered fresh. The value is also used

to form Cache-Control: max-age header for a request sent from

Squid to origin/parent.

>>>>>

'Max' 명시적 만료시간이 존재하지 않는 객체에 대해 신선하다고 간주되어야 할 상한선 입니다.

이 값은  Squid로 부터 origin/parent로 요청되는 양식 Cache-Control: max-age 헤더로부터 사용됩니다.


options: override-expire

override-lastmod

reload-into-ims

ignore-reload

ignore-no-store

ignore-private

max-stale=NN

refresh-ims

store-stale


override-expire enforces min age even if the server

sent an explicit expiry time (e.g., with the

Expires: header or Cache-Control: max-age). Doing this

VIOLATES the HTTP standard.  Enabling this feature

could make you liable for problems which it causes.

>>>>>

override-expire 는 서버가 명시적 만료시간을 보내더라도 min age를 강제합니다.(예 Expires: header 혹은 Cache-Control: max-age).

이것은 HTTP 표준을 위반합니다. 이 기능을 활성화 시키면 그것으로부터 야기되는 문제들에 대해 책임을 져야합니다.


Note: override-expire does not enforce staleness - it only extends

freshness / min. If the server returns a Expires time which

is longer than your max time, Squid will still consider

the object fresh for that period of time.

>>>>>

알림 : override-expire는 부패를 강제 하지 않습니다 - 단지 신선함에 대한 min 시간을 늘립니다.

당신의 최고 시간보다 긴 만료시간을 서버가 보낸다면, Squid는 그 기간 동안은 신선함으로 판단할 것입니다.


override-lastmod enforces min age even on objects

that were modified recently.

>>>>>

override-lastmod는 최근 수정되었다 하더라도 객체에서 min 값을 강제합니다.


reload-into-ims changes a client no-cache or ``reload''

request for a cached entry into a conditional request using

If-Modified-Since and/or If-None-Match headers, provided the

cached entry has a Last-Modified and/or a strong ETag header.

Doing this VIOLATES the HTTP standard. Enabling this feature

could make you liable for problems which it causes.

>>>>>

reload-into-ims는 클라이언트의 Cache-Control : no-cache나 

캐시된 항목을 위해 요청되는 

캐쉬된 항목이 지니는 Last-Modified 와/나 강력한 ETag 헤더에 의해 제공되는

IMS(If-Modified-Since) 와/나 INM(If-None-Match) 헤더들로 부터의

조건부 요청에 의한 reload 요청을 변화합니다.


ignore-reload ignores a client no-cache or ``reload''

header. Doing this VIOLATES the HTTP standard. Enabling

this feature could make you liable for problems which

it causes.

>>>>>

ignore-reload는 클라이언트의 no-cache나 reload 헤더를 무시합니다.

이것은 HTTP 표준을 위반합니다. 이 기능을 활성화 시키면 그것으로부터 야기되는 문제들에 대해 책임을 져야합니다.


ignore-no-store ignores any ``Cache-control: no-store''

headers received from a server. Doing this VIOLATES

the HTTP standard. Enabling this feature could make you

liable for problems which it causes.

>>>>>

ignore-no-store는 서버로 부터 받아지는 어떠한 'Cache-control: no-store' 헤더도 무시하도록 합니다.

이것은 HTTP 표준을 위반합니다. 이 기능을 활성화 시키면 그것으로부터 야기되는 문제들에 대해 책임을 져야합니다.


ignore-private ignores any ``Cache-control: private''

headers received from a server. Doing this VIOLATES

the HTTP standard. Enabling this feature could make you

liable for problems which it causes.

>>>>>

ignore-private는 서버로 부터 받아지는 어떠한 'Cache-control: private' 헤더도 무시하도록 합니다.

이것은 HTTP 표준을 위반합니다. 이 기능을 활성화 시키면 그것으로부터 야기되는 문제들에 대해 책임을 져야합니다.


refresh-ims causes squid to contact the origin server

when a client issues an If-Modified-Since request. This

ensures that the client will receive an updated version

if one is available.

>>>>>

refresh-ims는 클라이언트가 IMS(If-Modified-Since) 요청을 발행하였을때 원본 서버로 부터 squid의 접속을 발생하도록 합니다.

이것은 클라이언트가 가능하다면 업데이트 된 버전을 받도록 보장합니다.


store-stale stores responses even if they don't have explicit 

freshness or a validator (i.e., Last-Modified or an ETag) 

present, or if they're already stale. By default, Squid will 

not cache such responses because they usually can't be

reused. Note that such responses will be stale by default.

>>>>>

store-stale 는 명시적인 신선함이나 감별자 (예로 Last-Modified 혹은 ETag)존재가 없거나 혹은 그것들이 이미 신선하지 않더라도 응답을 저장합니다.

그것들이 대부분 재사용될 수 없기 때문에, 기본적으로 Squid는 이러한 응답들을 캐시하지 않을 것입니다.


max-stale=NN provide a maximum staleness factor. Squid won't

serve objects more stale than this even if it failed to

validate the object. Default: use the max_stale global limit.

>>>>>

max-stale=NN은 최대 부패 요소를 제공합니다. Squid는 객체를 입증하는데 실패하더라도, 이 값 보다 더 부패한 객체에 대해서 제공하지 않을 것입니다. 

기본값 : max_stale 전역 제한을 사용합니다.


결론 : 번역해서 먼소리인지 모르겠다!!!!


+

HTTP 프로토콜을 들여다 보게 될 줄이야 ㅠㅠ

전부 Cache-Control 하위 설정들이었구나..

캐시 요청 디렉티브

Cache-Control: max-age=<seconds>

Cache-Control: max-stale[=<seconds>]

Cache-Control: min-fresh=<seconds>

Cache-control: no-cache 

Cache-control: no-store

Cache-control: no-transform

Cache-control: only-if-cached 

[링크 : https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/Cache-Control]

'프로그램 사용 > squid' 카테고리의 다른 글

HSTS-HTTP Strict Transport Security / squid  (0) 2019.02.25
squid as transparent proxy  (0) 2019.02.19
squid LM-factor? (Last Modified)  (0) 2019.02.18
squid access log 종류..  (2) 2019.02.17
mrtf centos  (0) 2019.02.14
Posted by 구차니
프로그램 사용/squid2019. 2. 18. 10:56

이건 또 언제보냐..

일단 뒤에 squid 번역해 보고 나니 조금 이해 되는 듯 한데

이해한 걸 적자면.. ILM(If-Last-Modified) 으로 설정되었을 경우

(현재 시간 - LastModified 시간) * Percent(Squid에서 설정되는 그 값)가 Fresh 하다고 간주되는 시간이다.

근데... 현재 시간이 그럼 늦게 접속하면.. 오랜시간 동안 변하지 않았으니

Fresh로 오랫동안 간주해도 된다는 의미인가?

2019/02/18 - [프로그램 사용/squid] - 끄으으응.. squid 번역을 한번 했어야 했나.. refresh_pattern


The response is stale if the response age is greater than the refresh_pattern max value.

refresh_pattern max 값 보다 응답 시간이 클 경우 응답은 부패한 것 으로 간주합니다.


The response is fresh if the LM-factor is less than the refresh_pattern percent value.

refresh_pattern percent 값 보다 LM-factor가 적을 경우 응답은 신선한 것 으로 간주합니다.


The response is fresh if the response age is less than the refresh_pattern min value.

refresh_pattern min 값 보다 응답 시간이 적을 경우 응답은 신선한 것 으로 간주합니다.


Otherwise, the response is stale.

그 외에는 응답은 부패한 것으로 간주합니다. 


override-expire

When set, this option causes Squid to check the min value before checking the Expires header. Thus, a non-zero min time makes Squid return an unvalidated cache hit even if the response is preexpired.

이 옵션은 Squid가 Expire 헤더를 확인하기 전에 min 값을 확인하도록 설정합니다. 그러므로 0이 아닌 min 값은 Squid가 응답이 만료되기 전이라도 캐시 적중을 무효화 하게 됩니다.


override-lastmod

When set, this option causes Squid to check the min value before the LM-factor percentage.

이 옵션은 Squid가 LM-factor 퍼센트 보다 먼저 min 값을 확인하도록 설정합니다.


reload-into-ims

When set, this option makes Squid transform a request with a no-cache directive into a validation (If-Modified-Since) request. In other words, Squid adds an If-Modified-Since header to the request before forwarding it on. Note that this only works for objects that have a Last-Modified timestamp. The outbound request retains the no-cache directive, so that it reaches the origin server.

이 옵션은 Squid가 no-cache 지시어가 있는 요청을 유효한 (IMS If-Modified-Since)요청으로 변환하도록 설정합니다. 다르게 말하자면, Squid는 IMS(If-Modified-Since) 헤더를 덧붙여서 전달합니다. 이 설정은 Last-Modified 타임스탬프가 존재하는 객체에 대해서만 작동합니다. 

아웃바운드 요청은 no-cache 지시어를 유지하며, 원본 서버에 도달하게 됩니다.


ignore-reload

When set, this option causes Squid to ignore the no-cache directive, if any, in the request.

이 옵션은 Squid가 no-cache 지시어를 무시하도록 설정합니다. 

[링크 : http://etutorials.org/.../Chapter+7.+Disk+Cache+Basics/7.7+refresh_pattern/]

'프로그램 사용 > squid' 카테고리의 다른 글

squid as transparent proxy  (0) 2019.02.19
끄으으응.. squid 번역을 한번 했어야 했나.. refresh_pattern  (0) 2019.02.18
squid access log 종류..  (2) 2019.02.17
mrtf centos  (0) 2019.02.14
squid cache hit rate 올리기  (0) 2019.02.14
Posted by 구차니
프로그램 사용/squid2019. 2. 17. 20:32

일단 쓰면서 보면 제일 눈에 많이 띄는건 아래의 녀석들인데..


TCP_MISS

TCP_INM_HIT

TCP_MEM_HIT

TAG_NONE


HIER_DIRECT

HIER_NONE


HIT는 HIT인데 나머지는 감이 안온다.. ㅠㅠ

찾아도 왜이렇게 안보일까...?

'프로그램 사용 > squid' 카테고리의 다른 글

끄으으응.. squid 번역을 한번 했어야 했나.. refresh_pattern  (0) 2019.02.18
squid LM-factor? (Last Modified)  (0) 2019.02.18
mrtf centos  (0) 2019.02.14
squid cache hit rate 올리기  (0) 2019.02.14
squid 비디오 차단  (0) 2019.02.13
Posted by 구차니

아.. 망했다.. ㅠㅠ

[링크 : https://www.medo64.com/2010/12/extracting-sparse-tar/]

'프로그램 사용 > kvm(virt-manager)' 카테고리의 다른 글

virsh domstats 로 가상머신의 cpu 사용율 확인하기  (0) 2019.03.29
kvm snapshot  (0) 2019.03.17
sparse file nfs /smb  (0) 2019.02.15
virsh create / define  (0) 2019.02.15
kvm 설치  (4) 2019.02.15
Posted by 구차니

'프로그램 사용 > kvm(virt-manager)' 카테고리의 다른 글

kvm snapshot  (0) 2019.03.17
tar 로 압축된 sparse file 풀기  (0) 2019.02.16
virsh create / define  (0) 2019.02.15
kvm 설치  (4) 2019.02.15
sparse file with cp  (0) 2019.02.15
Posted by 구차니

centos 에서 서비스 명을 겨우 찾음.. -_-


# ll /etc/systemd/system/basic.target.wants

합계 0

lrwxrwxrwx. 1 root root 41  1월 16  2017 firewalld.service -> /usr/lib/systemd/system/firewalld.service

lrwxrwxrwx. 1 root root 47  1월 16  2017 gitlab-runsvdir.service -> /usr/lib/systemd/system/gitlab-runsvdir.service

lrwxrwxrwx. 1 root root 41  1월 16  2017 microcode.service -> /usr/lib/systemd/system/microcode.service 

[링크 : https://www.digitalocean.com/.../how-to-use-systemctl-to-manage-systemd-services-and-units]


# systemctl status gitlab-runsvdir

● gitlab-runsvdir.service - GitLab Runit supervision process

   Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; vendor preset: disabled)

   Active: active (running) since 화 2019-01-22 12:42:45 KST; 3 weeks 3 days ago

 Main PID: 620 (runsvdir)

   CGroup: /system.slice/gitlab-runsvdir.service

           ├─  620 runsvdir -P /opt/gitlab/service log: ....................................................................

...

           ├─18710 sleep 3000

           └─18789 sleep 1


 1월 22 12:42:45 localhost.localdomain systemd[1]: Started GitLab Runit supervision process.

 1월 22 12:42:45 localhost.localdomain systemd[1]: Starting GitLab Runit supervision process... 


설치

[링크 : https://wikidocs.net/16279]

[링크 : https://blog.asamaru.net/2015/09/22/how-to-install-gitlib-on-centos/]


업그레이드 및 중지

[링크 : https://hreeman.tistory.com/79]


자동실행

[링크 : https://stackoverflow.com/questions/27983295/gitlab-autostart-on-boot]

'프로그램 사용 > Version Control' 카테고리의 다른 글

git 저장소 합치기  (0) 2019.06.03
gitignore 특정 파일은 예외에서 제외시키기  (0) 2019.04.17
git branch  (0) 2019.01.29
git 윈도우 자격증명 관리  (0) 2019.01.16
git tag  (0) 2018.12.07
Posted by 구차니

적었나 기억이 안나네..

일단 다른 시스템으로 이전하면서 사용이 가능한지 확인하려고 하는데

dumpxml로 설정을 받아내고(그냥 뱉어내니 파일로 저장을 해주어야 함)

그걸 create 냐 define이냐로 고민을 하고 있는데

(난 도움말 보고 create면 된다라고 하고, 다른 사람은 define으로 해야 한다라고 해서)


fedora 글로는 create면 되는 듯 한데?

# virsh dumpxml GuestID > guest.xml

# virsh create configuration_file.xml 

[링크 : https://docs.fedoraproject.org/..._with_virsh-Creating_a_virtual_machine_XML_dump_configuration_file.html]


일단 define은 생성만 하고 실행을 안하고 create는 pause를 주지 않으면 바로 실행 하는 듯?

실험을 해보니 create로 하면 등록되지 않고 바로 실행되고

define + start가 적합한 등록 방법으로 보인다.

create FILE [--console] [--paused] [--autodestroy]

Create a domain from an XML <file>. An easy way to create the XML <file> is to use the dumpxml command to obtain the definition of a pre-existing guest. The domain will be paused if the --paused option is used and supported by the driver; otherwise it will be running. If --console is requested, attach to the console after creation. If --autodestroy is requested, then the guest will be automatically destroyed when virsh closes its connection to libvirt, or otherwise exits.

Example

virsh dumpxml <domain> > domain.xml

vi domain.xml (or make changes with your other text editor)

virsh create domain.xml


define FILE

Define a domain from an XML <file>. The domain definition is registered but not started. If domain is already running, the changes will take effect on the next boot. 

[링크 : https://linux.die.net/man/1/virsh]

'프로그램 사용 > kvm(virt-manager)' 카테고리의 다른 글

tar 로 압축된 sparse file 풀기  (0) 2019.02.16
sparse file nfs /smb  (0) 2019.02.15
kvm 설치  (4) 2019.02.15
sparse file with cp  (0) 2019.02.15
qcow2 sparse file  (0) 2019.02.14
Posted by 구차니

어라. centos 처음깔때 kvm 포함하면 되는게 아니었냐 -ㅁ-?


$ sudo yum install kvm libvirt 

[링크 : https://www.howtoforge.com/how-to-install-kvm-and-libvirt-on-centos-6.2-with-bridged-networking]


위의 패키지에 기본으로 깔리는지 모르는 녀석

$ sudo yum install virt-manager


'프로그램 사용 > kvm(virt-manager)' 카테고리의 다른 글

sparse file nfs /smb  (0) 2019.02.15
virsh create / define  (0) 2019.02.15
sparse file with cp  (0) 2019.02.15
qcow2 sparse file  (0) 2019.02.14
qcow2 파일크기의 오류?  (0) 2019.02.12
Posted by 구차니