向日葵

拆开袋子看到里面向日葵的种子心里凉了半截,噗,这不就是瓜子啊,这怎么种的出来?然而不到一个星期苗儿就迫不及待的破土而出了。

5月25日,就是这一把瓜子 
 
5月29日,破土而出  
5月30日,迅猛增长 
6月1日,长势喜人 
6月2日,有一颗长得太高,歪了 ,是不是要准备一个支架?

  

未完…… 

RDO安装openstack遇到的一些问题(swift & mongodb)

2015年5月30日15:25:25

1.mongodb

Applying 172.16.43.182_mongodb.pp
172.16.43.182_mongodb.pp:                         [ ERROR ]
Applying Puppet manifests                         [ ERROR ]

ERROR : Error appeared during Puppet run: 172.16.43.182_mongodb.pp
Error: Unable to connect to mongodb server! (172.16.43.182:27017)

解决方法:

vim /usr/share/openstack-puppet/modules/mongodb/manifests/params.pp  

        # RedHat/CentOS doesn't come with a prepacked mongodb  
        # so we assume that you are using EPEL repository.  
        $config              = '/etc/mongod.conf'              #修改此行

2.swift

解决上面问题再次运行的时候遇到swift报错

Applying 172.16.43.182_ring_swift.pp
172.16.43.182_ring_swift.pp:                      [ ERROR ]
Applying Puppet manifests                         [ ERROR ]

ERROR : Error appeared during Puppet run: 172.16.43.182_ring_swift.pp
Error: Execution of '/usr/bin/swift-ring-builder /etc/swift/container.builder add r1z1-172.16.43.182:6001/swift_loopback 10.00' returned 2: Device 0 already uses 172.16.43.182:6001/swift.
You will find full trace in log /var/tmp/packstack/20150530-024816-X42iH8/manifests/172.16.43.182_ring_swift.pp.log

解决办法:

rm -f /etc/swift/*.builder
rm -f /etc/swift/*.ring.gz
rm -f /etc/swift/backups

持续更新……

rabbitmq:Error: unable to connect to node rabbit@localhost: nodedown

1.打开openstack报错,Error:Unable to retrieve instances.

11

猜想肯定是neutron的错误,查询neutron状态,果然没有起,手动启动也报错

3 4

2.查询neutron日志 /var/log/neutron/server.log 有如下错误:

2015-05-25 10:09:08.489 7123 ERROR oslo_messaging._drivers.impl_rabbit [-] AMQP server on 172.16.37.211:5672 is unreachable: [Errno 111] ECONNREFUSED. Trying again in 1 seconds.
2015-05-25 10:09:09.499 7123 DEBUG oslo_messaging._drivers.impl_rabbit [-] Received recoverable error from kombu: on_error /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/impl_rabbit.py:790

3.启动RabbitMQ的报错

2

4.搜索关键字:Error: unable to connect to node rabbit@localhost: nodedown

找到如下方法:

#systemctl enable rabbitmq-server.service
#systemctl start rabbitmq-server.service
#rabbitmqctl start_app

 

成功启动rabbitmq

5.启动neutrou-server,openstack恢复正常

# systemctl start neutron-server.service

 

python从日志文件中提取出现的ip

#coding:utf-8
'''
Created on 2015年4月13日

@author: Administrator
'''
fp = open('rootaccess.07log','r')
total_count = 0
ip_array = {}

for eachLine in fp:
    ip =  eachLine.split(" ")[0]
    if ip_array.has_key(ip):
        ip_array[ip] = ip_array[ip] + 1
    else:
        ip_array.setdefault(ip,1)
    total_count = total_count + 1

R=ip_array.items()
num = 0
for i in R:
    if i[1]>0:
        print i
        num+=1
print total_count
fp.close()

日志文件如下所示(160W+行),需要提取首行ip,并统计全部ip数,不包括重复的

116.233.77.238 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
61.170.251.177 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
101.86.33.55 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
114.86.53.187 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
180.155.104.206 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
114.88.209.25 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
180.164.251.133 - - [06/Apr/2015:23:59:59 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
116.230.55.212 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
114.95.223.230 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
101.229.143.32 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
114.92.56.189 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
116.230.118.3 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
180.157.88.191 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
124.77.20.187 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"
180.155.152.186 - - [07/Apr/2015:00:00:00 +0800] "POST /api/magicboxauth HTTP/1.1" 200 203 "-" "Apache-HttpClient/UNAVAILABLE (java 1.4)" "-"

 

 

如果需要提取全部的ip地址,linux一条命令可以达到要求,但是命令不是排除日志请求中的ip

# grep -Eo "([0-9]{1,3}\.){3}[0-9]{1,3}" xxx.log|sort|uniq -c