rabbitmq离线编译安装(aarch64)

erlang 安装源码下载
https://www.erlang.org/downloads
http://erlang.org/download/otp_src_22.1.tar.gz
依赖环境:

yum install ncurses ncurses-devel java-devel -y  
yum install unixODBC unixODBC-devel -y  

#yum install  codeblocks codeblocks-contrib codeblocks-devel -y  
#yum -y install wxGTK wxGTK-devel -y 

编译安装

tar -zxf otp_src_22.1.tar.gz 

cd otp_src_22.1 

./configure --prefix=/usr/local/erlang --without-javac

make && make install

在linux的/etc/profile环境下添加如下两行代码,最后source /etc/profile使配置生效:

#set erlang environment 
export PATH=$PATH:/usr/local/erlang/bin

输入erl可以检查erlang是否安装成功

[root@localhost otp_src_22.1]# erl
Erlang/OTP 22 [erts-10.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

rabbitmq下载(已编译包安装)
1、下载rabbitmq

https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.8.8
rabbitmq官网下载地址 : http://www.rabbitmq.com/download.html
rabbitmq源码下载地址: http://www.rabbitmq.com/install-generic-unix.html

2.解压

tar -Jxvf rabbitmq-server-generic-unix-3.7.2.tar.xz
或
xz -d rabbitmq-server-generic-unix-3.8.8.tar.xz
tar -xvf rabbitmq-server-generic-unix-3.8.8.tar 

3.移动文件到系统目录下

    mv rabbitmq_server-3.8.8/  /usr/local/rabbitmq

4、添加系统变量

    #打开环境变量文件
    vi /etc/profile
    #添加erlang rabbitmq 到环境变量
    export PATH=$PATH:/usr/local/rabbitmq/sbin
    #重新加载环境变量
    source /etc/profile

5、 启动web插件 启动rabbitmq

    #启动web插件 便于访问
    rabbitmq-plugins enable rabbitmq_management
    #启动rabbitmq服务
    rabbitmq-server

6、添加远端登录账户

    #添加用户 admin  密码为 123456
    rabbitmqctl add_user admin 123456
    #将admin 设置为管理员权限
    rabbitmqctl set_user_tags admin administrator
    #将admin 设置为远端登录
    rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

7、端口开放15672(web) 5672(client端通信口)

firewall-cmd --zone=public --add-port=15672/tcp --permanent
firewall-cmd --zone=public --add-port=5672/tcp --permanent

4369 -- erlang发现口
5672 --client端通信口
15672 -- 管理界面ui端口
25672 -- server间内部通信口

8、登录rabbitmq
访问地址: http://localhost:15672
这里写图片描述
使用 admin 密码 123456 进行登录

基本操作
1、启动rabbitmq

rabbitmq-server -detached #后台启动

2、查看服务状态

rabbitmqctl status

例如:

[root@ ~]# rabbitmqctl status
Status of node rabbit@iZj6ci19b3r6baljocdx8cZ
[{pid,19317},
 {running_applications,
     [{rabbitmq_management,"RabbitMQ Management Console","3.6.12"},
      {rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.6.12"},
      {cowboy,"Small, fast, modular HTTP server.","1.0.4"},
      ......

3、 停止RabbitMQ

rabbitmqctl stop

4、列出/启动插件
列出插件

rabbitmq-plugins list

启用插件

rabbitmq-plugins enable rabbitmq_management

默认端口15672,对外访问即:IP:15672,默认的账号密码是guest,但是该账号只能通过localhost登录
1)添加用户

rabbitmqctl add_user [username] [password]

2)添加权限

rabbitmqctl set_permissions -p "/" [username] ".*" ".*" ".*" # "/"即vhost

3)修改用户角色

rabbitmqctl set_user_tags [username] administrator

4)修改用户密码

rabbitmqctl change_password [username] [password]   

4)查看当前用户列表

rabbitmqctl list_users

5)删除用户

rabbitmqctl delete_user [username]

erlang.mk:30: Please upgrade to GNU Make 4 or later:
make[1]: Entering directory `/usr/local/src/rabbitmq-server-3.7.9/deps/rabbit_common’
erlang.mk:30: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html

下载高版本的4以上的make http://ftp.gnu.org/gnu/make/

以make-4.3.tar.gz安装包为例,执行以下命令:
# tar -xvf make-4.3.tar.gz  //解压安装包
# cd make-4.3  
# ./configure  --prefix=/usr/local/make  //配置编译
# make && make install //编译安装
# cd /usr/local/make
# cd bin
#./make -v //测试版本号
//用which make查看以前make所在路径 以/usr/bin/make
# /usr/bin/make
# cd /usr/bin
# mv make make_bak
# ln -s /usr/local/make/bin/make ./make //建立软链接
# make -v //测试

rabbitmq-server源码编译安装(未编译)
rabbitmq安装前先,下载安装elixir,具体版本以实际需要为主
https://github.com/elixir-lang/elixir/tags?after=v1.11.0
解压安装:

make && make install

添加到/etc/profile中,路径以实际为主

export ELIXIR_HOME= /usr/local/elixir
export PATH="$PATH:$ELIXIR_HOME/bin"

输入iex测试

Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.4.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.8.8
下载源码包rabbitmq-server-3.8.8.tar.xz
解压安装:

xz -d rabbitmq-server-3.8.8.tar.xz
tar -xvf rabbitmq-server-3.8.8.tar 
cd rabbitmq-server-3.8.8
make
make install

Could not update enabled plugins file at /etc/rabbitmq/enabled_plugins: the file does not exist (ENOENT)

在/etc/创建目录rabbitmq
使用这个命令启动监控插件,默认在/etc/rabbitmq目录下创建enabled_plugins文件时赋予权限

最后访问ip:15672
http://ip:15672

你可能感兴趣的:(rabbitmq,linux,aarch64)