Installing Erlang
CD/tmpwgethttp//erlang.org/download/otp_src_18.3.tar.gzTar-ZXVF otp_src_18.3.Tar. gz/opt/otp_src_18.3CD/opt/otp_src_18.3Yum-YInstall GCCGlibc-devel MakeNcurses-devel openssl-devel autoconf./configure && Make&& Make InstallLN-s/usr/local/lib/erlang/bin/erl/usr/bin/.LN-s/usr/local/lib/erlang/bin/erl/bin/.
Note
Erlang is installed, and the input Erl can view the version number, but when installing RABBITMQ, it is not possible to install Erlang or the version is not enough.
Then you can use the following code to map, and then ignore the RABBITMQ dependent direct installation
Ln-s/usr/local/lib/erlang/bin/erl/usr/bin/. Ln-s/usr/local/lib/erlang/bin/erl/bin/.
RABBITMQ Installation
1. Go to https://www.rabbitmq.com/download rpm
RPM with--nodeps indicates that dependencies are ignored during installation
CD/--import https://WWW.RABBITMQ.COM/RABBITMQ-SIGNING-KEY-PUBLIC.ASCRPM-IVH rabbitmq-server-3.6. 1-1. noarch.rpm--nodepsservice rabbitmq-server Restart
RABBITMQ add users, Web plugins
123456".*"" . *" ". *" rabbitmq-plugins enable Rabbitmq_managementservice rabbitmq-server Restart
http://{ip}:15672/
RABBITMQ node cluster configuration
1. Add the master, slave IP separately to the host:
A. Viewing the hostname # hostname
B. Modify host # vi/etc/hosts Note: if hostname contains. So as long as the first dot precedes the string
Masterip Masterhostname
Slaveip Slavehostname
2. Record the Cookie:cat/var/lib/rabbitmq/.erlang.cookie of master
3. Stop slave rabbitmq:service rabbitmq-server stop
4. Modify slave's cookie to master: sudo vim/var/lib/rabbitmq/.erlang.cookie
Service rabbitmq-Server startrabbitmqctl stop_apprabbitmqctl join_cluster [email protected]{masterhostname. Split (". ") [0]}rabbitmqctl start_app
Nginx Configuration Rabbitmq
#/etc/nginx/conf.d/rabbitmq.confserver {listen 80 ; server_name rabbitmq.jobstreet.com; #access_log /var/log/rabbitmq_access_log main; #error_log /var/log/rabbitmq_error_log debug_http; Client_max_body_size 60M; Client_body_buffer_size 512k; Location / {port_in_redirect on; Proxy_pass http: // localhost:15672; proxy_redirect off; Proxy_set_header Host $host; Proxy_set_header X -real-ip $remote _addr; Proxy_set_header X -forwarded-for $proxy _add_x_forwarded_for; }}
Open Rabbitmq.jobstreet.com Direct Access
Note: Remember to add rabbitmq.jobstreet.com to host
CentOS installation configuration RABBITMQ and Nginx forwarding