2016년 7월 23일 토요일

Ubuntu 에서 IPv6 비활성화 (Disable IPv6 on Ubuntu)

* 현재 IPv6 의 활성화 여부 확인하기
$ sudo cat /proc/sys/net/ipv6/conf/all/disable_ipv6

0: 활성화
1: 비활성화

* IPv6 비활성화 하기

1. sysctl.conf 파일 열어 수정하기
$  vi /etc/sysctl.conf
아래 내용 추가하기
# Disable ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

2. sysctl.conf 파일 리로드 하기
$  sudo sysctl -p

3. 정상적용 되었는지 확인하기
$ sudo cat /proc/sys/net/ipv6/conf/all/disable_ipv6
하면 이전과 달리 0 이 아닌 1 이 나옴을 알 수 있다.


 

2015년 6월 15일 월요일

Install X-Windows on CentOS

yum grouplist

yum -y groupinstall "Desktop" "Desktop Platform" "X Windows System" "Fonts"


2015년 5월 29일 금요일

ubunt 14.04 에서 NTFS mount 하기

* read only 로 마운트 하기
Majority of current Linux distributions supports NTFS file system out of the box. To be more specific, support for NTFS file system is more feature of Linux kernel modules rather than Linux distributions. First verify if we have NTFS modules installed on our system.

- 커널이 ntfs read 마운트를 지원하는지 알아보기

 sudo ls /lib/modules/3.13.0-24-generic/kernel/fs/ | grep ntfs

fdisk -l | grep NTFS

mkdir /mnt/ntfs

mount -t ntfs /dev/sdb1 /mnt/ntfs


2015년 4월 28일 화요일

PPAS(Postgres Plus Advanced Server) HA 구성 with Corosync, Pacemaker, DRBD - step 6

* Pacemaker 설정(방법 2)

* Configuring Stonith

* Disable Stonith (node 1)
crm configure property stonith-enabled=false

* checking the cluster configuration, we should get no errors:
crm_verify -L

* Cluster General Configuration

* Configuring quorum to 2 nodes. For more information, look at pacemaker configuration.
crm configure property no-quorum-policy=ignore

crm configure rsc_defaults resource-stickiness=100

crm configure show

* Configuring DBIP
crm configure primitive DBIP ocf:heartbeat:IPaddr2 params ip=192.168.21.160 cidr_netmask=24 op monitor interval=30s

* Configuring DRBD on Cluster
crm configure primitive drbd_postgres ocf:linbit:drbd params drbd_resource="postgres" op monitor interval="15s"

crm configure ms ms_drbd_postgres drbd_postgres meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"

crm configure primitive postgres_fs ocf:heartbeat:Filesystem params device="/dev/drbd0" directory="/var/lib/pgsql" fstype="ext4"

* Configuring PostgreSQL on Cluster
crm configure primitive postgresql ocf:heartbeat:pgsql op monitor depth="0" timeout="30" interval="30"
-> 이건 PostgreSQL 용이고 PPAS 용으로 아래와 같이 해야 될 것 같음
crm configure primitive postgresql ocf:heartbeat:pgsql params \
 pgctl=/opt/PostgresPlus/9.4AS/bin/pg_ctl \
 psql=/opt/PostgresPlus/9.4AS/bin/psql \
 pgdata=/var/lib/pgsql/data pgdba=enterprisedb pgport=5444 pgdb=edb \
 op monitor depth="0" timeout="30" interval="10" \
 op start timeout=120 interval=0 \
 op stop timeout=120 interval=0
(위 파라미터에서 ocf:heartbeat:pgsql 로 한다는 것은 실제 /usr/lib/ocf/resource.d/heartbeat/pgsql 의 설정값을 사용한다는 것이므로 실제 양쪽 노드에서 파일을 열어 값이 정상인지 확인한다)
아마 아래 6줄과 같이 변경해야 할 것이다.
OCF_RESKEY_pgctl_default=/opt/PostgresPlus/9.4AS/bin/pg_ctl
OCF_RESKEY_psql_default=/opt/PostgresPlus/9.4AS/bin//psql
OCF_RESKEY_pgdata_default=/var/lib/pgsql/data
OCF_RESKEY_pgdba_default=enterprisedb
OCF_RESKEY_pghost_default=""
OCF_RESKEY_pgport_default=5444

crm configure group postgres postgres_fs DBIP postgresql

crm configure coasdflocation postgres_on_drbd inf: postgres ms_drbd_postgres:Master

crm configure order postgres_after_drbd inf: ms_drbd_postgres:promote postgres:start

crm configure show

* Setting the Preferential Node
crm configure location master-prefer-node1 DBIP 50: cos1.local

* Cluster managment

* Acessing from network
echo "host all all 192.168.21.0/24 md5">> /var/lib/pgsql/data/pg_hba.conf

* restart postgres to reload configuration:
crm resource stop postgresql
crm resource start postgresql

* 문제가 있어 postgresql resource 지우고 아래 명령어로 다시 세팅
crm configure primitive postgresql ocf:heartbeat:pgsql params \
 pgctl=/opt/PostgresPlus/9.4AS/bin/pg_ctl \
 psql=/opt/PostgresPlus/9.4AS/bin/psql \
 pgdata=/var/lib/ppas/data pgdba=enterprisedb pgport=5444 pgdb=edb \
 op monitor depth="0" timeout="30" interval="10" \
 op start timeout=120 interval=0 \
 op stop timeout=120 interval=0

* # crm resource cleanup [resource 명]
(한쪽 노드에서 실행해도 모든 노드에 적용되지만 잘 안 될 경우 모든 노드에서 명령어 실행)

* cat /proc/drbd 해서 primary/unknown 으로 나오는 경우 아래와 같이 한다.
On primary node
    drbdadm connect all
On secondary node
    drbdadm -- --discard-my-data connect all

Should work