반응형

디렉토리 권한 설정.

<Directory /DOCUMENT_ROOT>
    ~~~
    Require all granted
</Directory>

 

반응형
반응형

# Installing the epel repository
sudo yum -y install epel-release yum-utils
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

# Remi repository 설치
sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

# 기본으로 php 5.4가 적용되는데 레포지토리에서 비활성화 하고 7.4를 활성화 해준다.
sudo yum-config-manager --disable remi-php54  
sudo yum-config-manager --enable remi-php74

# php7.4 설치
sudo yum install php php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-xml php-pear php-bcmath php-json


$ php -v
PHP 7.4.20 (cli) (built: Jun  1 2021 15:41:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

 

 

반응형

'OS > Linux' 카테고리의 다른 글

방화벽 설정  (0) 2021.06.29
[linux] 디스크 읽기/쓰기 속도  (0) 2021.06.14
프로세스 thread 갯수 확인  (0) 2019.10.31
rpm 사용법  (0) 2019.05.09
[링크] 파일 권한  (0) 2019.05.09
반응형

현상 : 잘 돌아가고 있는 Java 프로세스에서 갑자기 에러 발생.

원인 : Java 프로세스가 떠 있는 상태에서 JDK 버전을 업데이트 해서 에러 발생.

해결 : Java 프로세스 재구동.

 

[WARN ] Failed to create a new channel from an accepted socket. {nioEventLoopGroup-3-1}
at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:155)
java.lang.UnsatisfiedLinkError: no net in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at sun.net.ExtendedOptionsImpl.lambda$static$0(ExtendedOptionsImpl.java:48)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.ExtendedOptionsImpl.<clinit>(ExtendedOptionsImpl.java:47)
    at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.defaultOptions(SocketChannelImpl.java:242)
    at sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder.<clinit>(SocketChannelImpl.java:229)
    at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:251)
    at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:169)
    at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:271)
    at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:306)
    at io.netty.channel.socket.DefaultSocketChannelConfig.setTcpNoDelay(DefaultSocketChannelConfig.java:253)
    at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:53)
    at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:470)
    at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:467)
    at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:106)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:151)
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)
[WARN ] Failed to create a new channel from an accepted socket. {nioEventLoopGroup-3-1}
at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:155)
java.lang.NoClassDefFoundError: Could not initialize class sun.nio.ch.SocketChannelImpl$DefaultOptionsHolder
    at sun.nio.ch.SocketChannelImpl.supportedOptions(SocketChannelImpl.java:251)
    at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:169)
    at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:271)
    at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:306)
    at io.netty.channel.socket.DefaultSocketChannelConfig.setTcpNoDelay(DefaultSocketChannelConfig.java:253)
    at io.netty.channel.socket.DefaultSocketChannelConfig.<init>(DefaultSocketChannelConfig.java:53)
    at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:470)
    at io.netty.channel.socket.nio.NioSocketChannel$NioSocketChannelConfig.<init>(NioSocketChannel.java:467)
    at io.netty.channel.socket.nio.NioSocketChannel.<init>(NioSocketChannel.java:106)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:151)
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

 

[/proc/16105/fd ] ls -al | grep java
15 -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/jre/lib/charsets.jar (deleted)
25 -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/jre/lib/jsse.jar (deleted)
4 -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/jre/lib/rt.jar (deleted)
7 -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/jre/lib/ext/cldrdata.jar (deleted)
8 -> /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.el7.x86_64/jre/lib/ext/localedata.jar (deleted)

 

 

반응형

'프로그래밍 > Java' 카테고리의 다른 글

Stream reduce 간단 설명  (0) 2023.05.20
java file.encoding  (0) 2022.07.12
Too many open files  (2) 2021.06.14
환경변수 값 읽어오기.  (0) 2021.04.05
[Spring Boot] log4jdbc 설정.  (1) 2020.01.16
반응형

dd
디스크의 읽기/쓰기 속도를 측정.

옵션
 - if : 입력파일, of : 출력파일, count : 반복횟수, bs : 블럭 사이즈(Bytes, 한번에 읽고 쓸 최대 바이트 크기)


쓰기.
$ dd if=/dev/zero of=testout count=1000 bs=1024k
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 1.49477 s, 701 MB/s

testout에 0x00값으로 1024kb를 1000번 반복. 1GB 파일생성.




읽기.

$ dd if=testout of=/dev/zero bs=1024
1024000+0 records in
1024000+0 records out
1048576000 bytes (1.0 GB) copied, 7.69626 s, 136 MB/s

testout 파일을 1024 바이트로 읽었을 때 속도는 136MB/s

반응형

'OS > Linux' 카테고리의 다른 글

방화벽 설정  (0) 2021.06.29
CentOS 7 에서 PHP7.4 설치하기.  (1) 2021.06.28
프로세스 thread 갯수 확인  (0) 2019.10.31
rpm 사용법  (0) 2019.05.09
[링크] 파일 권한  (0) 2019.05.09
반응형

Too many open files

java.io.IOException: Too many open files
Operation timed outerverSocketChannelImpl.accept0(Native Method)
    at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
    at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
    at io.netty.util.internal.SocketUtils$5.run(SocketUtils.java:119)
    at io.netty.util.internal.SocketUtils$5.run(SocketUtils.java:116)
    at java.security.AccessController.doPrivileged(Native Method)
    at io.netty.util.internal.SocketUtils.accept(SocketUtils.java:116)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:147)
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:75)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)


FD(File Descriptor/open files) 수가 부족한 경우 발생.

FD 사용 개수 확인.
$ lsof -p [PID] | wc -l
$ lsof -u [UID] | wc -l


Network connetion 개수 확인
$ netstat -an | wc -l

 

FD(File Descriptor/open files)
 - 프로세스가 가질 수 있는 소켓 포함 파일 개수
 - Java에서 소켓 통신(HTTP API, JDBC 커넥션 등)은 open file 옵션을 따라간다.


User Limit 확인
$ ulimit -aS


Hard Limit 확인
$ ulimit -aH


JDK 내부 코드상에서 Hard Limit 값이 soft limit에 update.
 - Java 프로세스는 Hard Limit 까지 file open 가능.


https://www.oracle.com/java/technologies/javase/vmoptions-jsp.html
$ java -XX:+PrintFlagsFinal -version | grep MaxFDLimit
     bool MaxFDLimit                                = true                                {product}
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

MaxFDLimit 옵션이 true일 경우 setrlimit 으로 limit을 증가.


Limit 설정.
$ vi /etc/security/limits.conf
계정명 soft nofile 40960
계정명 hard nofile 40960

보통 soft limit과 hard limit을 같은 값으로 설정한다.





Java에서 동시에 생성 가능한 쓰레드 수는 max user processes를 따라간다.

ps 명령어로 스레드 생성 개수를 확인(-L 옵션 : Show threads, possibly with LWP and NLWP columns.)
$ ps -efL | grep java | grep -v grep | wc -l
UID PID PPID LWP C NLWP STIME TTY TIME CMD

- PPID : 부모 프로세스 ID
- LWP : LWP(Light Weight Process, is thread). 쓰레드 ID
- C : CPU 사용율
- NLWP : LWP(Number Light Weight Process). 해당 프로세스에서 동작하고 있는 쓰레드 개수.
- STIME : 프로세스 시작 시간
- TIME : 총 CPU 사용 시간

반응형

'프로그래밍 > Java' 카테고리의 다른 글

java file.encoding  (0) 2022.07.12
[JAVA] java.lang.UnsatisfiedLinkError: no net in java.library.path  (1) 2021.06.25
환경변수 값 읽어오기.  (0) 2021.04.05
[Spring Boot] log4jdbc 설정.  (1) 2020.01.16
Rabbit MQ 간단 사용.  (0) 2018.12.21
반응형
반응형
반응형

OS / JVM 환경변구 값 읽어오기.

public static void main( String[] args ) {
                System.out.println("OS 환경변수 값");
                System.getenv().entrySet().forEach(e -> {
                        System.out.println("\t" + e.getKey() + "=" + e.getValue());
                });
                // export java_test_value="TEST VAL"
                System.out.println("OS 환경변수 java_test_value 값 = " + System.getenv("java_test_value"));


                System.out.println("");
                System.out.println("JVM 환경변수 값");
                Properties props = System.getProperties();
                for(Enumeration en = props.propertyNames(); en.hasMoreElements();) {
                        String key = (String)en.nextElement();
                        String value = props.getProperty(key);
                        System.out.println("\t" + key + "=" + value);
                }
                System.out.println("JVM 환경변수 user.name값 = " + System.getProperty("user.name"));
                System.out.println("JVM 환경변수 user.test값 = " + System.getProperty("user.test", "user.test property is null."));
}

 

반응형

'프로그래밍 > Java' 카테고리의 다른 글

[JAVA] java.lang.UnsatisfiedLinkError: no net in java.library.path  (1) 2021.06.25
Too many open files  (2) 2021.06.14
[Spring Boot] log4jdbc 설정.  (1) 2020.01.16
Rabbit MQ 간단 사용.  (0) 2018.12.21
singleton 객체.  (0) 2018.12.06
반응형

해결책 : www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

 

M2Eclipse | Execution Not Covered

M2Eclipse 0.12 and earlier executed some parts of Maven build lifecycle inside Eclipse and then configured the Eclipse project based on after-execution state collected in MavenProject. This was controlled by many different sets of maven goals – goals whe

www.eclipse.org

 

환경설정 -> Maven -> Lifecycle Mapping

- Open workspace lifecycle mapping metadata  클릭.

xml 내용 추가.

<lifecycleMappingMetadata>
	<pluginExecutions>

		<!--
        에러가 발생하는 플러그인 위치를 작성한다.
		plugin
		 - groupId : org.codehaus.mojo
		 - artifactId : buildnumber-maven-plugin 
		   - execution
		     - goal : create-timestamp
		-->
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<versionRange>[1.0.0,)</versionRange>
				<goals>
					<goal>create-timestamp</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<ignore />
			</action>
		</pluginExecution>
        
        ....
        
        <pluginExecution>
        ....
        </pluginExecution>
        
	</pluginExecutions>
</lifecycleMappingMetadata>

 

반응형

'프로그래밍' 카테고리의 다른 글

[git] error: src refspec master does not match any  (0) 2023.07.05
[JSTL] 조건식 eq, ne, empty  (0) 2016.12.07
인코딩  (0) 2014.03.24
[svn] 사용자 추가  (2) 2011.02.15
반응형

# 세션 레벨.(현재 세션 정보)
SELECT parameter, value FROM nls_session_parameters;
 - alter session set nls_XXX 로 변경 가능.

# 인스턴스 레벨.
SELECT PARAMETER, value FROM nls_instance_parameters;
 = SELECT name, VALUE FROM V$PARAMETER where name like '%nls%';

# DB 레벨.(설치시 정보 - 변경 불가)
SELECT parameter, value FROM nls_database_parameters;
= SELECT PARAMETER, VALUE FROM V$NLS_PARAMETERS;
= SELECT name, value$ FROM sys.props$ where name like '%NLS%';

set pagesize 30set linesize 300

column PARAMETER format a30
column VALUE format a30

column value$ format a30

반응형

'Database > Oracle' 카테고리의 다른 글

오라클 JOIN / ANSI JOIN  (0) 2022.02.03
JDBC 오류?? varchar 에 2000byte 이상 insert 하기.  (0) 2011.11.07
캐릭터셋 확인.  (0) 2011.10.20
오라클 구동 방법  (0) 2011.01.05
[Link] hierarchy query  (0) 2010.11.09
반응형

 

$ cd path/to/your/php/code

$ php -S localhost:8000

 

반응형

'프로그래밍 > PHP' 카테고리의 다른 글

이모지 제거.  (0) 2017.01.09
세션 관리. session id 가 계속 갱신되는 문제.  (0) 2016.03.10
[error] date_default_timezone_set()  (0) 2012.12.11
short_open_tag 설정.  (0) 2012.08.07
파일 업로드.  (0) 2012.07.11

+ Recent posts