리눅스 yum --skip-broken to work around the problem



yum update 가 disable 되어서 update 가 안되어 /etc/yum.repos.d/CentOS-Base.repo enable=0 을 1 로 변경하고 update 했더니


아래 처럼 에러 메시지가 나는 경우가 있네요~


# yum update

...

 You could try using --skip-broken to work around the problem

 You could try running: rpm -Va --nofiles --nodigest


이런경우엔 깨진걸 제외하고 update 하면 됩니다.


# yum --skip-broken update


'LINUX' 카테고리의 다른 글

CentOS 7.x GNOME GUI 설치  (0) 2017.08.17
CentOS 7.x xen yum install  (0) 2017.08.14
CentOS 7.x NFS 설정 방법  (0) 2017.07.30
리눅스 ISO-13346 UDF 이미지 마운트하기  (0) 2017.07.29
MySQL Max processes 늘이기  (0) 2017.07.20
블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

CentOS 7.x NFS 설정 방법

LINUX 2017. 7. 30. 00:27

CentOS 7.x NFS 설정 방법



NFS 설치 및 설정 방법입니다.



▶ nfs-utils 설치


# yum -y install nfs-utils

# systemctl enable nfs-server



▶ nfs 설정 ( vi /etc/exports )


/mnt/win7 *(ro,sync)


공유 하려는 폴더를 위의 내용 처럼 추가합니다.


* 에는 공유를 허용할 IP 를 지정할 수가 있습니다.

  예 : /mnt/win7 192.168.1.*(ro,sync)


ro : 읽기전용

rw : 읽기쓰기



▶ nfs-server 데몬 시작


# systemctl start nfs-server



▶ nfs 방화벽 허용


# firewall-cmd --permanent --zone=public --add-service=nfs

# firewall-cmd --reload



▶ nfs 서비스 확인


# showmount -e 도메인명


로컬인 경우는 도메인명을 제외하여도 됩니다.



▶ nfs 마운트


# mount -t nfs 192.168.1.2:/mnt/win7 /mnt/win7



▶ nfs 마운트 해제


# umount /mnt/win7



nfs 마운트는 가급적 데이터를 임시적으로 공유하거나 서버관리용으로 제한적인 사용은 괜찮으나,


여러대의 서버에 연결하여 웹서비스 같은 용도로는 사용하지 않는게 좋습니다.



블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

리눅스 ISO-13346 UDF 이미지 마운트하기



리눅스에서 ISO Image 마운트 하는 방법입니다.



# mount -t iso9660 -o loop /root/Win_x64_dvd.iso /mnt/win7

mount: /dev/loop1 is write-protected, mounting read-only

[root@vps mnt]# ls -l win7/

total 1

-r-xr-xr-x 1 root root 135 Nov 21  2010 readme.txt

[root@vps mnt]# cd win7/

[root@vps win7]# ll

total 1

-r-xr-xr-x 1 root root 135 Nov 21  2010 readme.txt

[root@vps win7]# cat readme.txt

This disc contains a "UDF" file system and requires an operating system

that supports the ISO-13346 "UDF" file system specification.


기존 방법으로는 마운트가 안되는군요~


아래 처럼 마운트를 시도합니다.


# mount -t udf /root/Win_x64_dvd.iso /mnt/win7

mount: /dev/loop1 is write-protected, mounting read-only


이제 정상적으로 마운트가 되었습니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

MySQL Max processes 늘이기



DB 운영중에 아래와 같은 에러가 발생할 때는 process 갯수의 제한 때문일 겁니다.


CentOS 6.x 버전은 default 값이 1024 이고 CentOS 7.x 버전은 4096 입니다.


하지만 하드웨어 사양에 따라 mysql 에서 사용할 수 있는 process 수는 달라지기도 합니다.


ERROR 1135 (HY000): Can't create a new thread (errno 11); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug



먼저 mysql 에서 할당된 프로세스수가 얼마인지 알아봅시다.


# ps aux | grep mysqld_safe | grep -v grep

root      3374  0.0  0.2 110268  1472 pts/0    S    10:35   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql


mysqld 의 pid 값을 먼저 찾습니다.


3374 이군요~


# cat /proc/3374/limits | grep processes

Max processes             1861                 1861                 processes


값을 늘여보도록 하겠습니다.


# vi /etc/security/limits.conf

*       -       nproc   4096

*       -       sigpending 4096


저장하고 재접속 하여야 합니다.


재접속 안하려면


# ulimit -u 4096

# ulimit -i 4096

명령어를 실행하면 됩니다.


이제 mysql 을 재시작 합니다.


# service mysqld restart


Max processes 값이 변경되었는지 위의 방법으로 확인하면 됩니다.



블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

MySQL query_cache_limit query_cache_size 튜닝



query_cache_list, query_cache_size, sort_buffer_size, read_rnd_buffer_size 에 대해서 알아보겠습니다.



아래는 phpMyAdmin 에서 제공하는 시스템 분석 문구입니다.



▶ query_cache_limit, query_cache_size


이슈:

쿼리 캐시의 80% 미만이 활용되고 있습니다.


추천:

This might be caused by query_cache_limit being too low. Flushing the query cache might help as well.


인증:

전체 쿼리 캐시 크기(Size)에서 남은 쿼리 캐시 메모리의 현재 비율은 10% 입니다. 80%보다 높아야 됩니다


사용된 변수 / 수식:

100 - Qcache_free_memory / query_cache_size * 100


추천에는 query_cache_limit 값이 너무 낮아서 그럴 수 있다고 하는군요~


query_cache_limit 디폴트 값이 1MB 인데 사용되는 쿼리에 따라 달라지므로 무조건 높인다고 좋은 건 아닌 것 같습니다.


대부분의 환경에서는 query_cache_limit 값을 올려 주면 비율은 올라갈 겁니다.


하지만 용량이 큰 쿼리결과 값이 채워지면 캐시되는 수가 전체적으로 줄어들게 됩니다.


그리고 query_cache_min_res_unit 의 default 값이 4096 인데 이 값을 줄여도 캐시 비율을 올릴 수 있습니다.


하지만 값을 너무 낮추게 되면 단편화가 심해질 것 입니다.



하루가 지나도 쿼리 캐시 비율이 10% 근처에 머물고 있다면 query_cache_size 가 너무 커서 그럴 수 있습니다.


이런 경우에는 query_cache_size 를 줄여서 확인이 필요합니다.



▶ sort_buffer_size, read_rnd_buffer_size


이슈:

너무 많은 정렬로 인해 임시 테이블의 사용이 발생합니다.


추천:

시스템의 메모리 한계값에 따라 sort_buffer_size 나 read_rnd_buffer_size 값을 증가시키세요


인증:

임시 테이블 평균: 22.33 시간당, 이 값은 시간당 1보다 작아야합니다.


사용된 변수 / 수식:

Sort_merge_passes / Uptime


테스트:

value * 60 * 60 > 1


상태 값에서 Sort_merge_passes 값을 모니터링 해서 값이 증가하면 sort_buffer_size 와 read_rnd_buffer_size 값을 증가시켜서 다시 확인을 합니다.


Sort_merge_passes 값이 변화가 없거나 아주 조금씩 증가하면 튜닝이 됐다고 보면 됩니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

LETSENCRYPT 인증서 갱신 renew parsefail



인증서가 만료가 다 되어 letsencrypt renew 를 했더니 아래처럼 에러가 나네요~


다른 서버에서 발급 받은 인증서를 옮긴 서버에 복사해서 사용해서 그런거 같기도 하네요. 


Additionally, the following renewal configuration files were invalid:

  /etc/letsencrypt/renewal/www.example.com.conf (parsefail)


아무튼 이런 경우엔 관련 파일을 다 지우고 다시 발급 받으면 되더군요~


# rm -rf /etc/letsencrypt/archive/www.example.com

# rm -rf /etc/letsencrypt/live/www.example.com

# rm -rf /etc/letsencrypt/renewal/www.example.com.conf


파일을 지운 다음에 다시 발급 받아 보세요.


CentOS 6.x 버전은


/root/letsencrypt/letsencrypt-auto certonly --standalone --agree-tos -m email@example.com -d www.example.com


CentOS 7.x 버전은


/usr/bin/letsencrypt certonly --standalone --agree-tos -m email@example.com -d www.example.com


인증서가 발급되었는지 확인해보세요.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

NGINX 다운로드 트래픽 제어



cband 모듈같은 상세한 속도를 제한하는 옵션은 없지만


아파치 2.4.x 에서 SetEnv rate-limit 500 과 같은 역할을 하는 기능입니다.


    location ~ /fast/(.+)\.mp3$ {

        limit_rate 500K;

    }


    location ~ /slow/(.+)\.mp3$ {

        limit_rate 200K;

    }


500K = 500KB/s 입니다. ( ex: 접속자별로 속도 제한 CBandRemoteSpeed 500Kb/s )


위의 설정은 디렉토리에 따라 속도를 분기하는 예제입니다.



아래는 일정 용량 이후에 트래픽을 제어하는 예제입니다.


limit_rate_after 100K;

limit_rate 500K;


초반에 100KByte 까지는 빠르다가 이 후에는 500KB/s 로 속도가 제어된다는 의미입니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

CentOS 6.x phpMyAdmin 4.0.x 설치



phpmyadmin 을 설치하는데 2.11.x 버전이 설치되는데 4.0.x 버전으로 설치하려면 아래 처럼 하면 됩니다.


# yum install phpmyadmin

...

================================================================================

 Package          Arch         Version                     Repository      Size

================================================================================

Installing:

 phpmyadmin       noarch       2.11.11.3-2.el6.rf          rpmforge       2.7 M


Transaction Summary

================================================================================

Install       1 Package(s)


이상하죠~~ OS 가 6.x 초반 부터 사용하다 계속 업데이트 되어 6.9 버전이 되었는데 phpmyadmin 을 4.x 버전으로 update 하려니 안되는군요~


# yum install phpMyAdmin

...

================================================================================

 Package                       Arch     Version                    Repository

                                                                           Size

================================================================================

Installing:

 phpMyAdmin                    noarch   4.0.10.19-1.el6            epel   4.2 M

Installing for dependencies:

 dejavu-fonts-common           noarch   2.33-1.el6                 base    63 k

 dejavu-sans-fonts             noarch   2.33-1.el6                 base   2.2 M

 libmcrypt                     x86_64   2.5.8-9.el6                epel    96 k

 libtidy                       x86_64   0.99.0-19.20070615.1.el6   base   127 k

 php-bcmath                    x86_64   5.3.3-49.el6               base    40 k

 php-fedora-autoloader         noarch   1.0.0-1.el6                epel   9.5 k

 php-mcrypt                    x86_64   5.3.3-5.el6                epel    19 k

 php-php-gettext               noarch   1.0.12-1.el6               epel    22 k

 php-process                   x86_64   5.3.3-49.el6               base    44 k

 php-tcpdf                     noarch   6.2.13-1.el6               epel   2.7 M

 php-tcpdf-dejavu-sans-fonts   noarch   6.2.13-1.el6               epel   315 k

 php-tidy                      x86_64   5.3.3-49.el6               base    41 k

 php-xml                       x86_64   5.3.3-49.el6               base   108 k


Transaction Summary

================================================================================

Install      14 Package(s)


phpmyadmin 대신에 phpMyAdmin 으로 대소문자 구분해서 설치하니 4.0.10.19 버전이 설치가 되는군요~


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

CentOS 6.x yum install phpmyadmin 설치에러



Apache + MySQL + PHP + phpMyAdmin 을 설치하는데 아래와 같은 에러가 나면서 설치가 안되는 경우가 있네요~


[root@c69 bin]# yum install phpmyadmin

...

--> Processing Conflict: php71u-common-7.1.6-1.ius.el6.x86_64 conflicts php-common < 7.1.6-1.ius.el6

--> Finished Dependency Resolution

Error: php71u-common conflicts with php-common-5.3.3-49.el6.x86_64

 You could try using --skip-broken to work around the problem

 You could try running: rpm -Va --nofiles --nodigest


yum clean all 을 해도 안되는군요~


epel-release 문제인가 싶어서 epel-release 를 삭제 했다가 재설치 하였습니다.


# yum remove epel-release

...

=====================================================================================================

 Package                  Arch               Version                     Repository             Size

=====================================================================================================

Removing:

 epel-release             noarch             6-8                         @extras                22 k

Removing for dependencies:

 ius-release              noarch             1.0-15.ius.el6              installed             8.4 k


Transaction Summary

=====================================================================================================

Remove        2 Package(s)


# yum install epel-release

...

=====================================================================================================

 Package                     Arch                  Version               Repository             Size

=====================================================================================================

Installing:

 epel-release                noarch                6-8                   extras                 14 k


Transaction Summary

=====================================================================================================

Install       1 Package(s)


삭제할 때와 재설치 할때 설치되는 패키지가 다른걸 보니 ius-release 가 문제였던거 같네요~


이제 phpmyadmin 을 설치하니 잘 됩니다.


'LINUX' 카테고리의 다른 글

NGINX 다운로드 트래픽 제어  (0) 2017.07.07
CentOS 6.x phpMyAdmin 4.0.x 설치  (0) 2017.07.06
NGINX 프록시 사용시 REMOTE_ADDR 문제  (0) 2017.07.05
NGINX Service Unavailable  (0) 2017.07.05
MariaDB open_files_limit 값 변경하기  (0) 2017.07.05
블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,

NGINX 프록시 사용시 REMOTE_ADDR 문제



Apache => Apache 사용시 또는 Apache => Nginx 사용시 PHP에서 $_SERVER['REMOTE_ADDR'] 값이 127.0.0.1 로 나오게 됩니다.


<VirtualHost www.example.com:80>

    ServerName www.example.com

    DocumentRoot /var/www/html

    ErrorLog logs/www.example.com-error_log

    CustomLog logs/www.example.com-access_log common

    ProxyPass / http://localhost:8080/

    ProxyPassReverse / http://localhost:8080/

</VirtualHost>



위에 처럼 아파치가 설정된 경우에는 /etc/php.ini 에 설정을 따로 해주어야 합니다.


auto_prepend_file = /etc/prepend.php


auto_prepend_file = 이 부분을 찾아서 /etc/prepend.php 를 추가하고 저장합니다.



/etc/prepend.php 생성


<?php

if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {

        $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];

}

?>



모듈 재시작


아파치 + 아파치 : # systemctl restart httpd


아파치 + 엔진엑스 : # systemctl restart php-fpm



이제 확인해보세요~


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,