linux 7.2 安装openstack 过程出现rabbitmq-server 错误解决方法

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux 7.2 安装openstack 过程出现rabbitmq-server 错误解决方法相关的知识,希望对你有一定的参考价值。

linux 7.2 安装openstack 过程出现rabbitmq-server 错误解决方法


本文作者:LDC  2017-10-10

ERROR : Errorappeared during Puppet run: 192.168.4.5_amqp.pp

Error: Could notstart Service[rabbitmq-server]: Execution of ‘/usr/bin/systemctl startrabbitmq-server‘ returned 1: Job for rabbitmq-server.service failed because thecontrol process exited with error code. See "systemctl statusrabbitmq-server.service" and "journalctl -xe" for details.

You will find fulltrace in log/var/tmp/packstack/20171010-050219-WenzF1/manifests/192.168.4.5_amqp.pp.log

Please check log file/var/tmp/packstack/20171010-050219-WenzF1/openstack-setup.log for moreinformation

Additionalinformation:

 * File /root/keystonerc_admin has been createdon OpenStack client host 192.168.4.5. To use the command line tools you need tosource the file.

 * To access the OpenStack Dashboard browse tohttp://192.168.4.5/dashboard .

Please, find your logincredentials stored in the keystonerc_admin in your home directory.

 

[[email protected]]# journalctl -xe

-- Subject: Unitsession-353.scope has finished start-up

-- Defined-By:systemd

-- Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unitsession-353.scope has finished starting up.

--

-- The start-upresult is done.

10 10 05:20:01 vh02.ldc.cn systemd[1]: StartingSession 353 of user root.

-- Subject: Unitsession-353.scope has begun start-up

-- Defined-By: systemd

-- Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unitsession-353.scope has begun starting up.

10 10 05:20:01 vh02.ldc.cn CROND[27313]: (root)CMD (/usr/lib64/sa/sa1 1 1)

10 10 05:30:01 vh02.ldc.cn systemd[1]: StartedSession 354 of user root.

-- Subject: Unitsession-354.scope has finished start-up

-- Defined-By:systemd

-- Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unitsession-354.scope has finished starting up.

--

-- The start-upresult is done.

10 10 05:30:01 vh02.ldc.cn systemd[1]: StartingSession 354 of user root.

-- Subject: Unitsession-354.scope has begun start-up

-- Defined-By:systemd

-- Support:http://lists.freedesktop.org/mailman/listinfo/systemd-devel

--

-- Unitsession-354.scope has begun starting up.

10 10 05:30:01 vh02.ldc.cn CROND[27401]: (root)CMD (/usr/lib64/sa/sa1 1 1)

lines 3119-3147/3147(END)

 

 

本人在做安装openstack  packstack 安装先设置好的应答文件answer.txt[[email protected] ~]# packstack --answer-file answer.txt  出现以上错误,查看报错日志,和journalctl -xe     journalctl -f  systemctl status rabbitmq-server.service 根据提示,大概出现在两个位置,一个是hosts ,hostname   另外一个是数据库mariadb上,错误提示无法启动rabbitmq-server这个服务。查阅大量的百度资料还是无法解决这个问题。 

经过反复推敲,现在已经找到问题所在原因:

1.因为本机的192.168.4.1  192.168.4.2 这个IP 已经被别的虚拟机占用,因此我就用vh01.ldc.cn192.168.4.4

    vh02.ldc.cn 192.168.4.5

这样来设置,错误就出现在这里,因为下面的vim/var/named/ldc.cn.zone中使用的是

$generate       1-9    vh0$    IN      A      192.168.4.$

$generate       10-254 vh$     IN      A      192.168.4.$

$”这个变量 IP 是跟vh主机对应的,也就是说vh01 对应 192.168.4.1 我给忽略了,因此在安装过程中就会导致报错。

2.把虚拟IP 改为4.1  4.2  分别与vh01.ldc.cn  vh02.ldc.cn  对应,然后删除answer.txt

  生成自动应答文件,并编辑

[[email protected] ~]#packstack --gen-answer-file answer.txt

 

[[email protected] ~]#packstack --answer-file answer.txt

成功。。。。

 

以下是安装流程:

 

准备主机

vh01.ldc.cn ->提供DNSNTP  

vh02.ldc.cn ->安装openstack  需要有额外添加虚拟硬盘

物理主机      ->提供yum

实现此案例需要按照如下步骤进行。

步骤一:通过ftp 输出软件包

1)创建软件包目录

[[email protected]~]# mkdir /var/ftp/rhel7.2

[[email protected]~]# mkdir /var/ftp/osp8

2)挂载光盘镜像到软件包目录

[[email protected]~]# vim /etc/fstab

/ISO/CentOS-7-x86_64-DVD-1511.iso/var/ftp/rhel7.2 iso9660 defaults 0 0

/ISO/RHEL7OSP-8.0-20160421-x86_64.iso/var/ftp/osp8 iso9660 defaults 0 0

[[email protected]~]# mount -a

3)创建rhel7 源配置文件:

[[email protected]~]# vim /etc/yum.repos.d/server.repo

[rhel7.2]

name=rhel7.2

baseurl=ftp://192.168.4.1/rhel7.2

enabled=1

gpgcheck=0

步骤二:通过脚本生成osp 仓库源配置文件

1)编写脚本

[[email protected]~]# mkdir bin; cd bin

[[email protected]]# vim mkrepo.sh

#!/bin/bash

cd /var/ftp/osp8

for folder in *

do

if [ -d $folder ]; then

cat << EOF >>/etc/yum.repos.d/osp8.repo

[$folder]

name=$folder

baseurl=ftp://192.168.4.1/osp8/$folder

enabled=1

gpgcheck=0

EOF

fi

done

2)生成配置文件并验证

[[email protected] bin]# bash mkrepo.sh

[[email protected] bin]# cat /etc/yum.repos.d/osp8.repo

[rhel-7-server-extras-rpms]

name=rhel-7-server-extras-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-extras-rpms

enabled=1

gpgcheck=0

[rhel-7-server-openstack-8-director-rpms]

name=rhel-7-server-openstack-8-director-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-openstack-8-director-rpms

enabled=1

gpgcheck=0

[rhel-7-server-openstack-8-rpms]

name=rhel-7-server-openstack-8-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-openstack-8-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rhceph-1.3-calamari-rpms]

name=rhel-7-server-rhceph-1.3-calamari-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rhceph-1.3-calamari-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rhceph-1.3-installer-rpms]

name=rhel-7-server-rhceph-1.3-installer-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rhceph-1.3-installer-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rhceph-1.3-mon-rpms]

name=rhel-7-server-rhceph-1.3-mon-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rhceph-1.3-mon-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rhceph-1.3-osd-rpms]

name=rhel-7-server-rhceph-1.3-osd-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rhceph-1.3-osd-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rhceph-1.3-tools-rpms]

name=rhel-7-server-rhceph-1.3-tools-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rhceph-1.3-tools-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rh-common-rpms]

name=rhel-7-server-rh-common-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rh-common-rpms

enabled=1

gpgcheck=0

[rhel-7-server-rpms]

name=rhel-7-server-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-7-server-rpms

enabled=1

gpgcheck=0

[rhel-ha-for-rhel-7-server-rpms]

name=rhel-ha-for-rhel-7-server-rpms

baseurl=ftp://192.168.4.1/osp8/rhel-ha-for-rhel-7-server-rpms

enabled=1

gpgcheck=0

[[email protected] bin]# yum repolist

源标识 源名称 状态

rhel-7-server-extras-rpmsrhel-7-server-extras-rpms 54

rhel-7-server-openstack-8-director-rpmsrhel-7-server-openstack-8-director 39

rhel-7-server-openstack-8-rpmsrhel-7-server-openstack-8-rpms 467

rhel-7-server-rh-common-rpmsrhel-7-server-rh-common-rpms 76

rhel-7-server-rhceph-1.3-calamari-rpmsrhel-7-server-rhceph-1.3-calamari- 15

rhel-7-server-rhceph-1.3-installer-rpmsrhel-7-server-rhceph-1.3-installer 88

rhel-7-server-rhceph-1.3-mon-rpms rhel-7-server-rhceph-1.3-mon-rpms38

rhel-7-server-rhceph-1.3-osd-rpmsrhel-7-server-rhceph-1.3-osd-rpms 35

rhel-7-server-rhceph-1.3-tools-rpmsrhel-7-server-rhceph-1.3-tools-rpm 23

rhel-7-server-rpms rhel-7-server-rpms 519

rhel-ha-for-rhel-7-server-rpms rhel-ha-for-rhel-7-server-rpms30

rhel7.2 rhel7.2 3,723

repolist: 5,107

以上OSP仓库搭建需要用到这个镜像里面的包,太大了自行百度下载技术分享

大小:3.3GB

RHEL7OSP-8.0-20160421-x86_64

 

需要用到这些rpms包:技术分享

附件提供了:

conntrack-tools-1.4.2-9.el7.x86_64(1)

conntrack-tools-1.4.2-9.el7.x86_64

libnetfilter_cthelper-1.0.0-8.el7.x86_64(1)

libnetfilter_cthelper-1.0.0-8.el7.x86_64

libnetfilter_cttimeout-1.0.0-6.el7.x86_64(1)

libnetfilter_cttimeout-1.0.0-6.el7.x86_64

libnetfilter_queue-1.0.2-1.el7.x86_64(1)

libnetfilter_queue-1.0.2-1.el7.x86_64


 

准备环境

1、在vh01上配置dns

[[email protected] ~]# yuminstall -y bind

[[email protected] ~]# vim/etc/named.conf

        listen-on port 53 { any; };

        allow-query     { any; };

[[email protected] ~]# vim/etc/named.rfc1912.zones

zone "ldc.cn"IN {

        type master;

        file "ldc.cn.zone";

        allow-update { none; };

};

[[email protected] ~]# vim/var/named/ldc.cn.zone

$TTL    86400

@       IN     SOA     vh01.ldc.cn.   root.ldc.cn. (

                                20170801

                                3H

                                15M

                                1W

                                1D )

        IN     NS      vh01

$generate       1-9    vh0$    IN      A      192.168.4.$

$generate       10-254 vh$     IN      A      192.168.4.$

[[email protected] ~]# chmod 640/var/named/ldc.cn.zone

[[email protected] ~]# chgrpnamed /var/named/ldc.cn.zone

[[email protected] ~]# systemctlstart named; systemctl enable named

检查语法

[[email protected] ~]#named-checkconf /etc/named.rfc1912.zones

[[email protected] ~]#named-checkzone ldc.cn /var/named/ldc.cn.zone

[[email protected] ~]# nslookupvh201.ldc.cn

 

NTP:网络时间协议

[[email protected] ~]# yum install-y ntp

[[email protected] ~]# vim/etc/ntp.conf

restrict 192.168.4.0 mask255.255.255.0 nomodify

server 127.127.1.0 iburst

fudge 127.127.1.0 stratum3

[[email protected] ~]# systemctlstart ntpd; systemctl enable ntpd

vh02上同步时间

[[email protected] ~]# date -s"2017-08-21 12:00:00"

[[email protected] ~]# ntpdate192.168.4.1

 

配置openstack

1、为vh02配置IP地址

eth0: 192.168.4.2/24  dns: 192.168.4.1

eth1: 192.168.2.2/24

2、关闭NetworkManager服务

[[email protected] ~]# systemctlstop NetworkManager

[[email protected] ~]# systemctldisable NetworkManager

3、创建名为cinder-volumes的卷组,用于提供云硬盘

[[email protected] ~]# pvcreate/dev/vdb

[[email protected] ~]# vgcreatecinder-volumes /dev/vdb

[[email protected] ~]# vgs

4、导入rabbitmq的签名信息(如果连接互联网,可跳过)

[[email protected] openstack]#rpm --import rabbitmq-signing-key-public.asc

5、安装光盘上不存在的依赖包

[[email protected] rpms]# yuminstall -y *rpm

-----------------------------------------

 

-----------------------------------------

6、安装packstack

[[email protected] rpms]# yuminstall -y openstack-packstack

7、生成自动应答文件,并编辑

[[email protected] ~]# packstack--gen-answer-file answer.txt

[[email protected] ~]# vimanswer.txt

CONFIG_DEFAULT_PASSWORD=redhat

CONFIG_SWIFT_INSTALL=n

CONFIG_NTP_SERVERS=192.168.4.1

CONFIG_COMPUTE_HOSTS=192.168.4.2

CONFIG_KEYSTONE_ADMIN_PW=redhat

CONFIG_CINDER_VOLUMES_CREATE=n

CONFIG_NEUTRON_ML2_VXLAN_GROUP=239.1.1.2

CONFIG_NEUTRON_ML2_VNI_RANGES=1001:2000

CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex

CONFIG_NEUTRON_OVS_TUNNEL_IF=eth1

CONFIG_PROVISION_DEMO=n

8、安装openstack

[[email protected] ~]# packstack--answer-file answer.txt

9、配置虚拟网络,使得物理网卡成为虚拟交换机上的一个端口

[[email protected] ~]# cd/etc/sysconfig/network-scripts/

[[email protected]]# cp ifcfg-eth0 ifcfg-br-ex

TYPE=OVSBridge

BOOTPROTO=none

NAME=br-ex

DEVICE=br-ex

ONBOOT=yes

IPADDR=192.168.4.2

PREFIX=24

DNS1=192.168.4.1

DEVICETYPE=ovs

[[email protected]]# vim ifcfg-eth0

TYPE=OVSPort

DEVICETYPE=ovs

OVS_BRIDGE=br-ex

BOOTPROTO=none

NAME=eth0

DEVICE=eth0

ONBOOT=yes

[[email protected] ~]# systemctl restart network


本文出自 “13198972” 博客,请务必保留此出处http://13208972.blog.51cto.com/13198972/1971270

以上是关于linux 7.2 安装openstack 过程出现rabbitmq-server 错误解决方法的主要内容,如果未能解决你的问题,请参考以下文章

CentOS7.2下一键安装Openstack

中小企业openstack私有云布署实践7.2 keystone + memcache (办公网环境)

Redhat-7.2 Linux系统安装教程

(make)环境搭建 Linux下安装禅道和Ecshop

devstack安装openstack newton版本

CentOS 7.2 安装 Oracle 11g 报错:Error in invoking targ