wonyong-jang / development-process Goto Github PK
View Code? Open in Web Editor NEWIt is where I record the error fixes or learning during the development process.
It is where I record the error fixes or learning during the development process.
노드가 채널을 공유하는 방법 – 예를 들어 전송 시점 등 –을 결정하는 분배 알고리즘
(2) 크게 3가지로 분류되는 다중 접속 프로토콜의 종류와 동작을 간략히 기술
채널 분할 프로토콜(channel partition protocol)
은 채널은 더 작은 “조각”들로 분할 (시간 슬롯, 주파수, 코드)되고 할당된 조각들은 노드가 배타적으로 사용 ==> 고비용
채널 분할 프로토콜은 고정된 길이의 시간 슬롯으로 분할되는 TDMA (Time Division Multiple Access)
==> 시간을 조각내서 하나의 단말만 통신, 안전한 방법이지만 고비용 이기 때문에 상황에 따라 사용
채널 스펙트럼이 주파수 밴드(frequency band)로 분할되는 FDMA (Frequency Division Multiple Access)
코드로 분할되는 CDMA (Code Division Multiple Access) 등이 있다.
랜덤 접속 프로토콜(random access protocol)
은 채널은 분할하지 않고 충돌 허용하고 충돌 시 복구
==> 충돌이 발생 함에도 감수하고 사용 (값이 싸기 때문)
슬롯 제한이 없는 알로아( Pure (unslotted) Aloha )
==> 가장 단순한 프로토콜/ 섬과 섬 통신하는데 사용하였는데, 주변상황 신경 쓰지 않고 통신 겹치는 시간이 있다면 frame(2계층에서의 메시지) 끼리 충돌이 일어남, 바쁠때는 더욱 심한 충돌 발생
랜덤 접속 프로토콜은 같은 크기의 슬롯의 시작점에서만 프레임을 전송하는 슬롯 알로아(Slotted Aloha)
==> 보낼 frame을 눈치 보지 않고 보내긴 하는데 시작 시간만 정해져 보내자, 충돌이 일어나긴 하지만 pure 보다 더 적은 충돌 확률
전송 전에 채널의 사용 여부를 조사하는 캐리어 감지를 하여 채널이 쉬고 있을 때 전송하는 CSMA (Carrier Sense Multiple Access) 프로토콜 등이 있다.
==> 규칙등장, 다른 frame 이 전송될때 잠시 양보 하고 대기 후 전송 시작 , 충돌 확률은 훨씬 더 줄지만 100% 막지는 못함
순번 프로토콜 (taking-turns protocol)
은 노드가 순번대로 채널을 사용하고 더 많은 데이터를 전송하는 노드는 오랫동안 순번을 기다려야 함
- reset 명령어를 이용하면 더 이상 필요 없어진 커밋들을 버릴 수 있습니다.
명령어 실행 시 어떤 모드로 실행할 지 지정하여 'HEAD' 위치와 인덱스,
작업 트리 내용을 함께 되돌릴지 여부를 선택할 수 있습니다.
커밋만 되돌리고 싶을 때 (soft)
변경한 인덱스의 상태를 원래대로 되돌리고 싶을 때 (mixed)
최근의 커밋을 완전히 버리고 이전의 상태로 되돌리고 싶을 때 (hard)
ex) git reset --hard c1012ba (최근 커밋을 완전히 버리고 해당 커밋으로 이동)
git push -f (최근 커밋기록 다 지우고 덮어씀)
ex) git reset HEAD^ : 최종 커밋을 취소. 워킹트리는 보존됨. (커밋은 했으나 push하지 않은 경우 유용)
- revert 명령어를 이용하면, 특정 커밋의 내용을 삭제할 수 있습니다. rebase -i 명령어나 reset 명령어를 통해 커밋을 삭제할 수도 있지만, 해당 커밋이 이미 공개된 상태인 경우에는 이러한 삭제 작업을 함부로 하기 어렵습니다. 이러한 경우에는 revert 명령어를 이용해서 특정 커밋의 내용을 지우는 새로운 커밋(B')을 만들어 보다 안전하게 처리할 수 있습니다.
$ git rm -r --cached .
$ git add .
$ git commit -m "fixed untracked files”
다음의 명령을 사용하시면 곧바로 설정이 적용됩니다.
저장소에 이미 올라가있는 파일들도 삭제됩니다. (물론 푸시했을때)
옵션
-t : 호출 시간 limit
-c : 동시 호출할 client 수
-n : 호출할 request 횟수
호출 예
ab -n 100 -c 2 http://test.com/ => 2개 클라이언트가 총 100회 호출
ab -t 10 -c 2 http://test.com/ => 2개 클라이언트가 10초 동안 호출
벤치마킹 받는 서버(컴퓨터)에서 top 이라는 명령어를 통해서 cpu 점유율을 확인할수 있음
$ top
아파치 웹서버 접속자 로그 확인 명령
$ sudo tail -f /var/log/apache2/access.log
주요 결과
Time take for tests : 테스트 수행시간 (요청에 대해서 처리한 총 시간)
Requests per second : 초당 요청 처리 횟수 ( 1초당 몇번 처리할수 있었는지)
Time per request : 요청 당 응답 시간 ( ms 나온 결과값에 1/1000 곱하면 1초로 계산됨) ==> 보통 1초 가 넘지 않으면 좋은 서비스
예)
[]# ab http://www.naver.com/
This is ApacheBench, Version 1.3d <$Revision: 1.69 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.naver.com (be patient).....done
; 아파치 버전
Server Software: Apache
; 도메인명
Server Hostname: www.naver.com
; 웹서비스 사용 포트
Server Port: 80
; 초기문서가 위치하는 웹문서 root(서버내의 절대경로가 아님)
Document Path: /
; 초기문서의 용량
Document Length: 72226 bytes
Concurrency Level: 1
; 응답속도(사실 이값만 확인하면 된다.)
Time taken for tests: 0.016 seconds
; 요구에 응답한 세션수
Complete requests: 1
; 요구에 응답실패한 세션수
Failed requests: 0
; 실패한 에러수
Broken pipe errors: 0
; 총 전송 바이트수
Total transferred: 72539 bytes
; 총 전송한 HTML 바이트수
HTML transferred: 72226 bytes
; 초당 응답요구수
Requests per second: 62.50 [#/sec] (mean)
; 요구에 응답한 시간 (이값도 중요하다)
Time per request: 16.00 [ms] (mean)
; 요구에 응답한 시간
Time per request: 16.00 [ms] (mean, across all concurrent requests)
; 초당 전송 가능한 용량
Transfer rate: 4533.69 [Kbytes/sec] received
참고 : https://positivemh.tistory.com/350
용량 확인
SELECT SEGMENT_NAME, BLOCKS, bytes/1024/1024 MB
FROM DBA_SEGMENTS
실제 사용 블록확인
SELECT COUNT(DISTINCT
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)||
DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID)) "USED"
FROM ____;
블록의 크기와 실제 사용블록의 크기가 차이가 많이 나면 HWM를 줄여주는 것이 좋음
SHRINK 제약사항
1] SHRINK 대상 테이블 분석 및 조회
(NUM_ROWS에 비해 사용하는 BLOCKS가 과다하면 SHRINK필요)
SQL> SELECT OWNER, TABLE_NAME, NUM_ROWS,
BLOCKS, EMPTY_BLOCKS, AVG_SPACE,
CHAIN_CNT, AVG_ROW_LEN
FROM DBA_TABLES
WHERE OWNER = '소유자'
AND EMPTY_BLOCKS / (BLOCKS + EMPTY_BLOCKS) < 0.1
AND (BLOCKS + EMPTY_BLOCKS) > 0
ORDER BY BLOCKS DESC;
[참고] DBMS_SPACE.VERIFY_SHRINK_CANDIDATE
SQL > select job_name, program_name
from dba_scheduler_jobs
where job_name like '%SPACE%';
SQL > select program_name, program_action
from dba_scheduler_programs
where program_name = 'AUTO_SPACE_ADVISOR_PROG';
SELECT * FROM TABLE(dbms_space.asa_recommendations());
데이터의 compact : HWM 아래 영역에 중간 중간 hole을 채우는 작업 / HWM은 변하지 않음
HWM 내리기 : 1번 단계 후 새롭게 설정된 HWM 이후의 모든 공간을 해당 테이블 스페이스로 반납
$ ALTER TABLE ____ ENABLE ROW MOVEMENT; // row-movement 활성화 후 사용 가능
$ ALTER TABLE ____ SHRINK SPACE COMPACT// HWM 줄지 않고 중간중간 데이터 빈 공간 compact
==> shrink space 하기전 compact 하는게 속도 향상 가능
$ ALTER TABLE ____ SHRINK SPACE // 테이블
$ ALTER TABLE ____ SHRINK SPACE CASCADE // 테이블의 인덱스 cascade ;
$ ALTER TABLE ____ DISENABLE ROW MOVEMENT; // 비활성화
- move용 임시 테이블 스페이스 생성
$ CREATE TABLESPACE MOVE_IMSI DATAFILE '/oracle/app/oracle/oradata/movets01.dbf' SIZE 1G;
**테이블 기능 LOGGING 기능 OFF ( 운영서버에서는 NOLOGGING 권장안함 )**
NOLOGGING 후 insert 빨리해서 백업 하기 위함 (테스트 개발서버에서 진행)
$ ALTER TABLE 테이블이름 NOLOGGING;
$ ALTER TABLE 테이블이름 LOGGING;
- 테이블 새로 생성한 테이블 스페이스로 테이블 move
$ ALTER TABLE HWMTEST2 MOVE TABLESPACE MOVE_IMSI;
- 인덱스 상태 조회 ( INDEX_NAME 조회)
SELECT TABLE_NAME, INDEX_NAME, STATUS
FROM DBA_INDEXES
WHERE TABLE_NAME = 'HWMTEST2';
- 인덱스 상태가 UNUSABLE 이기 때문에 rebuild 진행!
ALTER INDEX (INDEX_NAME) REBUILD;
https://rtyley.github.io/bfg-repo-cleaner/
HEAD의 마지막 Commit에는 100MB가 넘는 파일이 없더라도 이전 Commit 중에 100MB 이상의 파일이 포함된 적이 있다면 이 경고를 피할 수 없다.
$ git push
Counting objects: 3086, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2980/2980), done.
Writing objects: 100% (3086/3086), 363.25 MiB | 935.00 KiB/s, done.
Total 3086 (delta 1236), reused 111 (delta 57)
remote: error: GH001: Large files detected. You may want to try Git Large File Storage — https://git-lfs.github.com.
remote: error: Trace: ***
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File *** is 120.94 MB; this exceeds GitHub’s file size limit of 100.00 MB
To [email protected]:***
! [remote rejected] master -> master (pre-receive hook declined)
! [remote rejected] *** -> *** (pre-receive hook declined)
error: failed to push some refs to ‘[email protected]:***’
관련 링크 : https://subicura.com/2017/11/22/mac-os-development-environment-setup.html
$ brew cask install iterm2
$ brew install zsh zsh-completions
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" // zsh의 설정을 관리해주는 oh-my-zsh을 설치합니다.
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
--><Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR/native
library and the useOpenSSL attribute of the
AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
OpenSSL for TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine defaultHost="localhost" name="Catalina">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
<Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Membership className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
port="45564"
frequency="500"
dropTime="3000"/>
<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto"
port="4000"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>
<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
</Sender>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
</Channel>
<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>
<Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
<Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="2018-cap1-4" path="/home" reloadable="true" source="org.eclipse.jst.jee.server:2018-cap1-4"/></Host>
</Engine>
</Service>
</Server>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
--><Server port="12005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<Connector connectionTimeout="20000" port="8088" protocol="HTTP/1.1" redirectPort="8443"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation. The default
SSLImplementation will depend on the presence of the APR/native
library and the useOpenSSL attribute of the
AprLifecycleListener.
Either JSSE or OpenSSL style configuration may be used regardless of
the SSLImplementation selected. JSSE style configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true">
<SSLHostConfig>
<Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
This connector uses the APR/native implementation which always uses
OpenSSL for TLS.
Either JSSE or OpenSSL style configuration may be used. OpenSSL style
configuration is used below.
-->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
maxThreads="150" SSLEnabled="true" >
<UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
<SSLHostConfig>
<Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
certificateFile="conf/localhost-rsa-cert.pem"
certificateChainFile="conf/localhost-rsa-chain.pem"
type="RSA" />
</SSLHostConfig>
</Connector>
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="12009" protocol="AJP/1.3" redirectPort="8443"/>
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine defaultHost="localhost" name="Catalina">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster">
<Manager className="org.apache.catalina.ha.session.DeltaManager" expireSessionsOnShutdown="false" notifyListenersOnReplication="true"/>
<Channel className="org.apache.catalina.tribes.group.GroupChannel">
<Membership className="org.apache.catalina.tribes.membership.McastService"
address="228.0.0.4"
port="45564"
frequency="500"
dropTime="3000"/>
<Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="auto"
port="4001"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>
<Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter">
<Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
</Sender>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
<Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor"/>
</Channel>
<Valve className="org.apache.catalina.ha.tcp.ReplicationValve" filter=""/>
<Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>
<Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
<ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
</Cluster>
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context docBase="2018-cap1-4" path="/home" reloadable="true" source="org.eclipse.jst.jee.server:2018-cap1-4"/></Host>
</Engine>
</Service>
</Server>
<!-- web.xml WAS Session Clustering -->
<distributable/>
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream balancer {
least_conn;
server localhost:8080;
server localhost:8088;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location /home {
proxy_pass http://balancer;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
$ npm install -g create-react-app ( use create-react-app developed by facebook)
$ create-react-app react-test ( create project
$ cd react-test
react-test/
README.md
node_modules/ # 이미 modules가 설치되어 있습니다.
package.json # 의존성 패키지는 대부분 node_modules/react-scripts 모듈내에 선언되어 있습니다.
.gitignore
public/
favicon.ico
index.html
manifest.json
src/
App.css
App.js
App.test.js
index.css
index.js # 앱이 시작되는 부분입니다.
logo.svg
registerServiceWorker.js # prodution 레벨에서 로컬캐시로부터 리소스를 제공하기 위한 서비스 워커 관련 설정,
$ npm start
show dbs - 전체 데이터베이스 열람
use [DB 이름] - 데이터베이스 선택 (없으면 데이터베이스 생성)
예) use dave_db - dave_db 데이터베이스 선택
show collections - 선택된 데이터베이스의 콜렉션 열람
db.[Collection 이름].함수() 로 해당 컬렉션의 데이터 열람 및 조작
예) db.test.find() - test 컬렉션에서 전체 Document 검색
데이터베이스 생성
use dave_db
데이터베이스 현황 확인
db
db.stats()
데이터베이스 삭제 및 생성
db.dropDatabase() (현재 컬렉션 삭제)
use dave_db
collection 생성 및 삭제
db.createCollection("employees", {capped:true, size:10000})
Right-click (server) -> Click Refresh -> Go to dave_db -> Go to Collections -> Check employees
capped:true 최초 제한된 크기로 생성된 공간에서만 데이터를 저장하는 설정 (고성능, 저장공간차면 기존 공간 재사용, 일정시간만 저장하는 로그에 적합)
db.employees.isCapped()
db.employees.drop()
db.createCollection("employees")
db.employees.isCapped()
db.employees.drop()
db.createCollection("employees", {capped:true, size:10000})
collection 확인
show collections
db.employees.stats()
collection 이름 변경
db.employees.renameCollection("emp")
collection 삭제
db.emp.drop()
alias mongod='brew services run mongodb-community'
alias mongod-status='brew services list'
alias mongod-stop='brew services stop mongodb-community'
$ wc -l test.txt // 라인수 count
참고 : https://www.lesstif.com/pages/viewpage.action?pageId=20776078
package com.example.demo.redis;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.*;
@SpringBootTest
class PersonRepositoryTest {
@Autowired
private PersonRepository repo;
@Test
void test() {
Person person = new Person("FF:124","Kaven", 25, "FF");
//repo.save(person);
// 저장
Iterable<Person> mm = repo.findAllByType("MM");
mm.forEach(next -> {
System.out.println(next.getId());
System.out.println(next.toString());
});
// // 삭제
//repo.delete(person);
}
@Test
void test2() {
System.out.println(distance(37.55941851781025, 37.45090270958281, 126.98987242188554, 126.70490404042661));
//37.55941851781025, 126.98987242188554
//37.45090270958281, 126.70490404042661
System.out.println(distance_Between_LatLong(37.55941851781025,126.98987242188554,37.45090270958281, 126.70490404042661));
System.out.println(distance_test3(37.55941851781025,126.98987242188554,37.45090270958281, 126.70490404042661, "K"));
}
double distance(double lat1, double lat2, double lon1, double lon2)
{
// The math module contains a function
// named toRadians which converts from
// degrees to radians.
lon1 = Math.toRadians(lon1);
lon2 = Math.toRadians(lon2);
lat1 = Math.toRadians(lat1);
lat2 = Math.toRadians(lat2);
// Haversine formula
double dlon = lon2 - lon1;
double dlat = lat2 - lat1;
double a = Math.pow(Math.sin(dlat / 2), 2)
+ Math.cos(lat1) * Math.cos(lat2)
* Math.pow(Math.sin(dlon / 2),2);
double c = 2 * Math.asin(Math.sqrt(a));
// Radius of earth in kilometers. Use 3956
// for miles
double r = 6371;
// calculate the result
return(c * r);
}
// Points will be converted to radians before calculation
double distance_Between_LatLong(double lat1, double lon1, double lat2, double lon2) {
lat1 = Math.toRadians(lat1);
lon1 = Math.toRadians(lon1);
lat2 = Math.toRadians(lat2);
lon2 = Math.toRadians(lon2);
double earthRadius = 6371; //Kilometers
return earthRadius * Math.acos(Math.sin(lat1)*Math.sin(lat2) + Math.cos(lat1)*Math.cos(lat2)*Math.cos(lon1 - lon2));
}
private static double distance_test3(double lat1, double lon1, double lat2, double lon2, String unit) {
if ((lat1 == lat2) && (lon1 == lon2)) {
return 0;
}
else {
double theta = lon1 - lon2;
double dist = Math.sin(Math.toRadians(lat1)) * Math.sin(Math.toRadians(lat2)) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.cos(Math.toRadians(theta));
dist = Math.acos(dist);
dist = Math.toDegrees(dist);
dist = dist * 60 * 1.1515;
if (unit.equals("K")) {
dist = dist * 1.609344;
} else if (unit.equals("N")) {
dist = dist * 0.8684;
}
return (dist);
}
}
}
nvm(Node Version Manager)을 사용하여 노드를 설치하는 방법
먼저 터미널에서 아래의 명령어를 입력해 nvm을 설치합니다.
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
그 다음, 쉘을 재시작하거나, 아래의 명령어를 실행합니다.
$ source ~/.bash_profile
제대로 설치되었는지 확인해 볼 수 있습니다.
$ nvm --version
컬럼명 변경
테이블명
CHANGE 기존컬럼명
새컬럼명
기존자료형컬럼 자료형 변경
테이블명
CHANGE 컬럼명
컬럼명
새자료형Auto_increment 설정값 초기화
테이블명
AUTO_INCREMENT=시작할 값
# final
# static
static {
// 초기화 할 내용 선언
// main() 보다 먼저 수행
}
- 그외 static import : 다른 클래스에 존재하는 static 멤버들을 불러와서 사용하기 위해 선언
=> 클래스명과 점을 통한 호출이 필요없이 바로 사용
ex) import static packageName.ClassName.staticMemberName
ex) import static packageName.ClassName.* // 모든 static 멤버 불러오기 가능
git fetch --all
git reset --hard origin/master
git pull origin master
#JAVA
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin
#MAVEN
export M2_HOME=/Users/jang-won-yong/dev/maven
export PATH=$PATH:$M2_HOME/bin
#DB 추가해서 home에서 편하게 mysql 접근 가능
export PATH=${PATH}:/usr/local/mysql/bin:JAVA_HOME/bin
#한글 설정
sudo vi /etc/my.cnf 에서 아래 내용 작성
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
init_connect=SET collation_connection=utf8_general_ci
init_connect=SET NAMES utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
// D3.js 가 데이터를 기반으로 돔을 생성
var data = [.....];
d3.select("body").selectAll("div) // 선언되어있는 body 문서요소에 가상의 문서요소 div 선언 여기에 그래프 그림
.data(data) // 데이터를 바인딩
.enter() // data 배열 요소 순회 하면서 가상의 문서요소 div 만듬
.append("div); // 추가
.style("height", function (d) { // 첫번째 파라미터는 스타일의 속성 이름, 두번째 콜백함수
return d + "px"; // enter() 를 통해 생성된 각 문서요소를 반환하는 콜백함수 / d 를통해 실제 데이터 접근 가능
}); // 픽셀단위
$ lsof -i -nP | grep LISTEN | awk '{print $(NF-1)" "$1}' | sort -u
ex)
*:49152 rapportd
*:8095 java
*:8096 java
$ lsof -i -P // 전체 열린 포트 확인
$ lsof -i -P | grep -i "listen" // 열린 포트 확인
$ sudo lsof -i :80
$ sudo kill -9 [process id] // sudo kill -9 823
$ sudo killall [process name] // sudo killall Python
Rest Representational State Transfer 라는 용어의 약자로서 웹의 장점을 최대한 활용 할수 있는 아키텍처
URI 와 HTTP 메소드를 이용해 객체화된 서비스에 접근 하는 것!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.