How to Create a configuration File For MongoDB - macos

I have installed mongodb for mac os through 10gen and I have gone through the documentation to do so. Everything seems fine apart from the configuration file. I can not see it in /etc/mongod.config. Do I have to manually create this config file? And if so how can I go about it?
cheers

The default path for brew installed mongodb on Mac OS X is /usr/local/etc/mongod.conf

Unless you have installed a packaged version of MongoDB (for example, using Homebrew or Mac Ports) you will have to create a config file manually, or just pass the appropriate command line parameters when starting up MongoDB.
If you want a commented example of a config file to start with, the mongodb.conf in the Debian/Ubuntu package should be a good starting point. Important options to check are the dbpath and logpath which will likely be different for you.
It would also be worth looking at the Homebrew mongodb formula which includes setting up a LaunchAgent script to manage the mongod service.

Yes, unless you install via a package manager (like apt or yum on Linux) you have to create this manually. Then, When you start mongod you simply need to specify where the config file is, for example:
./mongod -f /path/to/mongod.conf
For how that file should look, just take a look here:
http://docs.mongodb.org/manual/reference/configuration-options/
You can also see the aforementioned Linux config files from the packages on github:
https://github.com/mongodb/mongo/blob/master/rpm/mongod.conf
https://github.com/mongodb/mongo/blob/master/debian/mongodb.conf

In the case you installed MongoDB without Homebrew, i.e. downloaded the TGZ package directly from MongoDB Download Center, you will can add the configuration file:
sudo nano /etc/mongod.conf
Please use only spaces (no tabs) in the file and leave a space after the key. For example:
security:
authorization: enabled
net:
port: 27017
bindIp: 0.0.0.0
And then run the instance with the configuration flag:
mongod -f /etc/mongod.conf
I wrote a post about installing MongoDB Community Edition directly from the TGZ archive.

Related

Unable to install kafka globally on my machine

Followed below mentioned steps to install kafka
Installed Apache kafka from kafke.apache.org
Have java8 already installed on my mac machine
Extracted kafka
Able to do cd kafka_2.13-2.7.0 and bin/kafka-topics.sh
But when I'm adding kafka in the bash_profiles then kafka is not added globally
nano ~/.bash_profiles
export PATH="$PATH:/mydirectorypath/Kafka_2.13-2.7.0/bin"
But when i'm trying to use kafka globally it doesn't work.
I'm new to mac and kafka both so I'm not sure what I'm doing wrong is it the correct way to add paths in mac since in the first place i couldn't find existing bash_profiles using cat ~/.bash_profile
But after creating the one using nano ~ /.bash_profile i can see the content.
If i'm trying to do
Kafka-
It says zsh:command not found:kafka-
:is it the correct way to add paths in mac since in the first place i couldn't find existing bash_profiles
That export command is the correct way to set the path, however, according to the error, you're using ZSH, which does not use .bash* files. You'd need to edit .zshrc or change your default terminal back to Bash. You'd also need to start a new terminal after editing those files
To verify the PATH works, you'd do which kafka-topics
If you want to install Kafka on a Mac, just do brew install kafka. Then to run a broker, you can use brew services command with Zookeeper and Kafka to start/stop the servers, and your PATH will already have all the shell scripts - https://brew.sh
Note: The above are all local variables to your user account. Globally would imply the commands are available to any user logged in to your machine

Changing default port for Jenkins doesn't work (MAC)

I tried a lot of ways to do it, but no one helped.
I installed Jenkins with homebrew.
Run it by the command:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
I tried:
sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 9999
But there is no file 'org.jenkins-ci'. So I created and tried again this command... Restart Jenkins... Didn't help!
I think the Jenkins installed by homebrew has its options in:
~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
so you would need to edit that and the relaunch. Note that, if you can't see your Library directory inside your Home directory in the Finder, you can type Cmd+Shift+G and type ~/Library.

Does reinstalling Macports remove/destroy contents of /opt/local/ directory structure?

I'm running a MacPro G5 w/ 10.5.8. I ran:
sudo port selfupdate and then ran:
sudo port upgrade outdated
When it was all finished, I rebooted and apache2 was broken and would not serve PHP file any longer. If I replace the httpd.conf file, it will serve html files.
I finally gave up and restored the backup and the machine is running again. The problem is I have a second machine that I did the same thing on and don't want to go through the same process. I've read several posts about uninstalling/reinstalling Macports like this one from Kirk Roybal How to do a clean reinstall with macports?, but it doesn't say if this process will destroy or reset the contents of the /opt/local/ directory. Especially the MySQL DBs and htdocs contents. Does anyone know if this process is linked or destructive? I'll make backups of everything, of course, before trying anything.
SOLUTION:
I got it to work by making the php53 install work instead of going backwards. Here's what I did:
sudo port select --set php php53 (set MacPorts to use php53 instead of php5)
sudo port installed (Check to make sure php53-apache2handler is installed)
sudo port install php53-apache2handler (It wasn't and yours probably isn't either)
once that's done installing
php -v (check the version of PHP that's running)
cd /opt/local/apache2/modules
sudo /opt/local/apache2/bin/apxs -a -e -n php mod_php53.so (activates php within apache)
this should append
LoadModule php5_module modules/mod_php53.so
to your /opt/local/apache2/conf/httpd.conf file (check it now)
There will also be a line like this
LoadModule php5_module modules/mod_php5.so
Comment it out or remove it so is doesn't interfere with new install
It should also move a copy of mod_php53.so to
/opt/local/apache2/modules
If it's not there, see php53-apache2handler install above.
Check your httpd.conf file for errors
/opt/local/apache2/bin/httpd -S
Finally, create/edit php.ini file to tell apache2 how to connect to MySQL database
cd /opt/local/etc/php53
sudo cp php.ini-production php.ini (for production machine use development for dev machine)
sudo cp php.ini php.ini.bak
Add the default socket paths to php.ini
pdo_mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock (may vary based on MySQL version. Check the /opt/local/var/run directory if not sure)
mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock
mysqli.default_socket=/opt/local/var/run/mysql5/mysqld.sock
If you are having problems connecting to MySQL, check for typos in the above paths FIRST. Trust me it will save you tons of time!
If all went according to plan, you should be able to restart the machine, test to make sure all ports started automatically and things should be working.
The files that you add (eg: MySQL DBs) are not destroyed by an update. If you modify files that are managed by MacPorts (eg: they are listed in 'port contents '), then those modifications will be clobbered by an update.
Some projects install config files as examples and have the user make the real config file so as to not clobber it with an update. It looks like the apache2 port follows this pattern. It installs /opt/local/apache2/conf/original/httpd.conf and then copies it to the real location of /opt/local/apache2/conf/httpd.conf at activation time only if the file does not exist.

Setup local LDAP server in mac OSX

I've followed this (https://github.com/IntersectAustralia/acdata/wiki/Setting-up-OpenLDAP) tutorial for set up LDAP server in my local machine.
I've done all these steps
Installed Homebrew
Installed openldap using brew command, including berkeley db
Updated the slapd.conf file
Started the server using command "sudo /usr/local/libexec/slapd"
Now how do i know the LDAP server is running?
I tried a lot but i could'nt succeed,later i deiced to go with ADS (http://directory.apache.org/studio/). Its easy to set up. Believe me i made the installation and configuration in 5 mins. Thank you apache.
Use -d3 suffix.
Run sudo /usr/libexec/slapd -d3, it will show you the details.

Installing MULE ESB mule-standalone-3.3.1

Can some guide me .. for installing Mule ESB(mule-standalone-3.3.1) in Ubuntu . I am unable to find any documentation for installing. i want to automate it through Chef.
It's can be as simple as downloading and unpacking the archive file from: http://dist.codehaus.org/mule/distributions/mule-standalone-3.3.1.zip
Note: You need jdk 6/7 installed first.
Here's a chef cookbook that does this: https://github.com/ryandcarter/mule-cookbook
And here's a Vagrant script for running the mule cookbook on ubuntu etc: https://github.com/ryandcarter/vagrant-mule
It is very simple.
Download and unpacking the archive file from: http://dist.codehaus.org/mule/distributions/mule-standalone-3.3.1.zip or whatever version you want to install.
put this unpack file to anywhere where you want like /opt/ or /usr/local/
put you mule application inside apps folder.
& go to bin directory and run ./mule start command. Now mule server is running. You can also check mule log inside log folder mule.log file
This is an old question, but in case there are others who are looking.
You want to install Mule as a Ubuntu Service, so that it restarts when The server restarts. There are a couple of basic steps to this
I detailed out instructions and installation files at my github repository
https://github.com/jamesontriplett/mule_linux_service_install
Steps in general:
Install a startup script in /etc/init.d
Install a startup parameter file in /etc/mule
Customize parameters in the wrapper.conf file in /conf/wrapper.conf
Install the license file onto the server if using enterprise
Add the startup script to the run levels.
To test, you want to reboot the linux service to make sure that it will come back after a reboot. If it doesn't you have a reliability issue.

Resources