11/01/2560

Graylog (Mongo DB Part )

ส่วนนี้จะเป็นการ ติดตั้ง MongoDb สำหรับใช้ในการเก็บฐานข้อมูล  ให้สร้างไฟล์หรือแก้ไข ใน  yum.repos.d
nano  /etc/yum.repos.d/mongodb-org-3.0.repo
แล้ว config หรือเพิ่ม ตามรายละเอียดด้านล่าง
[mongodb-org-3.0]
name=MongoDB Repository
baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
gpgcheck=0
enabled=1
หลังจากเสร็จสิ้น ให้ Save และให้ทำการ Install Package MongoDb โดยใช้คำสั่ง yum
# yum -y install mongodb-org
หลังจากนั้น ให้พิม command ตามรายละเอียดด้านล่าง เพื่อให้ SElinux Allow Mongodb
# semanage port -a -t mongod_port_t -p tcp 27017
แต่ถ้ากรณีไม่ต้องการตั้งค่านี้เพื่อให้ MongoDb สามารถ start ได้เลย ให้ทำการ Disable SElinx
# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=permissive ////ให้เปลี่ยนเป็น disabled# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0
save จากนั้นให้ทำการ start mongodb ขึ้นมา 
# service mongodb start # chkconfig mongod on

ไม่มีความคิดเห็น:

แสดงความคิดเห็น