怎么在vmware中安装rabbitmq

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么在vmware中安装rabbitmq相关的知识,希望对你有一定的参考价值。

参考技术A RabbitMQ安装#InstallfromEPEL[root@vdevops~]#yum--enablerepo=epel-yinstallrabbitmq-server[root@vdevops~]#systemctlstartrabbitmq-server[root@vdevops/]#journalctl-xeNov1201:30:01vdevops.orgCROND[3856]:(root)CMD(/usr/lib64/sa/sa111)Nov1201:30:04vdevops.orgrabbitmqctl[3831]:DIAGNOSTICSNov1201:30:04vdevops.orgrabbitmqctl[3831]:===========Nov1201:30:04vdevops.orgrabbitmqctl[3831]:attemptedtocontact:[rabbit@vdevops]Nov1201:30:04vdevops.orgrabbitmqctl[3831]:rabbit@vdevops:Nov1201:30:04vdevops.orgrabbitmqctl[3831]:*unabletoconnecttoepmd(port4369)onvdevops:timeout(timedout)Nov1201:30:04vdevops.orgrabbitmqctl[3831]:currentnodedetails:Nov1201:30:04vdevops.orgrabbitmqctl[3831]:-nodename:rabbitmqctl3831@vdevopsNov1201:30:04vdevops.orgrabbitmqctl[3831]:-homedir:/var/lib/rabbitmqNov1201:30:04vdevops.orgrabbitmqctl[3831]:-cookiehash:s++dDMtIhAufFItw+ercBw==Nov1201:30:04vdevops.orgpolkitd[1007]:UnregisteredAuthenticationAgentforunix-process:3798:36632(systembusname:1.23,objectpath/org/freedesktop/PolicyKit1/AuthenticationAgent,localeen_US.UTF-8)(disconnectedfNov1201:30:04vdevops.orgsystemd[1]:rabbitmq-server.service:controlprocessexited,code=exitedstatus=2Nov1201:30:04vdevops.orgsystemd[1]:FailedtostartRabbitMQbroker.--Subject:Unitrabbitmq-server.servicehasfailed--Defined-By:systemd--Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel----Unitrabbitmq-server.servicehasfailed.----Theresultisfailed.Nov1201:30:04vdevops.orgsystemd[1]:Unitrabbitmq-server.serviceenteredfailedstate.Nov1201:30:04vdevops.orgsystemd[1]:rabbitmq-server.servicefailed.Nov1201:30:42vdevops.orgsystemd[1]:Gotautomountrequestfor/proc/sys/fs/binfmt_misc,triggeredby3860(find)Nov1201:30:42vdevops.orgsystemd[1]:MountingArbitraryExecutableFileFormatsFileSystem--Subject:Unitproc-sys-fs-binfmt_misc.mounthasbegunstart-up--Defined-By:systemd--Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel----Unitproc-sys-fs-binfmt_misc.mounthasbegunstartingup.Nov1201:30:42vdevops.orgsystemd[1]:MountedArbitraryExecutableFileFormatsFileSystem.--Subject:Unitproc-sys-fs-binfmt_misc.mounthasfinishedstart-up--Defined-By:systemd--Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel----Unitproc-sys-fs-binfmt_misc.mounthasfinishedstartingup.----Thestart-upresultisdone.rabbitmq-server启动报错:FailedtostartRabbitMQbroker度娘解析:主机hostname配置错误,原本hostname为vdevops.org,更改为vdevops,修改hosts文件中hostname设置[root@vdevops/]#hostnamectlset-hostnamevdevops#hostname更改重启启动rabbitmq-server[root@vdevops/]#systemctlstatusrabbitmq-server●rabbitmq-server.service-RabbitMQbrokerLoaded:loaded(/usr/lib/systemd/system/rabbitmq-server.service;disabled;vendorpreset:disabled)Active:active(running)sinceSat2016-11-1201:32:41CST;3min58sagoProcess:3831ExecStop=/usr/lib/rabbitmq/bin/rabbitmqctlstop(code=exited,status=2)MainPID:3891(beam)CGroup:/system.slice/rabbitmq-server.service├─3891/usr/lib64/erlang/erts-5.10.4/bin/beam-Ww-Ktrue-A30-P1048576---root/usr/lib64/erlang-prognameerl---home/var/lib/rabbitmq---pa/usr/lib/rabbitmq/lib/rabbitmq_server-3.3.5/sbin/../ebin-nos├─3908/usr/lib64/erlang/erts-5.10.4/bin/epmd-daemon├─3963inet_gethost4└─3964inet_gethost4Nov1201:32:39vdevopssystemd[1]:StartingRabbitMQbrokerNov1201:32:39vdevopssystemd[1]:rabbitmq-server.service:GotnotificationmessagefromPID3908,butreceptiononlypermittedformainPID3891Nov1201:32:40vdevopsrabbitmq-server[3891]:RabbitMQ3.3.5.Copyright(C)2007-2014GoPivotal,Inc.Nov1201:32:40vdevopsrabbitmq-server[3891]:####LicensedundertheMPL.Seehttp://www.rabbitmq.com/Nov1201:32:40vdevopsrabbitmq-server[3891]:####Nov1201:32:40vdevopsrabbitmq-server[3891]:##########Logs:/var/log/rabbitmq/rabbit@vdevops.logNov1201:32:40vdevopsrabbitmq-server[3891]:########/var/log/rabbitmq/rabbit@vdevops-sasl.logNov1201:32:40vdevopsrabbitmq-server[3891]:##########Nov1201:32:41vdevopssystemd[1]:StartedRabbitMQbroker.Nov1201:32:41vdevopsrabbitmq-server[3891]:Startingbrokercompletedwith0plugins.[root@vdevops~]#systemctlenablerabbitmq-serverCreatedsymlinkfrom/etc/systemd/system/multi-user.target.wants/rabbitmq-server.serviceto/usr/lib/systemd/system/rabbitmq-server.service.防火墙设置[root@linuxprobe~]#firewall-cmd--add-port=5672/tcp--permanentsuccess[root@linuxprobe~]#firewall-cmd--reloadsuccess要使用RabbitMQ,请先添加用户[root@vdevops~]#rabbitmqctladd_userlinuxprobepasswordCreatinguser"linuxprobe"done.[root@vdevops~]#rabbitmqctllist_usersListingusersguest[administrator]linuxprobe[]done.#grantingadminroletoauserislikefollows[root@vdevops~]#rabbitmqctlchange_passwordlinuxprobestrongpasswordChangingpasswordforuser"linuxprobe"done.#grantingadminroletoauserislikefollows[root@vdevops~]#rabbitmqctlset_user_tagslinuxprobeadministratorSettingtagsforuser"linuxprobe"to[administrator]done.#deletingauserislikefollows[root@vdevops~]#rabbitmqctldelete_userlinuxprobeDeletinguser"linuxprobe"done.要使用RabbitMQ,也要添加虚拟主机[root@vdevops~]#rabbitmqctladd_vhost/my_vhostCreatingvhost"/my_vhost"done.[root@vdevops~]#rabbitmqctllist_vhostsListingvhosts//my_vhostdone.[root@vdevops~]#rabbitmqctldelete_vhost/my_vhostDeletingvhost"/my_vhost"done.给虚拟主机的用户授予权限,请如下配置#rabbitmqctlset_permissions[-pvhost][user][permission?(modify)(write)(read)][root@vdevops~]#rabbitmqctlset_permissions-p/my_vhostlinuxprobe".*"".*"".*"Settingpermissionsforuser"linuxprobe"invhost"/my_vhost"done.#[root@vdevops~]#rabbitmqctllist_user_permissionslinuxprobeListingpermissionsforuser"linuxprobe"/my_vhost.*.*.*done.#deletingpermissionofaspecificuserislikefollows[root@vdevops~]#rabbitmqctlclear_permissions-p/my_vhostlinuxprobeClearingpermissionsforuser"linuxprobe"invhost"/my_vhost"done.RabbitMQ:使用WebUI[root@vdevops~]#rabbitmq-pluginsenablerabbitmq_managementThefollowingpluginshavebeenenabled:mochiwebwebmachinerabbitmq_web_dispatchamqp_clientrabbitmq_management_agentrabbitmq_managementPluginconfigurationhaschanged.RestartRabbitMQforchangestotakeeffect.[root@vdevops~]#systemctlrestartrabbitmq-server客户端访问http://vdevops:15672/rabbitmqadmin使用可以配置RabbitMQ使用rabbitmqadmin命在WebUI上下载rabbitmqadmin。登录到WebUI并移动到“http://(主机名或IP地址):15672/cli”,然后显示以下屏幕,您可以在这里下载rabbitmqadmin,点击here右键保存rabbitmqadmin.txt,然后上传到服务器上面更改为rabbitmqadmin,并添加执行权限将rabbitmqadmin上传到RabbitMQ服务器并设置合适的权限,此示例显示如下设置[root@localhost~]#ll/usr/local/bin/rabbitmqadmin-rwxr-xr-x.1rootroot36112Nov1117:23/usr/local/bin/rabbitmqadmin[root@vdevopsbin]#rabbitmqadminlistusers+------------+------------------------------+---------------+|name|password_hash|tags|+------------+------------------------------+---------------+|guest|k2rhpzCrZBKkY5WRhUWrGm5DCkg=|administrator||linuxprobe|P+YxK1QXIYrJpek5i//rPjn5SME=|administrator|+------------+------------------------------+---------------+[root@vdevopsbin]#cd[root@vdevops~]#rabbitmqadminlistusers+------------+------------------------------+---------------+|name|password_hash|tags|+------------+------------------------------+---------------+|guest|k2rhpzCrZBKkY5WRhUWrGm5DCkg=|administrator||linuxprobe|P+YxK1QXIYrJpek5i//rPjn5SME=|administrator|+------------+------------------------------+---------------+[root@vdevops~]#rabbitmqadminlistvhosts+-----------+---------+|name|tracing|+-----------+---------+|/|False||/my_vhost|False|+-----------+---------+详细可以参考http://www.linuxprobe.com/centos-deploy-rabbitmq.html

在VMWare Workstation中安装Ubuntu

1.工具准备

1. VMWare Workstation

  下载地址:https://my.vmware.com/cn/web/vmware/downloads

2.Ubuntu镜像

  镜像建议使用具有长期维护的版本(LTS),下面给出Ubuntu 18.04.4 LTS的下载地址

  下载地址:https://cn.ubuntu.com/download

2.WMWare Workstation的安装

此处提供一个bi站的视频教程:https://www.bilibili.com/video/av37813087/

此UP主为我们提供了VMWare Workstation Pro 15的永久激活秘钥:AG31K-81GE0-M814Y-ZQQ59-PLKX2

3.利用VM Pro 15创建Ubuntu虚拟机

详细安装过程:https://blog.csdn.net/stpeace/article/details/78598333

虽然此篇博客是利用VM Pro 14来创建Ubuntu,但是这个方法也可以应用到VM Pro 15

5.为Ubuntu安装VMWareTools工具

VMWareTools工具的作用:安装完成VMWareTools工具后物理机和虚拟机之前可以相互拷贝文件,并且虚拟机可以调整大小、设置全屏等。

 

之后的详细过程可查看教程:https://www.linuxidc.com/Linux/2016-04/130807.htm

 

6.为Ubuntu虚拟机做快照

 

经过以上步骤后Ubuntu虚拟机算是安装完成了,但是为了防止以后在使用过程中Ubuntu虚拟机出现问题,可以在这个时候为它做一个快照,保存当前虚拟机的一个状态,以供出现问题时可以恢复到此干净状态。

 

 

参考

【1】https://blog.csdn.net/stpeace/article/details/78598333

【2】https://www.linuxidc.com/Linux/2016-04/130807.htm

 

以上是关于怎么在vmware中安装rabbitmq的主要内容,如果未能解决你的问题,请参考以下文章

怎么在VMware中安装kali

在虚拟机中安装vmware tools 提示只能在虚拟机中安装,这个应该怎么解决?

VMware ESXi中安装虚拟机后怎么改端口号

vmware中安装debian10,速度太慢

Ubuntu 10.04怎样在VMware7中安装VMware Tool及如何全屏

在VMware中安装了RedHat Linux 9.0 ,虚拟机能全屏显示,但LINUX不能全屏,怎么解决