【八】Openstack-horizon-Dashboard

配置Openstack Dashboard

#https://docs.openstack.org/horizon/train/install/install-rdo.html
#1.Install the packages:
yum install -y openstack-dashboard
#2.Edit the /etc/openstack-dashboard/local_settings file and complete the following actions:
vim /etc/openstack-dashboard/local_settings
#Configure the dashboard to use OpenStack services on the controller node:
OPENSTACK_HOST = "192.168.40.101"
#Allow your hosts to access the dashboard:
ALLOWED_HOSTS = ['192.168.40.101', 'openstack-vip.xks.local']
#Configure the memcached session storage service
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

CACHES = {
    'default': {
         'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
         'LOCATION': 'openstack-vip.xks.local:11211',
    }
}
#Enable the Identity API version 3:
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
#Enable support for domains:
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
#Configure API versions:
OPENSTACK_API_VERSIONS = {
    "identity": 3,
    "image": 2,
    "volume": 3,
}
#Configure Default as the default domain for users that you create via the dashboard:
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = "Default"
#Configure user as the default role for users that you create via the dashboard:
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user"
#If you chose networking option 1, disable support for layer-3 networking services:
OPENSTACK_NEUTRON_NETWORK = {
    ...
    'enable_router': False,
    'enable_quotas': False,
    'enable_distributed_router': False,
    'enable_ha_router': False,
    'enable_lb': False,
    'enable_firewall': False,
    'enable_vpn': False,
    'enable_fip_topology_check': False,
}
#Optionally, configure the time zone:
TIME_ZONE = "Asia/Shanghai"

#添加配置段 否则访问不了管理端
WEBROOT = '/dashboard'


#3.Add the following line to /etc/httpd/conf.d/openstack-dashboard.conf if not included.
vim /etc/httpd/conf.d/openstack-dashboard.conf
    WSGIApplicationGroup %{GLOBAL}

#4.配置Haproxy代理-添加dashboard 代码块 
[root@openstack-haproxy1 ~]# cat /etc/haproxy/haproxy.cfg
listen openstack-dashboard-80
  bind 192.168.40.248:80
  mode tcp
  server 192.168.40.101 192.168.40.101:80 check inter 3s fall 3 rise 5
[root@openstack-haproxy1 ~]# systemctl restart haproxy

#Finalize installation-Restart the web server and session storage service:
systemctl restart httpd.service

#管理端访问
192.168.40.101/dashboard
openstack-vip.xks.local/dashboard - 前提做好域名解析 192.168.40.248 openstack-vip.xks.local

#登录账户密码
default、admin/admin

##查看缓存中的session数据
stats items #列出所有keys
    stats cachedump ID 0 #获取key的值,0表示全部列出
        get KEY_NAME #get 命令获取指定key的值
[root@openstack-controller1 ~]# telnet 192.168.40.248 11211
Trying 192.168.40.248...
Connected to 192.168.40.248.
Escape character is '^]'.
#stats items
STAT items:18:number 2
STAT items:18:number_hot 0
STAT items:18:number_warm 0
STAT items:18:number_cold 2
STAT items:18:age_hot 0
STAT items:18:age_warm 0
STAT items:18:age 51
STAT items:18:evicted 0
STAT items:18:evicted_nonzero 0
STAT items:18:evicted_time 0
STAT items:18:outofmemory 0
STAT items:18:tailrepairs 0
STAT items:18:reclaimed 788
STAT items:18:expired_unfetched 56
STAT items:18:evicted_unfetched 0
STAT items:18:evicted_active 0
STAT items:18:crawler_reclaimed 0
STAT items:18:crawler_items_checked 26
STAT items:18:lrutail_reflocked 1794
STAT items:18:moves_to_cold 3740
STAT items:18:moves_to_warm 3289
STAT items:18:moves_within_lru 963
STAT items:18:direct_reclaims 0
STAT items:18:hits_to_hot 2073
STAT items:18:hits_to_warm 4147
STAT items:18:hits_to_cold 7589
STAT items:18:hits_to_temp 0
STAT items:37:number 1
STAT items:37:number_hot 0
STAT items:37:number_warm 0
STAT items:37:number_cold 1
STAT items:37:age_hot 0
STAT items:37:age_warm 0
STAT items:37:age 38093
STAT items:37:evicted 0
STAT items:37:evicted_nonzero 0
STAT items:37:evicted_time 0
STAT items:37:outofmemory 0
STAT items:37:tailrepairs 0
STAT items:37:reclaimed 0
STAT items:37:expired_unfetched 0
STAT items:37:evicted_unfetched 0
STAT items:37:evicted_active 0
STAT items:37:crawler_reclaimed 0
STAT items:37:crawler_items_checked 0
STAT items:37:lrutail_reflocked 16
STAT items:37:moves_to_cold 27
STAT items:37:moves_to_warm 24
STAT items:37:moves_within_lru 0
STAT items:37:direct_reclaims 0
STAT items:37:hits_to_hot 5
STAT items:37:hits_to_warm 0
STAT items:37:hits_to_cold 30
STAT items:37:hits_to_temp 0
END
#stats cachedump 18 0
ITEM tokens/c0afa1bc395e9c5b876b583f4baa81dc364d025b56c2f1caea182b28f4d21215 [3832 b; 1690248889 s]
ITEM tokens/f85f4f79f8f6707695f062ee85767287b1d81a641450577e4a57494525e277e2 [3830 b; 1690248698 s]
END
get tokens/c0afa1bc395e9c5b876b583f4baa81dc364d025b56c2f1caea182b28f4d21215
VALUE tokens/c0afa1bc395e9c5b876b583f4baa81dc364d025b56c2f1caea182b28f4d21215 0 3832
{"token": {"is_domain": false, "methods": ["password"], "roles": [{"id": "f3e9b20506ab461b855f17f2a4ce74d8", "name": "member"}, {"id": "b2e30629783c4d3fb2694d82382efc54", "name": "admin"}, {"id": "1245a5e66b48425ba2a32d36b9b974ee", "name": "reader"}], "auth_token": "gAAAAABkvxhqhtcQ-zSc6ActJKK3gs4m1FGXhNil34HbSGvLA2fyUwcq0QTxVhwZ-SS3jyRhVo632PEcsmwvWF8ddO_eSySDdYWSP1mZKxpQDhPHPEmfpqCT5qs2-rYwqFcbXLoqvDnyOufikX0z2PZPj70E2mFWdvl6p_6GhpeVvbwpUZC1Cyg", "expires_at": "2023-07-25T01:33:46.000000Z", "project": {"domain": {"id": "default", "name": "Default"}, "id": "a2a6a13f8b2a4e828366eb5c208e3f87", "name": "service"}, "catalog": [{"endpoints": [{"url": "http://openstack-vip.xks.local:9696", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "d1a435bac0f3433085e4b42dab1557d5"}, {"url": "http://openstack-vip.xks.local:9696", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "ebf9df6d7a3f4657afff78b7140a37f8"}, {"url": "http://openstack-vip.xks.local:9696", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "f948d828723b4a2e85ea135caf275bb6"}], "type": "network", "id": "136177a135ec4761b391c077f29091c0", "name": "neutron"}, {"endpoints": [{"url": "http://openstack-vip.xks.local:8774/v2.1", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "36df7ee06e8e4a5fa4e3bd08051a9f88"}, {"url": "http://openstack-vip.xks.local:8774/v2.1", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "7f4a7baa344542cd9b5c33dbbd4521af"}, {"url": "http://openstack-vip.xks.local:8774/v2.1", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "f9971392a0b346dbaedae4edcaf3dcf1"}], "type": "compute", "id": "48efaf2b284a4aa1acd745b2a083cc8e", "name": "nova"}, {"endpoints": [{"url": "http://openstack-vip.xks.local:5000/v3/", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "1b27558f07784548a469ddda0c58131c"}, {"url": "http://openstack-vip.xks.local:5000/v3/", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "87bc41b7caf146409e6ec0d87744fd13"}, {"url": "http://openstack-vip.xks.local:5000/v3/", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "a878161f65d449f6863f59cd6a1bc2a6"}], "type": "identity", "id": "c615e0c6903344e69fb49a85859cdf64", "name": "keystone"}, {"endpoints": [{"url": "http://openstack-vip.xks.local:9292", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "42cbf7b421684f318513d762e79010fb"}, {"url": "http://openstack-vip.xks.local:9292", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "9a1203aadc7a41839fc7a7a52045e5fd"}, {"url": "http://openstack-vip.xks.local:9292", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "f0c0ba4d8fa74b9897b194de714de1b9"}], "type": "image", "id": "ccb31e2f5d4d432692f0b3d6b8722a71", "name": "glance"}, {"endpoints": [{"url": "http://openstack-vip.xks.local:8778", "interface": "admin", "region": "RegionOne", "region_id": "RegionOne", "id": "29abf49878c6417ea92e6e49d23d9888"}, {"url": "http://openstack-vip.xks.local:8778", "interface": "internal", "region": "RegionOne", "region_id": "RegionOne", "id": "29eb71325e7b48269fec6a8952799603"}, {"url": "http://openstack-vip.xks.local:8778", "interface": "public", "region": "RegionOne", "region_id": "RegionOne", "id": "68549b97df9e428aabbf4d2782c756d7"}], "type": "placement", "id": "e046d16a01f442938f34f718c3577a4d", "name": "placement"}], "version": "v3", "user": {"domain": {"id": "default", "name": "Default"}, "password_expires_at": null, "name": "placement", "id": "5dca9cd3913b483693e74613671faf42"}, "audit_ids": ["h7mucGLJSVO0lJyT3lUcEA"], "issued_at": "2023-07-25T00:33:46.000000Z"}}
END

posted @ 2023-07-24 16:54  しみずよしだ  阅读(57)  评论(0)    收藏  举报