Skip to content

Instantly share code, notes, and snippets.

View thegauravmahawar's full-sized avatar

Gaurav Mahawar thegauravmahawar

  • Indore, India
  • 22:39 (UTC +05:30)
View GitHub Profile
@thegauravmahawar
thegauravmahawar / mongodb-replica-set-ec2.txt
Created June 21, 2020 07:48
MongoDB Replica Set On EC2
Install Mongo with Replica set on EC2
1. Configure yum
touch /etc/yum.repos.d/mongodb-org-4.0.repo
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/4.0/x86_64/
gpgcheck=1
@thegauravmahawar
thegauravmahawar / elasticsearch-installation.txt
Created June 21, 2020 07:45
Elasticsearch Installation
Data: /usr/local/var/lib/elasticsearch/elasticsearch_gauravmahawar/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_gauravmahawar.log
Plugins: /usr/local/var/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/
To have launchd start elastic/tap/elasticsearch-full now and restart at login:
- brew services start elastic/tap/elasticsearch-full
Or, if you don't want/need a background service you can just run:
- elasticsearch
Mac installation:
brew install [email protected]
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
brew services start mongodb/brew/[email protected]
@thegauravmahawar
thegauravmahawar / nginx-installation.txt
Last active June 21, 2020 07:42
Nginx Installation
Mac Installation:
brew install nginx
brew services start nginx
- localhost:8080
- Port is 8080 to run without sudo
Folders:
@thegauravmahawar
thegauravmahawar / ec2-gc.sh
Last active June 21, 2020 07:41
AWS EC2 - GC Checks
yum whatprovides '*/jmap'
yum install java-1.8.0-openjdk-devel-1.8.0.232.b09-0.48.amzn1.x86_64
sudo debuginfo-install java-1.8.0-openjdk-devel
jmap -F -dump:live,format=b,file=/var/log/heapdump.bin pid
jmap -heap pid
gcore -o filename pid