RabbitMQ command doesn't exist? - macos

OS: Mac OSX 10.9
I have rabbitmq installed via home brew and when I go to /usr/local/sbin and run rabbitmq-server it states that: rabbitmq-server: command not found even as sudo it states the same error.
How do I get rabbitmq to start if it's not a command? I have also tried chmod +x rabbitmq-server in that directory to get it be an executable, same issue.

From the docs:
The RabbitMQ server scripts are installed into /usr/local/sbin. This is not automatically added to your path, so you may wish to add
PATH=$PATH:/usr/local/sbin to your .bash_profile or .profile. The server can then be started with rabbitmq-server.
All scripts run under your own user account. Sudo is not required.
You should be able to run /usr/local/sbin/rabbitmq-server or add it to your path to run it anywhere.
Your command failed because, by default, . is not on your $PATH. You went to the right directory (/usr/local/sbin) and wanted to run the rabbitmq-server that existed and had exec permissions, but by typing rabbitmq-server as a command Unix only searches for that command on your $PATH directories - which didn't include /usr/local/sbin.
What you wanted to do can be achieved by typing ./rabbitmq-server - say, execute the rabbitmq-server program that is in the current directory. That's analogous to running /usr/local/sbin/rabbitmq-server from everywhere - . represents your current directory, so it's the same as /usr/local/sbin in that context.

My OS: macOS Sierra 10.12.5
My RabbitMQ was installed using:
brew install rabbitmq
And it was installed into /usr/local/Cellar, just in case if someone has same situation with me, you would need to do similarly:
In terminal:
ls /usr/local/Cellar/rabbitmq/
to check which version you have installed, and then add to .bash_profile:
export PATH=/usr/local/Cellar/rabbitmq/<version>/sbin:$PATH

On mac by this command you can start,restart or stop rabbitmq
brew services start rabbitmq
brew services stop rabbitmq
brew services restart rabbitmq

As rabbitmq-server resides in /usr/local/sbin, running this command will enable starting server from anywhere:
export PATH=/usr/local/sbin:$PATH

I installed using home brew and I did the following:
brew install rabbitmq.
encountered issues cause the installation happened under bin and not /usr/local/sbin
So I did the following:
1. chown -R `whoami`:admin /usr/local/sbin
2. chown -R `whoami`:admin /usr/local/share
3. brew install rabbitmq
4. /usr/local/sbin/rabbitmq-server
And then the server runs and you can login to the management console :
http://localhost:15672/
userame: guest
password: guest

Start the service like this:
brew services start rabbitmq
Or if you don't need to start it as service:
/usr/local/sbin/rabbitmq-server

In my case the paths /usr/local/sbin/ nor /usr/local/Cellar/rabbitmq/ etc., did not work as Homebrew was putting these all together in a different location.
I opened Finder in my Mac and searched for rabbitmq-server in the search textbox on top right corner of the Finder window.
rabbitmq-server was located under the path below:
/Users/${USER}/homebrew/Cellar/rabbitmq/3.7.15/sbin
So in my ~/.bash_profile , I updated the PATH as below:
export PATH=$PATH:/Users/${USER}/homebrew/Cellar/rabbitmq/3.7.15/sbin
After source ~/.bash_profile
~ $ rabbitmq-server
## ##
## ## RabbitMQ 3.7.15. Copyright (C) 2007-2019 Pivotal Software, Inc.
########## Licensed under the MPL. See https://www.rabbitmq.com/
###### ##
########## Logs: /Users/santoshsindham/homebrew/var/log/rabbitmq/rabbit#localhost.log
/Users/santoshsindham/homebrew/var/log/rabbitmq/rabbit#localhost_upgrade.log
Starting broker...
completed with 6 plugins.

Just add this in your ~/.bash_profile
export PATH=$PATH:/usr/local/opt/rabbitmq/sbin

I installed using HomeBrew I added this to my bash profile
PATH=$PATH:/usr/local/Cellar
This worked for me

I have Mac OS version 10.13.6 installed. Somehow I did not have sbin directory present under /usr/local/. On carefully looking I found that for me the rabbitmq-server binary was present here /usr/local/Cellar/rabbitmq/3.7.9/sbin/rabbitmq-server.

i have read a wonderful article to fix that
simply open your bash_profile or .profile.
sudo nano ./bash_profile
in the begin of the file add PATH=$PATH:/usr/local/sbin, close and save, then write source ~/.bash_profile and lastly restart your terminal.
problem fix it!
http://www.andrewcranston.me/en/engineering/rabbitmq-and-path-variable/

Related

Unable to install ClickHouse in MacOS due to CANNOT_OPEN_FILE

While trying to install ClickHouse in a macOS Catalina, doing the following command:
➜ ~ curl -O 'https://builds.clickhouse.tech/master/macos/clickhouse' && chmod a+x ./clickhouse
After trying to execute sudo ./clickhouse install it will complain with the following message:
Copying ClickHouse binary to /usr/bin/clickhouse.new
Code: 76. DB::ErrnoException: Cannot open file /usr/bin/clickhouse.new, errno: 1, strerror: Operation not permitted. (CANNOT_OPEN_FILE) (version 21.10.1.7886 (official build))
Why is it failing even if I sudo the command? Are there any other commands required before trying to install ClickHouse?
/usr/bin is protected by Apple's SIP (System Integrity Protection) mechanism. You can install clickhouse into specific (not protected) directory by passing --binary-path flag. This way you won't have to disable SIP.
For example, on MacOS you can install into /usr/local/bin, which is not protected, by using this command: sudo ./clickhouse install --binary-path /usr/local/bin/.
This is a rootless (SIP) mechanism that Apple has added to the new version of the system. The basic purpose of SIP is to prevent programs from obtaining root privileges and modifying several key system directories. It can indeed play a certain protective role.
The main directories to be protected are:
/System
/usr
/bin
/sbin and preinstalled apps
Close the SIp in the kernel:
Restart the computer and press command+R until the Apple logo appears. At this time, you will enter Recovery Mode.
After selecting a language, enter recovery mode, find Utilities in the above menu, and find Terminal in it;
Open the terminal and enter the following command to close SIP;
You can bypass the problem by installing ClickHouse this way here: https://clickhouse.com/docs/en/quick-start/#1-start-clickhouse.
Try to use docker to install clickhouse server/client.
docker pull yandex/clickhouse-server
docker pull yandex/clickhouse-client
docker run -it --rm --link some-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server

Installing Glassfish, Wildfly using homebrew on Mac OSX

Trying to install Glassfish(Java EE App. Server) and Wildfly App Server using Homebrew .
http://macappstore.org/wildfly-as/
http://macappstore.org/glassfish/
used these above mentioned tutorials .
I got the following errors while trying to run them by typing just "glassfish" & "wildfly-as" respectively.
Output(Error):
-bash: glassfish: command not found
-bash: wildfly-as: command not found
Searched about it and I think it has something to do with $PATH. I don't understand $PATH Variable . Need help.
The issue is that there are two asadmin scripts. One at $GLASSFISH_HOME/bin and one at $GLASSFISH_HOME/glassfish/bin
Here are full instructions to get your domain up
brew update
brew install glassfish
you should see message, add that line to your .bash_profile
==> Caveats
You may want to add the following to your .bash_profile:
export GLASSFISH_HOME=/usr/local/opt/glassfish/libexec
Open a new terminal then, cd $GLASSFISH_HOME/glassfish/bin
./asadmin start-domain --verbose
Browse to http://localhost:8080 for welcome page and http://localhost:4848 for admin console
I actually installed Wildfly-Application Server using homebrew but could not find a way to run it.
https://tomylab.wordpress.com/2016/07/03/how-to-install-wildfly-on-mac/
This tutorial helped me .
And for glassfish, my installation was again successful using homebrew but was not able to run it . I did figure it out when I ran the following commands.
$ cd /usr/local/opt/glassfish/libexec/bin
$ ./asadmin
asadmin> start-domain
You need to understand about the PATH variable. It is an environment variable on Unix-like operating systems, specifying a set of directories in which executable programs are located. In general, each executing process, or user session, has its own PATH setting.
So, you need to add the glassfish home path to your actual path variable.
Now, as per your problem with running the Glassfish server; try this:
export GLASSFISH_HOME=/usr/local/opt/glassfish/libexec/
export PATH=$PATH:$GLASSFISH_HOME/bin
Add it to your bash profile, if you do not want to do this everytime.

Unable to set "mongod" PATH

I'm having issues trying to run mongod upon terminal start up.
OS
OSX 10.11.4
Steps so far:
Download OS X 10.7+ 64-bit
Uncompress mongodb-osx-x86_64-3.2.5.tgz
Rename mongodb-osx-x86_64-3.2.5 to mongodb
Moved /mongodb to [Desktop/development]
Add /data/db to Desktop/development/mongodb/bin
Changed permissions to /data/db using chmod 777 /data/db
Within Desktop/development/mongod/bin typing ./mongod everything is working as expected and I can access the the mongo shell. Now I would like to just be able to type mongod upon terminal startup and run both mongo and mongod
PATH for mongod
Open bash file vi ~/.bashrc
While in insert mode: export PATH=Desktop/development/mongodb/bin:$PATH I've also tried export PATH=$Home/Desktop/development/mongodb/bin:$PATH
What am I missing or doing wrong?
Thanks
EDIT
As per suggestions I've moved all the mongo files into a more appropriate locations.
Mongo location: $HOME/mongodb/bin
Mongo DB location: $HOME/mongoData
Data/db location: $HOME/mongoData/data/db
Bash command: export PATH=$HOME/mongodb/bin:$PATH
I'm thinking this is correct, but still unable to run mongod is there something missing in the bash command? Like mongo = PATH=...?
Desktop is actually $HOME/Desktop as it's in your home directory, so you need:
export PATH=$HOME/Desktop/development/mongodb/bin:$PATH
Desktop is not the place to put stuff as it's nothing much more than a convenience area that you can add to and remove from at a whim. It's also too visible as you will see the folder icons.
You should have installed all that stuff into your home directory (or /usr/local if you want it available to all users).
Also "Add /data/db to Desktop/development/mongodb/bin" doesn't look right to me as data and executables are different.
If I was adding mongodb for development then I would have installed it via Macports with:
$ sudo port install mongodb
and would be up and working in less than 2 minutes.

Service command on Mac OS X

I used to be able to execute on the Mac OS X (10.10.5) command line:
$ sudo service tomcat7 status
However, I must have accidentally deleted the package associated with service command and I am unable to find the name of the service package to reinstall. Any pointers would be greatly helpful.
I can't find service in either /sbin/ or /bin/ or /usr/sbin/
I think you need launchctl.
sudo launchctl load /Library/LaunchDaemons/org.apache.tomcat.plist
See https://www.joel.lopes-da-silva.com/2008/05/13/installing-tomcat-on-mac-os-x/
If you want to start mysql on OSX which is installed through brew, please use this command:
brew services start mysql#5.6
Update the mysql version based on the system mysql version.

I'm going CRAZY: ERROR: failed to load configuration file '/private/etc/php-fpm.conf' homebrew

I was able to successfully install php54 with fpm and with mysql onto my system. However, when I try to start the server by running php-fpm in terminal I get an error saying...
1.ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2)
2.ERROR: failed to load configuration file '/private/etc/php-fpm.conf'
3.ERROR: FPM initialization failed
However, my php-fpm.conf file is located in this directory: /usr/local/etc/php/5.4/php-fpm.conf. I'm not really sure what to do at this point. I'm going crazy and could use help out there. Can anyone point me in the right direction. I am running the latest version of Mountain Lion and have installed the latest command line tools.
The php-fpm binary expects php-fpm.conf file to read the configuration when it starts up. On Mac OSX by default this file is named as "/private/etc/php-fpm.conf.default" Change/copy it to "php-fpm.conf" from "php-fpm.conf.default"
cp /private/etc/php-fpm.conf.default /private/etc/php-fpm.conf
And then restart the service
you can start by brew if you installed by brew.
be sure closed php-fpm
sudo killall php-fpm
start by brew
brew services start php

Resources