No Image

mysql-5.7 Server Error Codes and Messages

2016-04-05 KENNETH 0

Server Error Codes and Messages MySQL programs have access to several types of error information when the server returns an error. For example, the mysql client program displays errors using the following format: shell> SELECT * FROM no_such_table; ERROR 1146 (42S02): Table ‘test.no_such_table’ doesn’t exist The message displayed contains three types of information: A numeric error code (1146). This number is MySQL-specific and is not portable to other database systems. A five-character SQLSTATE value (’42S02′). The values are taken from ANSI SQL and ODBC and are more standardized. Not all MySQL error numbers have corresponding SQLSTATE values. In these cases, ‘HY000’ (general error) is used. A message string that provides a textual description of the error. For error checking, use error codes, not error messages. Error messages do not change often, but it is possible. Also if the database administrator [ more… ]

No Image

keepalive + LVS on centos7

2016-03-31 KENNETH 0

개요   가상아이피 : 192.168.100.210 WEB1(real server) : 192.168.100.201 WEB2(real server) : 192.168.100.202 WEB서버에  keepalive+ipvsadm 패키지를 이용해서 LVS를 병행 구성 LVS구성시 real server 의 유효함을 판단 하는 방식 : URL HASH 체크 서버의 NIC 이름 : enp2s0f0 (서버마다 다를 수 있으므로 확인 할 것)   sysctl   sysctl의 net.ipv4.ip_forward = 1 상태여야함… echo “net.ipv4.ip_forward = 1” >> /etc/sysctl.conf sysctl -p   패키지 설치   yum install keepalived ipvsadm   URL HASH 값 구하기   genhash -s 192.168.100.201 -p 80 –url /lvs/lvs_check.php genhash -s 192.168.100.202 -p 80 –url /lvs/lvs_check.php 실행된 결과 값이 MD5SUM = 384dc7f45228c6ff3ecaa6cc8d15bccb MD5SUM = 384dc7f45228c6ff3ecaa6cc8d15bccb 대략 이렇게 나왔다고 가정하자   마스터 설정   /etc/keepalived/keepalived.conf global_defs { notification_email { } router_id LVS_DEVEL } vrrp_instance VI_1 { state MASTER interface enp2s0f0 virtual_router_id 200 priority 200 advert_int 1 authentication { auth_type PASS auth_pass ilayapass } virtual_ipaddress { 192.168.100.210 } } virtual_server 192.168.100.210 [ more… ]

No Image

/etc/sysconfig/iptables 에 포트 리다이렉션 추가해 주기

2016-03-24 KENNETH 0

지난번에 설명 했던 글에.. 하나를 빼먹어서.. 그냥 정리함.. ㅋㅋㅋ iptables port redirection 이것을 설명하면서 리부팅시에. 또는 iptables 를 재시작 할때.. 어떻게 고정 시키는지도 설명을 해줬으면 좋았겠다.. 하는 생각이 들어서 정리함… 뭐 그닥 중요하진 않음     설정 파일 : /etc/sysconfig/iptables *nat :PREROUTING ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A PREROUTING -p tcp -m tcp –dport 587 -j REDIRECT –to-ports 25 COMMIT   요렇게 추가로 등록을 해주면 됨…  

No Image

FortiGate configure manage ip on CLI

2016-03-15 KENNETH 0

Using the CLI to configure Transparent mode Start a terminal emulation program (HyperTerminal) on the management computer. Use these settings: Baud Rate (bps) : 9600 Data bits : 8 Parity : None Stop bits : 1 Flow Control : None At the Login: prompt, type admin and press Enter twice (no password required). Change from NAT/Route mode to Transparent mode. Configure the Management config system settings set opmode transparent set manageip <mng_ip>/<netmask> set gateway <gateway_ip> end Configure the dns config system dns set primary <dns-server_ip> set secondary <dns-server_ip> end  

No Image

firewalld 기반의 접근제어 사용하기

2016-03-15 KENNETH 1

환경 OS : CentOS-7 전통적인 iptables 를 기반으로 하지만.. firewalld 라는 패키지로 관리함… 그냥 iptables 를 사용하던가.. firewall-cmd 를 사용하던가.. 편한대로 사용하면 됨   설정파일 설정 경로 : /etc/firewalld firewall-cmd를 이용해서 일반적인 설정을 하게 되면 /etc/firewalld/zones/public.xml 에 저장됨… 설치후 별다른 추가 설정을 하지 않았다면 firewall-cmd –get-default-zone 명령어를 실행 한 결과는 ”public”으로 출력될 것이다.   기본 사용법 환경 : 터미널 기반 명령어 : firewall-cmd   조건 : 20,22,80포트(TCP)를 허용 룰 추가 firewall-cmd –add-port=21/tcp firewall-cmd –add-port=22/tcp firewall-cmd –add-port=80/tcp 룰 삭제 firewall-cmd –remove-port=21/tcp firewall-cmd –remove-port=22/tcp firewall-cmd –remove-port=80/tcp   조건 : 8000 ~ 9000 까지의 포트(TCP)를 허용 firewall-cmd –add-port=8000-9000/tcp firewall-cmd –remove-port=8000-9000/tcp   조건 : 192.168.0.0/255.255.255.0 대역을 허용 firewall-cmd –add-source=192.168.0.0/24 firewall-cmd –remove-source=192.168.0.0/24   조건 : 192.168.3.100 아이피를 허용 firewall-cmd –add-source=192.168.3.100 firewall-cmd –remove-source=192.168.3.100   조건 : 192.168.5.100 아이피를 차단 firewall-cmd –add-rich-rule=’rule family=”ipv4″ source address=192.168.5.100 reject’ firewall-cmd –remove-rich-rule=’rule family=”ipv4″ source address=192.168.5.100 reject’ firewall-cmd –add-rich-rule=’rule family=”ipv4″ source address=192.168.5.100 [ more… ]