a Erlang installation
1.RabbitMQ is based on Erlang, so you must first configure the Erlang environment.
Download the latest Erlang installation package from Erlang's official website http://www.erlang.org/download.html, the version of Linux and MacOSX download is http://www.erlang.org/download.html
2. Then unzip the downloaded GZ package TAR-ZXVF *.tar.gz
3.cd into the extracted folder
4. Execute./configure--prefix=/opt/erlang will start compiling the installation will be compiled to/opt/erlang if you do not error, execute make and make install
5. If you have an error:
6.[[email protected] ~]# Yum install gcc
Continue to Error
Redhat The default comes with the Yum source need to register, to update, error:
This system isn't registered to Red hatsubscription Management. You can use the Subscription-manager to register.
Can be replaced with centos corresponding source. The operation is as follows:
1. Check if the Yum package is installed. To see if Rhel is installed with Yum, and if so, what Yum packages are available:
Rpm-qa |grep Yum
2 Delete Redhat's own Yum pack
Rpm-qa|grep Yum|xargs rpm-e--nodeps (without checking dependencies, delete rpm packages directly)
Rpm-qa |grep Yum (query confirmation)
[Email protected] ~]#
3. Download the new Yum package. Yum Package with Centos6.5
1) View the version number and system category:
Cat/etc/redhat-release
Arch
2) Follow the previous step to find the corresponding Yum package and download it. My server corresponds to the following:
wget http://mirrors.163.com/centos/6/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6/yum-3.2.29-40.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
3) Execution:
rpm-ivhyum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
If this step is an error, the outsole is as follows:
Libc.so.6 is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libc.so.6 (glibc_2.0) is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libc.so.6 (glibc_2.1.3) is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libglib-2.0.so.0 is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libpthread.so.0 is needed by yum-metadata-parser-1.1.2-16.el6.i686
libpython2.6.so.1.0 is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libsqlite3.so.0 is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libxml2.so.2 is needed by yum-metadata-parser-1.1.2-16.el6.i686
Libxml2.so.2 (libxml2_2.4.30) is needed byyum-metadata-parser-1.1.2-16.el6.i686
The Yum package downloaded and installed does not match the system version and requires a re-download of the installation. In addition, 163 mirror sites are merged into the 6 directory for 6.0~6.5 resources.
4) Replace the Yum source, delete or back up the original source under another:
cd/etc/yum.repos.d/
wgetHttp://mirrors.163.com/.help/CentOS6-Base-163.repo
Vicentos6-base-163.repo
Edit the file and replace all the $releasever in the file with the version number: 6 (note, not 6.5!) ) Last Save!
4. Clear the original cache and rebuild the cache:
Clean all
Yum Makecache
5. Update the system:
Yum Update
6. [Email protected]~]# yum Install gcc
at this point, if no error description GCC Installation Successful
start the installation again Erlang
Reference http://blog.csdn.net/chszs/article/details/28638305
Erlang is now part of the Fedora and Debian/ubuntu software repositories.
The most current version of Erlang is OTP 18.2. Erlang is a programming language used to build a programming language for large-scale, highly scalable, high-availability soft real-time systems. It has been used in telecommunications, finance, e-commerce, VoIP, and instant messaging. Erlang's runtime system has built-in support for concurrency, distribution, and fault tolerance.
OTP is a collection of Erlang libraries and design principles that provide middleware for developing various systems. It contains its own distributed database, interfaces for other programming languages, Debug and release processing tools, and so on.
Beam is the virtual machine required for Erlang code execution. The Erlang code is compiled with a. beam extension. ERTs is an Erlang runtime system that includes components such as beam, kernels, and standard libraries.
The official recommendation is to install Erlang from the source code, so the following begins installing OTP 18.2 from the source.
Download OTP 18.2 Source: http://www.
. org/download/otp_src_18.2.1.tar.gz
# tar Zvxfotp_src_18.2.tar.gz
# MV OTP_SRC_18.2/OTP
# CD OTP
#./configure--prefix=/opt/erlang--without-javac
Error:
Configure:error:No Curses Library Functionsfound
Configure:error:/bin/sh '/root/otp/erts/configure ' failed for ERTs
# yum-y Installncurses-devel
#./configure--prefix=/opt/erlang--without-javac
Error
*********************************************************************
Applicationsdisabled **********************
*********************************************************************
Crypto:no Usableopenssl found
Jinterface:java compilerdisabled by user
Odbc:odbclibrary-link check failed
Orber:no C++compiler found
Ssh:no usable OpenSSL found
Ssl:no usable OpenSSL found
*********************************************************************
# Yum List | grep SSL
# yum Install Openssl-devel
#./configure--prefix=/opt/erlang--without-javac
# Yum List | grep ODBC
# yum Install Unixodbc-devel
#./configure--prefix=/opt/erlang--without-javac
# yum Install gcc-c++
#./configure--prefix=/opt/erlang--without-javac
# make
# make Install
#/opt/erlang/bin/erl
ERLANG/OTP [erts-6.0] [source] [64-bit][async-threads:10] [hipe] [Kernel-poll:false]
Eshell V6.0 (abort with ^g)
1> Evenn = Lists:filter (Fun (n), n rem 2== 0 end, Lists:seq (1,100)).
[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,
44,46,48,50,52,54,56,58| ...]
There are several ways to exit the Erlang shell
Command mode 1: Execute Init:stop ().
Command mode 2: Execute Halt ().
Shortcut key mode 1:control+c then select a
Shortcut key mode 2:control+g then press Q
- After the compilation is complete, enter/opt/erlang and the ERL test Erlang is installed successfully.
- Modify the/etc/profile file to add the following environment variables:
- #set Erlang Environment
- Export path= $PATH:/opt/erlang/bin
- Source profile makes the file effective
- Ken will be unable to find the package, just go directly to yum install.
Modify the/etc/profile file to add the following environment variable
Erl_home=/opt/erlang
Path= $ERL _home/bin: $PATH
Exporterl_home PATH
"Installation Summary"
To install Erlang from source code, there are two libraries or tools that are required:
One is the full GCC compiler environment
Second, the Ncurses Development library
There are also libraries or tools that, if they are not present, will have a warning message when compiling the configuration, and may not be configured. These libraries are:
1) OpenSSL Development Library
2) ODBC Development Library
3) Java compiler
Http://www.rabbitmq.com/download.html
two. Installing RabbitMQ
- RPM--IMPORTHTTPS://WWW.RABBITMQ.COM/RABBITMQ-SIGNING-KEY-PUBLIC.ASC
Yum installrabbitmq-server-3.6.0-1.noarch.rpm
- Wget-c http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.0/rabbitmq-server-3.6.0-1.noarch.rpm
Yum installrabbitmq-server-3.6.0-1.noarch.rpm
The above two statements can be successfully installed on any one of the following lines:
But I encountered a problem in installing Rabbitmq-server:
Error:package:rabbitmq-server-3.6.0-1.noarch (/rabbitmq-server-3.6.0-1.noarch)
Requires:erlang >= r16b-3
You could try using--skip-broken to work around the problem
You could try Running:rpm-va--nofiles--nodigest
This is due to the version problem of Erlang, in fact there is no impact, you can use Rpm-ivh--nodeps rabbitmq-server-3.6.0-1.noarch.rpm installation.
If the installation is not successful: use the following trick
three
RABBITMQ
Installation Configuration
- There are many versions of RABBITMQ installed, and we use the generic UNIX version.
- CD/
- wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.7.1/rabbitmq-server-generic-unix-2.7.1.tar.gz Download RABBITMQ
- Tar zxvf rabbitmq-server-generic-unix-2.7.1.tar.gz-c/opt unzip to the specified folder
- Cd/opt, establishing a soft link ln-s rabbitmq-server-generic-unix rabbitmq
- CD rabbitmq/sbin,./rabbitmq-server-detached to enable background startup
- modifying/etc/profile, adding environment variables
- #set RABBITMQ Environment
- Export path= $PATH:/opt/rabbitmq/sbin
- Source profile makes the file effective
- Cd/opt/rabbitmq/sbin,./rabbitmqctl Stop shutdown RABBITMQ
- This completes the installation
- Enable Admin mode (manage MQ with Web page) cd/opt/rabbitmq/sbin/
- Execution./rabbitmq-pluginenable rabbitmq-management
- Then visit http://localhost:55672
a . if it's installed as a service, start with this.
[Email protected] ~]# service Rabbitmq-server restart
Warning:ignoring/etc/rabbitmq/rabbitmq.conf--location has moved to/etc/rabbitmq/rabbitmq-env.conf
Restarting Rabbitmq-server:failed-check/var/log/rabbitmq/shutdown_log, _err
SUCCESS
Rabbitmq-server.
[Email protected] ~]#
RPM installed, then start the process, start the console plug-in can be
./RABBITMQCTL Status
./RABBITMQCTL Status
./rabbitmq-server–detached
Starting the console plugin
[Email protected] bin]#/rabbitmq-plugins enable rabbitmq_management
[[Email protected] Master ~]#/sbin/service rabbitmq-server start
Starting rabbitmq-server:success
Rabbitmq-server.
The corresponding close command is:/sbin/service rabbitmq-server stop
5. Management
RABBITMQ server is mainly managed by Rabbitmqctl and rabbimq-plugins two tools, the following are some common functions.
1). Server Startup and shutdown
Start: rabbitmq-server–detached
Close: Rabbitmqctl stop
If there are multiple instances of a single machine, add –n after rabbitmqctlh to specify the name
2). Plugin Management
To open a plugin: rabbitmq-pluginsenable xxx
To close a plugin: rabbitmq-pluginsdisablexxx
Note: After restarting the server, it takes effect.
3). Virtual_host Management
New Virtual_host:rabbitmqctladd_vhost XXX
Undo Virtual_host:rabbitmqctl Delete_vhost XXX
4). User Management
New User: Rabbitmqctl add_user xxxpwd
Delete User: Rabbitmqctl delete_user xxx
Change Password: rabbimqctlchange_password {Username}{newpassword}
Set User role: Rabbitmqctlset_user_tags {username} {tag ...}
Tag can be administrator,monitoring, management
5). Rights Management
Permission settings: set_permissions [-pvhostpath] {user}{conf} {write} {read}
Vhostpath
Vhost Path
User
User name
Conf
A regular expression match which configuration resources can be accessed by that user.
Write
A regular expression match which configuration resources can be read by the user.
Read
A regular expression match which configuration resources can be accessed by that user.
6). Get Server Status information
Server Status: Rabbitmqctl status
Queue information: Rabbitmqctl list_queues[-p Vhostpath][queueinfoitem ...]
Queueinfoitem can be: Name,durable,auto_delete,arguments,messages_ready,
Messages_unacknowledged,messages,consumers,memory
Exchange information: Rabbitmqctllist_exchanges[-p Vhostpath] [Exchangeinfoitem ...]
Exchangeinfoitem are: name,type,durable,auto_delete,internal,arguments.
Binding information: Rabbitmqctllist_bindings[-p Vhostpath][bindinginfoitem ...]
Bindinginfoitem are: source_name,source_kind,destination_name,destination_kind,routing_key,arguments
Connection info: rabbitmqctllist_connections [connectioninfoitem ...]
Connectioninfoitem are: Recv_oct,recv_cnt,send_oct,send_cnt,send_pend and so on.
Channel information: Rabbitmqctl List_channels[channelinfoitem ...]
Channelinfoitem has consumer_count,messages_unacknowledged,messages_uncommitted,acks_uncommitted,messages_. Unconfirmed,prefetch_count,client_flow_blocked
Common commands:
View all queue information
# Rabbitmqctl List_queues
Close the app
# Rabbitmqctl Stop_app
Start the app and use it with the close command above to clear the queue
# Rabbitmqctl Start_app
Clear all Queues
# Rabbitmqctl Reset
For more usage and parameters, you can perform the following commands to view
# Rabbitmqctl
3.RABBITMQ Common Commands
Rabbitmq-server Start or service rabbitmq-server start #启动rabbitmq
Rabbitmqctllist_exchanges
Rabbitmqctllist_bindings
Rabbitmqctllist_queues #分别查看当前系统种存在的Exchange和Exchange上绑定的Queue信息.
Rabbitmqctl Status #查看运行信息
Rabbitmqctl Stop #停止运行rabbitmq
Rabbitmq-pluginsenable rabbitmq_management
#启动rabbitmq的图形管理界面, this operation must restart RABBITMQ, and then http://127.0.0.1:15672 the user name and password in the Web is guest guest. If the LAN cannot access the set firewall filtering rules or turn off the firewall.
Installation and configuration of RABBITMQ under Linux