Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
237 views5 pages

MongoDB, Elasticsearch, Graylog Setup

The document provides steps to install MongoDB, Elasticsearch, and Graylog on an Ubuntu system. It includes downloading necessary packages, configuring services, and verifying successful installations. Key steps are adding MongoDB and Elastic repositories, configuring MongoDB and Elasticsearch configuration files, enabling and starting the services, and verifying they are active and reachable on their default ports.

Uploaded by

raghda amami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
237 views5 pages

MongoDB, Elasticsearch, Graylog Setup

The document provides steps to install MongoDB, Elasticsearch, and Graylog on an Ubuntu system. It includes downloading necessary packages, configuring services, and verifying successful installations. Key steps are adding MongoDB and Elastic repositories, configuring MongoDB and Elasticsearch configuration files, enabling and starting the services, and verifying they are active and reachable on their default ports.

Uploaded by

raghda amami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1 install mongo db

https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/
# wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -

wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -


Create a list file for MongoDB.
# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-
org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

Reload local package database.


Issue the following command to reload the local package database:

# sudo apt-get update


Install the MongoDB packages.
# sudo apt-get install -y mongodb-org
ป้องกันการ update version
# echo "mongodb-org hold" | sudo dpkg --set-selections
#echo "mongodb-org-database hold" | sudo dpkg --set-selections
#echo "mongodb-org-server hold" | sudo dpkg --set-selections
#echo "mongodb-mongosh hold" | sudo dpkg --set-selections
#echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
#echo "mongodb-org-tools hold" | sudo dpkg --set-selections

Start service
# sudo systemctl start mongod
# sudo systemctl status mongod

# sudo systemctl enable mongod


2 ***installe elastic7 v.8 ใช้ไม่ได้
# wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
# echo "deb https://artifacts.elastic.co/packages/oss-7.x/apt stable main" | sudo tee -a
/etc/apt/sources.list.d/elastic-7.x.list
# sudo apt update && sudo apt install elasticsearch-oss -y

3 Edit config
# nano /etc/elasticsearch/elasticsearch.yml

เพิมเข้าไป
action.auto_create_index: false

Save and exit


4 Start service
# sudo systemctl enable elasticsearch && sudo systemctl restart elasticsearch

# sudo systemctl --type=service --state=active | grep elasticsearch

# sudo netstat -tulpn | grep 9200

ใช้ไม่ได้ ต้องติดตังโปรแกรมเพิมเติม
# apt install net-tools
# sudo netstat -tulpn | grep 9200

# curl -X GET http://localhost:9200

5 ***install graylog
https://go2docs.graylog.org/5-
0/downloading_and_installing_graylog/ubuntu_installation.html?tocpath=Downloading%20an
d%20Installing%20Graylog%7CInstalling%20Graylog%7C_____3

# wget https://packages.graylog2.org/repo/packages/graylog-5.0-repository_latest.deb
# sudo dpkg -i graylog-5.0-repository_latest.deb
# sudo apt-get update && sudo apt-get install graylog-server

***To create your root_password_sha2, run the following command:


#echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
ตังรหัส
Copy ค่านีไว้
root_password_sha2=

ff7bd97b1a7789ddd2775122fd6817f3173672da9f802ceec57f284325bf589f

***To generate a password_secret:


#apt install pwgen
# pwgen -N 1 -s 96

Copy code

password_secret=

VmFd5ouKOKHt6x7G8dJ4c0Fst6tPipwkWsaNc0fsbzwc2QPCPQd6Pi8Sxg4zdIZwcs2goeQRjNpW
O1q3bQdjCxBDwGpn02sp

Edit config
# sudo nano /etc/graylog/server/server.conf

# http_bind_address = 0.0.0.0:9000

Edit time zone


# sudo systemctl enable graylog-server && sudo systemctl start graylog-server
# sudo tail -f /var/log/graylog-server/server.log | grep "Graylog server up and running"
# sudo systemctl --type=service --state=active | grep graylog

# sudo netstat -tulpn | grep 9000

# curl http://127.0.0.1:9000

https://www.facebook.com/watcharin.itk

You might also like