分享

Keystone,Horizon - tmpfs加速你的OpenStack

xioaxu790 2015-2-4 20:12:41 发表于 知识型 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 12672
问题导读
1、什么是tmpfs?
2、如何加速Keystone,Horizon?
3、如何存储虚拟内存数据?





我的环境:
openstack版本:icehouse
os : centos6.5 x86_64

tmpfs简介
系统启动时会将tmpfs挂载到 /dev/shm下,看这里
  1. [root@controller1 ~]# cat /etc/fstab
  2. tmpfs                   /dev/shm                tmpfs   defaults        0 0
复制代码


tmpfs和ramdisk的区别
相同点:都可以使用RAM
不同点:tmpfs是文件系统;ramdisk是块设备,使用块设备每次都得先格式化

具体应用
  1. [root@controller3 ~]# mkdir -p /dev/shm/tmp   # 在/dev/shm目录创建一个tmp目录
  2. [root@controller3 ~]# chmod 1777 /dev/shm/tmp
  3. [root@controller3 ~]# mount --bind /dev/shm/tmp /tmp  #  与实际tmp目录绑定
复制代码



1   /tmp目录是keystone默认为openstack各大组件签证的目录
  1. [root@controller1 ~]# ll /tmp/      
  2. total 0
  3. drwx------ 2 neutron    neutron    100 Oct  6 15:52 keystone-signing-ISneL_
  4. drwx------ 2 glance     glance     100 Oct  6 15:52 keystone-signing-L9P1nI
  5. drwx------ 2 nova       nova       100 Oct  6 15:52 keystone-signing-UB328h
  6. drwx------ 2 ceilometer ceilometer 100 Oct  6 15:53 keystone-signing-Y4YIPp
  7. drwx------ 2 ceilometer ceilometer 100 Oct  6 15:48 keystone-signing-yVI_hQ
  8. drwx------ 2 glance     glance     100 Oct  6 15:52 keystone-signing-ZH5adK
复制代码


2    horizon的LOCAL_PATH是/tmp目录
  1. [root@controller3 ~]# vim /etc/openstack-dashboard/local_settings  # 编辑dashboard配置文件
  2. LOCAL_PATH = '/tmp'   
  3. [root@controller3 ~]# vim /etc/rc.local   # 避免开机失去与/tmp目录的绑定,编辑rc.local,添加如下内容
  4. /bin/mount --bind /dev/shm/tmp /tmp
复制代码


还需注意的是tmpfs数据在系统重新启动后不会保留,因为虚拟内存本质上就是易失的,所以有些数据需要保留的,还需自己写一些脚本来实现。

本文转载自:http://iceyao.blog.51cto.com/9426658/1560828

没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条