next up previous contents
Next: Etcd Up: 環境準備 Previous: Message queue   Contents

Memcached

  1. OpenStack 使用 Memcached 做 cache tokens 暫存令牌,來進行服務的身份認證。memcached 服務通常運作在控制器節點上,安裝 memcached 服務。
    [root@ip112 ~]# yum install memcached python-memcached
    
  2. 編輯 /etc/sysconfig/memcached,修改 OPTIONS="-l 127.0.0.1,::1" 中 IP 為控制節點的 IP,讓其他節點可以存取。
    [root@ip112 ~]# vim /etc/sysconfig/memcached 
    [root@ip112 ~]# cat /etc/sysconfig/memcached 
    PORT="11211"
    USER="memcached"
    MAXCONN="1024"
    CACHESIZE="64"
    OPTIONS="-l 127.0.0.1,::1"
    
  3. 啟動 memcached,並設定開機啟動。
    [root@ip112 ~]# systemctl enable memcached.service 
    Created symlink from /etc/systemd/system/multi-user.target.wants/memcached.service 
    to /usr/lib/systemd/system/memcached.service.
    
    [root@ip112 ~]# systemctl start memcached.service 
    [root@ip112 ~]# systemctl status memcached.service 
    ● memcached.service - memcached daemon
       Loaded: loaded (/usr/lib/systemd/system/memcached.service; enabled; vendor preset: disabled)
       Active: active (running) since Wed 2018-05-23 17:15:58 CST; 6s ago
     Main PID: 13794 (memcached)
       CGroup: /system.slice/memcached.service
               └─13794 /usr/bin/memcached -p 11211 -u memcached -m 64 -c 1024 -l...
    
    May 23 17:15:58 ip112.csie.cyut.edu.tw systemd[1]: Started memcached daemon.
    May 23 17:15:58 ip112.csie.cyut.edu.tw systemd[1]: Starting memcached daemon...
    Hint: Some lines were ellipsized, use -l to show in full.
    



De-Yu Wang 2018-12-12