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destroyuser ͺ̽ ڸ ߰ϰų ϴ ƿƼ̴. Ϸ PostgreSQL ̰ų ͺ̽ ڸ ߰ ־ Ѵ. $createuser linuxer ͺ̽ ߰ ڰ ͺ̽ ڸ ߰Ϸ Ѵٸ Ÿ ̴. $createuser linuxer ݱ α ũƮ̴. 캸 ˰ psql Ͽ templatel ͺ̽ , Ǿ ϰ ִ. ͺ̽ ڸ ߰ϴ ۾ SQL Ǿ ⺻ ΰ ִٴ ִ. pg_version ǿ뼺 α̴. Pg_version ڸ ־ ϸ ش 丮 PG_VERSION ̶ , . Pg_id õ ʴ α̴. ϸ ڽ شϴ uid Ѵ. /etc/passwd ° ϴ. Postmaster postmaster PostgreSQL μ̰,
postgres PostgreSQL 鿣 μ̴. ̵ α
ũ α, postmaster Ű postmaster
postgres Ѵ. postgres ٷ ,
postmaster Ѵ. ɾ : -B n_bufferw n_buffers postmaster backend μ Ҵϰ ̴. ⺻ 64̴. -D data_dir ͺ̽ 丮 Ʈ Ʈ 丮 Ѵ. 丮 PGDATA ȯ Ѵ. PGDATA Ǿ ʴٸ, Ǵ 丮 $POSTGRESQLHOME/data̴. ȯ ʾҰ, ̷ ɼǵ ʾҴٸ, ð ⺻ 丮 ̴. -S postmaster μ Ͽ ⵿ÿ ħ(?) ǵ Ѵ. ̰ () ttyʹ ڽ μ ⵿ ȴ. ɼ ɼǰ Բ µ, ǥ° ǥؿ ؼ ҵDZ ̴. -a system frontend α postmaster μ 'system' ý Ѵ. 'system' Ͽ ý ȿȭ ų ,'nosystem' Ͽ ý ִ. , ڷ Ͽ Kerberos ϵ Ϸ, '-a kerberos'ó ִ. ġ źϷ, '-a nounauth'ó ִ. -b backend_pathname backend_pathname, postmaster frontend α û , ȣ PostgreSQL backend డ ü θ̴. ɼ ʾҴٸ, postmaster డ postmaster ȣ 丮 ã ̴.( postmaster ȣ θ ã´ٴ ǹѴ. θ Ҵٸ, "postgres" Ҹ డ ã PATHȯ溯 Ѵ). -d [debug_level] debug_level ɼ ڴ backend Ѵ. Debug_level 1̶, postmaster Ʈ ̸, ܿ ƹ ϵ ʴ´. 2 ̻ ̶, ۾ backend μ ϰ ǰ, postmaster backend ȯ μ Ʈ Ѵ. Backend ʴ´ٸ, ̵ θ postmaster tty Ÿ ̴. -n , -s -s -n backend , postmaster ൿ ϴ ȴ. ɼ ۵ ʴ . ᰡ Ϲ , ٸ backend ˸, ٽ ʱȭ ϴ ̴. ̷ ϴ , ߸ backend ϱ , ¸ ߸ ֱ ̴. -s ɼ ȴٸ, postmaster ٸ backend SIGSTOPñ׳ ߵ ߰ ̴. ñ׳ μ ü Ű ̴. ̷ ϸ, ý αӴ backendκ ھ ִ. -n ɼ ȴٸ, postmaster ٽ ʱȭ ʴ´. -o backend_options postgres(unix) backend_options ɼ postmaster ⵿ backend μ ȴ. ɼ ߰ ڰ ٸ ο ȣ Ѵ. -p port Postmaster ų , ϴٸ SIGKILL
ʴ . $ps-ax|grep postmaster ٽ ѹ , postmaster ̱ ؼ
SIGKILL (Ǵ ñ׳ ȣ 9) ϰ Ǹ, postmaster
ҴǾ ִ ý ڿ
ϰ ȴ. $postmaster-S postmaster 1234Ʈ , ۸ 4ް(8K*512) Ҵϰ, ũ ij ѱ 鿣 ɼ '-F' ϰ ִ. ͺ̽ 丮 /usr/local/pgsql/data ϰ ִ. psql Ͽ postmaster Ϸ, psql -p 1234 ϰų, PGPORT ȯ溯 1234 Ͽ Ѵ. $postmaster-S p 1234-B 512-o-F-d/usr/local/pgsql/data postgres postgres [-B n_buffers] [-D data_directory]
[-E] {-F} postgres ɼǵ postmaster
ִ. Psql ȣ ִ. psql
Ʈ α̴. pg_passwd pg_passwd PostgreSQL йȣ
óϴ ̴. host all 127.0.0.1 255.255.255.255 trust ̰ ȣƮ ϴ ڸ ϴ ϰ, ͺ̽ Ѵٴ ̴. ڽ Ʈ ʴ ڵ ־ йȣ ɾΰ ʹٰ . ٸ ̰ ٲٸ ȴ. host all 127.0.0.1 255.255.255.255 password passwd ټ° 'password' 127.0.0.1( ȣƮ) ϴ ڿԴ ȣ ī Ѵٴ ̸̾߱, 'passwd' $PGDATA/passwd (, /usr/local/pgsql/data/passwd) йȣ Ϸ Ѵٴ ̴. , ý ü /etc/passwd йȣ Ϸ ȴٸ, PostgrreSQL ⺻ йȣ Ϸδ $PGDATA/passwd Ѵٴ ̴. pg_passwdα Ͽ PostgreSQL ִ. 丮 passwd.bk ȴ. $ cd/usr/local/pgsql/data ȣƮ ϴ linuxer ڴ йȣ Է ͺ̽ . $ psqlinux йȣ ԷϷ psql '-u' ɼ ϸ ȴ. $ psql -u linux ȣƮ ̷ йȣ ɾ ʿ ̴. ŷӱ⸸ ϴ. Ư ȣƮ ϴ 쿡 Ȯ ĥ ʿ䰡 ִٸ, pg_passwd ƿƼ ϸ ϴ.
4. ͺ̽ : pg_hba.conf PostreSQL pg_hba.conf ̴. PostgreSQL ۿ ֵ صδ . $ Is -l pg_hba.conf pg_hba.conf Ͽ ù° 'host'
ش ڵ Ÿ. #TYPE DATABASE IP_ADDRESS
MASK USERAUTH
MAP ʴ ȣƮ Ϸ ´. $psql-h free.world.co.kr linux psql -h ɼ ȣƮ ̸ ϴ ȴ. , ͺ̽ ý pg_hba.conf ڽ ȣƮ ֵ Ǿ ִٸ, ڽ ýۿ ͺ̽ ִ. [ddoch@han ddoch]$psql-h free.world.co.kr
mydb psql ڽ ýۿ ǰ, Էϴ Ǵ ȣƮ postmaster Ǿ ٽ ڽ ý ƿ ̴. , ̰ telnet ýۿ αϿ psql ϴ Ͱ , ٸ. ͺ̽ Ȱϸ, 溣̽ ϳ ͺ̽ ΰ, Ŭ̾Ʈ Ʈ α óν ۾ ó лŰ üȭ ִ ̴.
5. Kerberos ý κ ڴ ϸ
̴. , Ȼ ֿ ٷ 쿡
̰ε ϴ. Ǵ ü ȣȭǾ
ʿ伺 ִ. ̸ PostgreSQL kerberos ý
ϰ ִ. PostgreSQL ü Kerberos Ű
ʴ´. Kerberos ftp://authena-dist.mit.edu ְ,
ڼ ǻ info-kerberos@authena.mit.edu غ ٶ.
ϸƮ kerberos@athena.mit.edu ̰, kerberos-request@athena.mit.edu
ȴ. ȣ ʹ ͺ̽ Ȱ鿡 ַ ̿ ø PostgreSQL ó IJ ì ϴ α ߾ . ظ ٶ. |