Jul 232012
 

sed的用法一直记不住,到要用的时候,还要搜索。这次整理一下,也算是深入学习一下sed用法.

mysql让外面访问

把127.0.0.1 替换成0.0.0.0

sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf

NTP服务器设置

sed -i 's/server ntp.ubuntu.com/server ntp.ubuntu.com\nserver 127.127.1.0\nfudge 127.127.1.0 stratum 10/g' /etc/ntp.conf

keystone

注释掉sqlite这行

sed -i '/sqlite/s/^/#/' /etc/keystone/keystone.conf

在sqlite行下插入一行

sed -i '/sqlite/a\connection = mysql://keystone:password@10.1.199.17/keystone' \
/etc/keystone/keystone.conf

把默认的keystone的token: ADMIN 改成 chenshake

sed -i 's/ADMIN/chenshake/g' /etc/keystone/keystone.conf

  18 Responses to “Sed在Openstack安装的应用”

  1. 你好,请问下keystone service-delete怎么用?

  2. 现在又有个问题要请教下你了,$glance index

    Failed to show index. Got error:
    The request returned 500 Internal Server Error
    The response body:
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/eventlet/wsgi.py”, line 336, in handle_one_response
    result = self.application(self.environ, start_response)
    File “/usr/lib/python2.7/dist-packages/webob/dec.py”, line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
    ……..
    ServiceUnavailable: The request returned 503 Service Unavilable. This generally occurs on service overload or other transient outage.

  3. 现在又有个问题要请教下你了,$glance index

    Failed to show index. Got error:
    The request returned 500 Internal Server Error
    The response body:
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/eventlet/wsgi.py”, line 336, in handle_one_response
    result = self.application(self.environ, start_response)
    …………..
    ServiceUnavailable: The request returned 503 Service Unavilable. This generally occurs on service overload or other transient outage.

  4. 建议sed的分隔符不要总是用/,用#也很好用

  5. 记不住 sed vi 编辑命令, 都是用winscp sftp访问linux的全部目录, 并编辑、保存 任何配置文件, 在windows 上完成工作。

 Leave a Reply

(required)

(required)