Jun 3, 2020 - memcached 기능 설정

  1. yum clean up
    yum clean all
    
  2. yum 업데이트
    yum -y update
    
  3. memcahced 설치
    yum -y install memcahced
    
  4. memcahced 설치 확인
    memcached -h
    memcached 1.4.15
    -p       TCP port number to listen on (default: 11211)
    -U       UDP port number to listen on (default: 11211, 0 is off)
    -s      UNIX socket path to listen on (disables network support)
    -a      access mask for UNIX socket, in octal (default: 0700)
    -l      interface to listen on (default: INADDR_ANY, all addresses)
                may be specified as host:port. If you don't specify
               a port number, the value you specified with -p or -U is
               used. You may specify multiple addresses separated by comma
               or by using -l multiple times
    -d            run as a daemon
    -r            maximize core file limit
    -u  assume identity of  (only when run as root)
    -m       max memory to use for items in megabytes (default: 64 MB)
    -M            return error on memory exhausted (rather than removing items)
    -c       max simultaneous connections (default: 1024)
    -k            lock down all paged memory.  Note that there is a
               limit on how much memory you may lock.  Trying to
               allocate more than that would fail, so be sure you
               set the limit correctly for the user you started
               the daemon with (not for -u  user;
               under sh this is done with 'ulimit -S -l NUM_KB').
    -v            verbose (print errors/warnings while in event loop)
    -vv           very verbose (also print client commands/reponses)
    -vvv          extremely verbose (also print internal state transitions)
    -h            print this help and exit
    -i            print memcached and libevent license
    -P      save PID in , only used with -d option
    -f    chunk size growth factor (default: 1.25)
    -n     minimum space allocated for key+value+flags (default: 48)
    -L            Try to use large memory pages (if available). Increasing
               the memory page size could reduce the number of TLB misses
               and improve the performance. In order to get large pages
               from the OS, memcached will allocate the total item-cache
               in one large chunk.
    -D      Use  as the delimiter between key prefixes and IDs.
               This is used for per-prefix stats reporting. The default is
               ":" (colon). If this option is specified, stats collection
               is turned on automatically; if not, then it may be turned on
               by sending the "stats detail on" command to the server.
    -t       number of threads to use (default: 4)
    -R            Maximum number of requests per event, limits the number of
               requests process for a given connection to prevent
               starvation (default: 20)
    -C            Disable use of CAS
    -b       Set the backlog queue limit (default: 1024)
    -B            Binding protocol - one of ascii, binary, or auto (default)
    -I            Override the size of each slab page. Adjusts max item size
               (default: 1mb, min: 1k, max: 128m)
    -o            Comma separated list of extended or experimental options
               - (EXPERIMENTAL) maxconns_fast: immediately close new
                 connections if over maxconns limit
               - hashpower: An integer multiplier for how large the hash
                 table should be. Can be grown at runtime if not big enough.
                 Set this based on "STAT hash_power_level" before a
                 restart.
    
  5. memcached 에 대한 설정 변경을 원한다면 vi 로 /etc/sysconfig/memcached 들어가서 수정합니다.
    vi /etc/sysconfig/memcached
    PORT=”11211″
    USER=”memcached”
    MAXCONN=”1024″
    CACHESIZE=”64″
    OPTIONS=””
    
  6. memcached 재시작
    [root@localhost ~]# service restart memcached
    restart: 인식되지 않은 서비스
    [root@localhost ~]# service memcached restart
    memcached 를 정지 중:                                      [실패]
    memcached (을)를 시작 중:                                  [  OK  ]
    [root@localhost ~]# service memcached restart
    memcached 를 정지 중:                                      [  OK  ]
    memcached (을)를 시작 중:  
    

Jun 3, 2020 - WSL 2 기능 적용

Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).

갑자기, Host-Only Ethernet Adapter 에러가 발생했습니다.

순간 어제 WSL 2(Windows Subsystem For Linux 2)를 하기 위해, Windows 10 update 한 게 생각나서, 확인해보니,

Windows update 후(Window 10 1903)에 VirtualBox에서 이미지를 돌릴때 이미지의 네트워크 인터페이스를 호스트 전용 아답터(Host-only) 로 구동시 아래와 같이 VERR_INTNET_FLT_IF_NOT_FOUND 에러 메시지가 나면서 구동이 안되는 문제가 있었습니다.

Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).

우선 기존 네트워크 연결로 가서, VirtualBox Host-Only Ethernet Adapter 를 전부 OFF 처리합니다.

제어판\네트워크 및 인터넷\네트워크 연결

그 후 기존에 설정했던 셋팅을 다시 합니다.

가상 머신 GIT_001의 세션을 열 수 없습니다.

Interface ('VirtualBox Host-Only Ethernet Adapter') is not a Host-Only Adapter interface (VERR_INTERNAL_ERROR).

결과 코드: E_FAIL (0x80004005)
구성 요소: ConsoleWrap
인터페이스: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

이제 다른 에러가 나네요 ^-^ 새로 수정한 VirtualBox Host-Only Ethernet Adapter 를 설정하지 않았기 때문입니다!

잘 수정하니 정상적으로 동작하네요.

Jun 1, 2020 - Mybatis에서 IndexOutOfBoundsException이 나왔을 경우

### Cause: java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2

에러가 발생했을 경우,
언뜻보기에는 실제로 배열 범위 오류가 있다고 생각하지만, lombok을 부적절하게 사용하여 select 를 했기 대문에 일반적인 구분 오류가 난 경우입니다.

@Builder

주석을 사용한 후 노트가있는 엔티티 클래스는 생성자 표시 를 선언

@AllArgsConstructor

하거나

@NoArgsConstructor

구문을 사용 하거나 선언해야합니다.