RABBITMQ Installation and Java usage (i)

Source: Internet
Author: User
Tags rabbitmq

Recently idle to have nothing to do, tidy up the basic knowledge, this installation

1, RABBITMQ version is 3.6.10

2. The operating system is CentOS 7 64-bit virtual machine ip:192.168.149.133

1. Installation Update system environment dependent

Yum install gcc glibc-devel make ncurses-devel openssl-devel xmlto

2. Installation Configuration Erlang language environment

Because RABBITMQ is developed using the Erlang language, you also need to configure the following Erlang locales

Download the installation package, address http://www.erlang.org/downloads We downloaded the latest version of OTP 20.0

Uploaded to the server/opt/directory download file name should be: otp_src_20.0.tar.gz

Decompression: TAR-XVF otp_src_20.0.tar.gz

Access directory: CD otp_src_20.0/

Set installation compilation directory:./configure--prefix=/opt/erlang Path can be optional, note there will be a lot of configuration and dependency check, generally no problem, if the error is missing package, directly using the Yum command installation.

Installation: The make && makes install process will take some time.

After the installation is complete, we test that it is enough to install successfully:

If the above information appears, the installation is successful. Enter halt (). Exit.

Next, configure the environment variables for Erlang:

Add the following content:

Save, refresh effective: Source/etc/profile

3, Installation RABBITMQ

First download the installation file using the command: wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.10/ Rabbitmq-server-generic-unix-3.6.10.tar.xz we are using the latest version of 3.6.10

Unzip to the/opt/directory

4. Configuring RABBITMQ Environment variables

As with the configuration of the Erlang environment variable, add the following in the/etc/profile file:

Save, refresh effective: Source/etc/profile

5. Start RABBITMQ

So how to test our program installed successfully? Let's start with a look.

./rabbitmq-server

Check out the RABBITMQ service again.

OK, the boot was successful.

Of course, if you need to close the service, execute the following command:

./rabbitmqctl Stop

6. RABBITMQ Management

For Linux applications we generally have a page-side management page, RABBITMQ also has a simple administration page, below we can enable it.

First Create directory: MKDIR/ETC/RABBITMQ

Firewalls open 15672 ports and 5672 ports

Execute the following command:

./rabbitmq-plugins Enable Rabbitmq_management

Ok! Now that you're done, you can access the Admin page locally. Enter address in Browser: http://localhost:15672 will appear similar to the following page:

You can log on locally using the system default account password: guest/guest

But there is a problem, when we remote access, we found that access is not, the port is open, what is the reason?

In fact, RABBITMQ's Guest account is not for remote access by default, as to why you should ask the author.

We can create a user hxb ourselves:

Let's see. Remote access: http://192.168.149.133:15672/

Enter account password: HXB/HXB

Well, that's the way our RABBITMQ service ends up. In the next section we will talk about simple and practical in Java.

RABBITMQ Installation and Java usage (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.