Wednesday, 1 February 2017

[Maria/MySQL] ost 'x.x.x.x' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

I can't connect MariaDB in particular server using JDBC driver. When I try to connect db, error message than says "ost 'x.x.x.x' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" occurs.




It is related with database configuration. (max_connect_errors)

If a particular host make too many connect errors that exceeds allowed max_connect_errors count, database server consider this connection as hacking or inavlid connection. So, the server prevent connections from that host.


[Solution]

1. Initialize count

#> mysqladmin -uroot -p flush-hosts


2. Change max connect errors count

- in running


#> mysql -uroot -p




SET GLOBAL max_connect_errors=[COUNT];




- modify configuration file

#> vi /etc/my.conf

[CentOS7] NTP 서버 설정

* NTP : Network Time Protocol


1. Install NTP package

#> yum -y install ntp




2. Configure NTP environment

#> vi /etc/ntp.conf






3. Startup NTP daemon and register system start process daemon

# below CentOS 7
#> service ntpd start
#> chkconfig ntpd on

# in CentOS 7
#> systemctl start ntpd
#> systemctl enable ntpd




4. Check process

#> ntpq -p




Tuesday, 24 January 2017

[Maria/MySQL] Trigger If statement example

CREATE TRIGGER TRIGGER_TB_IOT_USER_01
    AFTER INSERT ON iot.TB_IOT_USER
    FOR EACH ROW
        BEGIN
            IF NEW.AUTH_CD = 'A' THEN
               INSERT INTO iot.TB_IOT_MCU_GROUP (MCU_GRP_NM, MCU_GRP_DESC, DEFAULT_YN, USER_ID, CREATED_DT, CREATED_NM, UPDATED_DT, UPDATED_NM) VALUES ('기본그룹', '기본그룹', 'Y', NEW.USER_ID, now(), NEW.USER_ID, now(), NEW.USER_ID);
            END IF;   
        END;

Monday, 23 January 2017

[CentOS7] How to disable IPv6 in CentOS7 (CentOS7 IPv6 비활성화)

I ran UDP socket program using 61000 port. But, only IPv6 socket was activating.


How to disable IPv6?


1. Add options in sysctl.conf

#> vi /etc/sysctl.conf



# for diable ipv6
net.ipv6.conf.all.disable_ipv6 = 1

# for diable paricular adapter
#net.ipv6.conf.eth0.disable_ipv6 = 1








2. Apply options

#> sysctl -p




3. Restart Socket program

Thursday, 19 January 2017

[RaspberryPi] Can't connect using remote desktop (원격접속 에러 해결방법)


Error Message




Solution

1) Connect ssh terminal and remove xrdp

$> sudo apt-get remove xrdp




2) Install tightvncserver

$> sudo apt-get install tightvncserver




3) Re-install xrdp

$> sudo apt-get install xrdp




4) Connect raspberrypi by remote desktop









[CentOS] Create new VG(Volume Group) (새로운 VG 생성)

1. Attach Physical Hard Disk (하드디스크 장착)


2. Partitioning Disk

#> fdisk -l
#> fdisk [DEVICE_PATH]








- Create partition




- Select partition type





3. Create physical volumn (PV 생성)

#> fdisk -l
#> pvcreate [DEVICE_PATH]
















4. Create Volume Group

If you want to create new volume group, create volume group

#> vgcreate [VG_NAME] [PV_NAME]



5. Create Logical Volume

#> lvcreate -l [PE_SIZE] [LV_NAME] [VG_NAME]


6. Make filesytem

#> mkfs.ext4 [LV_PATH]


7. Mount LV

#> mount -t [TYPE] [LV_PATH] [MOUNT_PATH]


8. Register in file system table

#> vi /etc/fstab

/dev/extvg1/extlv1 /home ext4 defaults 0 0


[CentOS] Extend Volume Group and Logical Volume (VG 볼륨그룹 LV 확장하는 법)

1. Attach Physical Hard Disk (하드디스크 장착)


2. Partitioning Disk

#> fdisk -l
#> fdisk [DEVICE_PATH]








- Create partition




- Select partition type





3. Create physical volumn (PV 생성)

#> fdisk -l
#> pvcreate [DEVICE_PATH]
















4. Extends Volumn Group

#> vgdisplay
#> vgetend [VG_NAME] [PV_NAME]




5. Extends Logical Volume

#> lvdisplay
#> lvextend -l [PE_SIZE] [LV_PATH]




6. Apply extension

#> xfs_growfs [LV_PATH]

[XenServer] Install Xenserver Tools

1. Click Install Xenserver tools in Xen Center



2. Click Install Button

 


3. Mount quest tool cdrom

#> mount /dev/cdrom /mnt



4. Install quest tool


#> sh /mnt/Linux/install.sh

[RaspberryPi] Install OS (라즈베리파이 OS 설치)

1. Download OS Image


https://www.raspberrypi.org/downloads 






2. Download Disk Imager and install

https://sourceforge.net/projects/win32diskimager/



3. Write OS image in SD card





Tuesday, 10 January 2017

[CentOS] Disable iptables in CentOS 6.x (방화벽 비활성화)

1. Disable iptables (방화벽 비활성화)

#> service iptables stop


2. Disable iptables when restart system (시스템 재가동 시 방화벽 비활성화)

#> chkconfig ipchains off