I. rabbitmq usage scenario, used for time notification and logging with microservices
II. rabbitmq installation erlang
1. rabbitmq is written in erlang language. Before installing rabbitmq, you need to install erlang first. Here, you use the source code of erlang for installation. The download address of erlang installation package is on the official website: http://erlang.org/download/
wget http://erlang.org/download/otp_src_21.1.tar.gz tar -zxvf otp_src_21.1.tar.gz cd otp_src_21.1 # You need to create a new erlang folder here, because erlang compilation and installation are installed in bin and lib under / usr/local by default. Here, we will install it in / usr/local/erlang for easy search and use. mkdir -p /usr/local/erlang # Before compilation, the following dependency packages must be installed. If java is already installed, just remove java devel yum install -y make gcc gcc-c++ m4 openssl openssl-devel ncurses-devel unixODBC unixODBC-devel java java-devel ./configure --prefix=/usr/local/erlang # Entry directory cd /usr/local/erlang #Compilation and installation make && make install
2. Then add the folder / usr/local/erlang/bin to the environment variable, and load it to use directly.
vim /etc/profile ######### Add the following ############### PATH=$PATH:/usr/local/erlang/bin ######################################## source /etc/profile
3. Enter erl directly here to see if the installation is successful
III. rabbitmq installation
# Download source package wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.8/rabbitmq-server-generic-unix-3.7.8.tar.xz # decompression tar -xvf rabbitmq-server-generic-unix-3.7.8.tar.xz -C /usr/local/ # Add environment variable vim /etc/profile ------ Add the following ------ PATH=$PATH:/usr/local/rabbitmq_server-3.7.8/sbin # Reload the environment variables source /etc/profile # Add web Management plug-in rabbitmq-plugins enable rabbitmq_management # Start rabbitmq service in the background rabbitmq-server -detached
Above, with the rabbitmq management plug-in enabled, there will be a web management interface. The default listening port is 15672. Open this port on the firewall to access the web interface
The default user name is "guest / guest"
This user is the default user, but it must be a local login. The solution is as follows:
1. Use nginx domain name to forward and change password after login
2. Add administrator
#Safe mode start /usr/local/rabbitmq_server-3.7.8/sbin/rabbitmq-server start & #Open web interface /usr/local/rabbitmq_server-3.7.8/sbin/rabbitmq-plugins enable rabbitmq_management #Add user /usr/local/rabbitmq_server-3.7.8/sbin/rabbitmqctl add_user admin 123456 #Setting permissions /usr/local/rabbitmq_server-3.7.8/sbin/rabbitmqctl set_user_tags admin administrator
Qihuo