首页 文章 精选 留言 我的

精选列表

搜索[Docker部署],共10000篇文章
优秀的个人博客,低调大师

印度Tata通信部署全球最大物联网网络

印度塔塔通信(Tata)正在新德里、 孟买和班加罗尔城建设第一张物联网(IOT)网络。 该网络建成后将连接数以百万计的设备。塔塔声称,一旦建网完成,它将成为世界最大的物联网网络。 基于开放的LoRa平台 塔塔通信市场营销副总裁阿密特·辛哈·罗伊(Amit Sinha Roy)表示,“我们正使用基于LoRa技术的低功耗、广域网技术连接设备。该技术是目前交互操作以及运转效率较高的技术。” LoRa被视为比竞争对手LPWAN的Sigfox和Ingenu更开放的技术,已经获得了包括布依格(Bouygues)电信公司、思科、IBM和Orange的支持。 然而,有批评者对其开放性提出了质疑,该技术的知识产权全部由美国芯片制造商Semtech集团控制。移动巨头沃达丰已经决定支持另一个物联网标准——LPWAN,以此来发展其物联网。 相比之下,塔塔预计将用LoRa网络覆盖全国近4亿人口,并于半年前启动该项目。根据早期反馈情况,预计将可以覆盖全国。 辛哈表示,“传统的模式正在发生改变,我们需要考虑物联网带来的收益情况。”作为一项新技术,LoRa面临技术标准与规范问题。 更广义地说,物联网将成为服务商新的增长点。市场调研公司Gartner估计,到2020年,全球将于250亿设备互相连接。本文转自d1net(转载)

优秀的个人博客,低调大师

塔塔通信通过LoRa部署全球最大IoT网络

该网络将实现百万设备的连接。塔塔通信表示,一旦建成,该网络将成为全球最大的IoT网络。 塔塔通信市场营销和战略副总裁Amit Sinha Roy表示:“我们正在使用基于LoRa技术的低功耗广域网(LPWAN)连接设备和IoT应用。我们之所以使用LoRa技术,是因为互操作性对于物联网网络的高效运转至关重要。” LoRa被视为一个比LPWAN竞争对手如Sigfox和Ingenu等更“开放”的技术,并且得到了包括Bouygues Telecom、思科、IBM以及Orange在内的公司的支持。 但是有批评者质疑其“开放性”,指出LoRa的知识产权全部由美国芯片厂商Semtech集团控制。移动巨头沃达丰集团已决定将凭借NB-IoT—新兴的蜂窝标准来支持LPWAN的发展。 相比之下,塔塔通信计划通过构建LoRa网络覆盖印度近4亿人口,并且已经在六个月前就开始了LoRa项目。塔塔通信表示,根据早期反馈,LoRa将可能在全国范围内使用。 Sinha表示:“传统的模式正在发生变化,物联网的用例和营收模式也需要不断演变。” 作为一项新技术,LoRa面临着不少标准和规范问题。 更广泛的说,物联网正成为服务供应商主要增长区域。有市场调研公司就预测2020年,全球将有250亿相互连接的设备。本文转自d1net(转载)

优秀的个人博客,低调大师

2分钟教你玩转Tengine编译安装部署

Tengine部分特性 nginx -m 查看所有已经加载的模块,static说明已经安装的,shared说明是动态安装的; nginx架构是模块化的,除了主模块,其他模块都需在安装时进行编译安装,也可在安装后进行编译安装; tengine完全兼容nginx的配置; tengine实现动态加载模块,不需重新编译,就可以实现安装新的模块。动态模块功能会被默认安装。而nginx不支持模块动态加载,需要编译重启; 首先下载tengine-2.2.0.tar.gz;下载链接:http://pan.baidu.com/s/1jI7cycm密码:ig6x #安装编译所需环境: yumgroupinstall"developmentTools""ServerPlatformDevelopment"-y #安装编译所需的扩展模块: yum-yinstallzlib-develpcre-developenssl-devel #注释 zlib-devel扩展模块:支持压缩 pcre-devel扩展模块:支持url重写,pool扩展 openssl-devel扩展模块:支持https协议 #查看编译所支持的模块(个别常用的): [root@mengtengine-2.2.0]#./configure--help|less --prefix=PATHsetinstallationprefix#指定安装路径 --sbin-path=PATHsetnginxbinarypathname#nginx二进制启动脚本路径 --conf-path=PATHsetnginx.confpathname#conf配置文件路径 --error-log-path=PATHseterrorlogpathname#错误日志路径 --pid-path=PATHsetnginx.pidpathname#pid存放路径 --lock-path=PATHsetnginx.lockpathname#锁文件存放路径 --without-httpdisableHTTPserver#提供http服务,默认开启 --without-http-cachedisableHTTPcache#提供http缓存服务,默认开启 --without-http_stub_status_moduledisablengx_http_stub_status_module#ngixn自带的状态页面,默认关闭 --with-http_gzip_static_moduleenablengx_http_gzip_static_module#压缩木块 编译安装tengine: [root@mengtengine-2.2.0]#./configure--prefix=/usr/local/nginx--sbin-path=/usr/local/nginx/sbin/nginx--conf-path=/usr/local/nginx/conf/nginx.conf--error-log-path=/usr/local/nginx/log/error.log--http-log-path=/usr/local/nginx/log/access.log--pid-path=/usr/local/nginx/nginx.pid--lock-path=/usr/local/nginx/lock/nginx.lock--user=nginx--group=nginx--with-http_ssl_module--with-http_flv_module--with-http_stub_status_module--with-http_gzip_static_module #开启4个进程编译安装: [root@mengtengine-2.2.0]#make-j4&&makeinstall 配置文件部分: #修改nginx.conf文件中的http模块的配置,原有的文件可以mv做个备份。 vimnginx.conf userroot; worker_processes4; error_log/usr/local/nginx/log/error.log; pid/usr/local/nginx/log/nginx.pid; events{ worker_connections10240; useepoll; } http{ includemime.types; default_typeapplication/octet-stream; log_formatmain'$remote_addr-$remote_user[$time_local]$server_name"$request"' '$status$body_bytes_sent"$http_referer"' '"$http_user_agent""$http_x_forwarded_for""time:$request_time"'; access_log/usr/local/nginx/log/access.logmain; client_max_body_size500m; sendfileon; keepalive_timeout300; gzipon; gzip_disable"msie6"; gzip_proxiedany; gzip_min_length2048; gzip_comp_level4; gzip_typestext/plainapplication/x-javascriptapplication/javascripttext/javascripttext/cssapplication/xmlapplication/jsonp_w_picpath/jpegp_w_picpath/gifp_w_picpath/png; include/usr/local/nginx/conf/conf.d/*.conf; includeconf.d/*.conf;#当然也可以改为相对路径 } #nginx启动脚本,拷贝nginx的或者网上复制一份启动脚本,自己修改下。如下 [root@meng~]#cat/etc/init.d/nginx #!/bin/bash # #nginx-thisscriptstartsandstopsthenginxdaemon # #chkconfig:-8515 #description:NginxisanHTTP(S)server,HTTP(S)reverse #proxyandIMAP/POP3proxyserver #processname:nginx #config:/etc/nginx/nginx.conf #config:/etc/sysconfig/nginx #pidfile:/var/run/nginx.pid #Sourcefunctionlibrary. ./etc/rc.d/init.d/functions #Sourcenetworkingconfiguration. ./etc/sysconfig/network #Checkthatnetworkingisup. ["$NETWORKING"="no"]&&exit0 TENGINE_HOME="/usr/local/nginx/" nginx=$TENGINE_HOME"sbin/nginx" prog=$(basename$nginx) NGINX_CONF_FILE=$TENGINE_HOME"conf/nginx.conf" [-f/etc/sysconfig/nginx]&&/etc/sysconfig/nginx lockfile=/usr/local/nginx/lock/nginx.lock start(){ [-x$nginx]||exit5 [-f$NGINX_CONF_FILE]||exit6 echo-n$"Starting$prog:" daemon$nginx-c$NGINX_CONF_FILE retval=$? echo [$retval-eq0]&&touch$lockfile return$retval } stop(){ echo-n$"Stopping$prog:" killproc$prog-QUIT retval=$? echo [$retval-eq0]&&rm-f$lockfile return$retval killall-9nginx } restart(){ configtest||return$? stop sleep1 start } reload(){ configtest||return$? echo-n$"Reloading$prog:" killproc$nginx-HUP RETVAL=$? echo } force_reload(){ restart } configtest(){ $nginx-t-c$NGINX_CONF_FILE } rh_status(){ status$prog } rh_status_q(){ rh_status>/dev/null2>&1 } case"$1"in start) rh_status_q&&exit0 $1 ;; stop) rh_status_q||exit0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q||exit7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q||exit0 ;; *) echo$"Usage:$0{start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit2 esac #提示锁目录文件不存在 [root@meng~]#servicenginxstart 正在启动nginx:[确定] touch:无法创建"/usr/local/nginx/lock/nginx.lock":没有那个文件或目录 #创建锁目录,重新启动nginx [root@meng~]#mkdir/usr/local/nginx/lock/ [root@meng~]#servicenginxrestart nginx:theconfigurationfile/usr/local/nginx/conf/nginx.confsyntaxisok nginx:configurationfile/usr/local/nginx/conf/nginx.conftestissuccessful 停止nginx:[确定] 正在启动nginx:[确定] #创建一个静态web服务器: [root@mengconf.d]#catstatic.conf server{ listen80default_server; server_name_; location/{ root/data/company/; indexindex.htmlindex.htm; } } server{ listen81default_server; server_name_; location/{ root/data/www/; indexindex.htmlindex.htm; } } server{ listen82default_server; server_name_; location/{ root/data/meng/; indexindex.htmlindex.htm; } } #创建静态资源目录: mkdir/data/meng #创建一个index.html页面。 [root@mengmeng]#catindex.html 192.168.121.128 #通过浏览器访问: 到此编译安装配置完成。

优秀的个人博客,低调大师

openstack 管理二十八 - rpm 方式部署 openstack [keystone]

说明 1 keystone 数据存储至 mariadb 中 2 keystone 主要为 nova, neutron, cinder 等组件提供数据认证服务, 3 keystone 自身管理 user, tenant, service, endpoint 等重要信息 安装 yum install -y openstack-keystone.noarch openstack-keystone-doc.noarch python-keystone.noarch python-keystoneclient.noarch python-keystoneclient-doc.noarch python-keyring openstack-utils 配置 直接配置 token # SERVICE_TOKEN=1wef2djdf98324jkl # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT admin_token $SERVICE_TOKEN 强制更新 token 并删除旧 token # keystone-manage token_flush 直接配置 keystone 的数据库连接方法 # openstack-config --set /etc/keystone/keystone.conf database sql_connection mysql://keystone:test123@240.10.130.25/keystone keystone 服务器设定 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT public_bind_host 240.10.130.25 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT admin_bind_host 240.10.130.25 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT compute_port 8774 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT admin_port 35357 # openstack-config --set /etc/keysto ne/keystone.conf DEFAULT public_port 5000 keystone 存储格式定义 # openstack-config --set /etc/keysto ne/keystone.conf signing token_format UUID # openstack-config --set /etc/keystone/keystone.conf token provider keystone.token.providers.uuid.Provider 启动 keystone 服务 # service openstack-keystone start 创建相应数据库表 # keystone-manage db_sync 假如连接成功, 则自动创建下面表 mysql> use keystone; mysql> show tables; +-----------------------+ | Tables_in_keystone | +-----------------------+ | assignment | | credential | | domain | | endpoint | | group | | migrate_version | | policy | | project | | region | | role | | service | | token | | trust | | trust_role | | user | | user_group_membership | +-----------------------+ 16 rows in set (0.00 sec) keystone 客户端安装 要连接 keystone 需要安装 python-keystoneclient yum install -y python-keystoneclient 创建测试 tenant 与 admin tenant 参考 /etc/keystone/keystone.conf 中自定义的 token 与 admin_bind_host 参考, 对应下面 endpoint 与 token 值 # export ENDPOINT=240.10.130.25 # export SERVICE_TOKEN=1wef2djdf98324jkl # export SERVICE_ENDPOINT=http://${ENDPOINT}:35357/v2.0 创建 tenant 测试 [root@hh-yun-compute-130025 ~]# keystone tenant-create --name cookbook --description "Default Cookbook Tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Default Cookbook Tenant | | enabled | True | | id | c74de0a2760343ac93f27095023be1cd | | name | cookbook | +-------------+----------------------------------+ 检测 tenant 信息 [root@hh-yun-compute-130025 ~]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | c74de0a2760343ac93f27095023be1cd | cookbook | True | +----------------------------------+----------+---------+ 另外, 我们必须要创建一个 admin 的 tenant, admin 环境才能够保证用户具有完整的环境 [root@hh-yun-compute-130025 ~]# keystone tenant-create --name admin --description "Admin tenant" --enabled true +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Admin tenant | | enabled | True | | id | 59728cade8b14853a8d3cee8c2567881 | | name | admin | +-------------+----------------------------------+ [root@hh-yun-compute-130025 ~]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | 59728cade8b14853a8d3cee8c2567881 | admin | True | | c74de0a2760343ac93f27095023be1cd | cookbook | True | +----------------------------------+----------+---------+ 配置 keystone 角色 1 role 是用户在 tenant 下的权限的体现 2 常见有 admin 与 member 两种角色 注意: /etc/keystone/policy.json 定义了管理员角色 “admin_required”: “role:admin or is_admin:1”, 从 /etc/keystone/keystone.conf 下获得 keystone 认证信息 # export ENDPOINT=240.10.130.25 # export SERVICE_TOKEN=1wef2djdf98324jkl # export SERVICE_ENDPOINT=http://${ENDPOINT}:35357/v2.0 创建 admin 角色 # keystone role-create --name admin 创建 member 角色 # keystone role-create --name Member (旧版) # keystone role-create --name _member_ ( i 版) 利用 keystone 创建用户 1. 查询 tenant [root@hh-yun-compute-130025 ~]# keystone tenant-list +----------------------------------+----------+---------+ | id | name | enabled | +----------------------------------+----------+---------+ | 59728cade8b14853a8d3cee8c2567881 | admin | True | | c74de0a2760343ac93f27095023be1cd | cookbook | True | +----------------------------------+----------+---------+ 2. 创建 admin 用户 [root@hh-yun-compute-130025 ~]# keystone user-create --name admin --tenant cookbook --pass test123 --email terry.zeng@vipshop.com --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | terry.zeng@vipshop.com | | enabled | True | | id | 43f38bc5c1314670b0cf1d925736ff3a | | name | admin | | tenantId | c74de0a2760343ac93f27095023be1cd | | username | admin | +----------+----------------------------------+ 3. 查询角色 [root@hh-yun-compute-130025 ~]# keystone role-list +----------------------------------+----------+ | id | name | +----------------------------------+----------+ | 9fe2ff9ee4384b1894a90878d3e92bab | _member_ | | 6ddaf6bbd9684a109ecf83f7939bcf94 | admin | +----------------------------------+----------+ 4. 查询用户 [root@hh-yun-compute-130025 ~]# keystone user-list +----------------------------------+-------+---------+------------------------+ | id | name | enabled | email | +----------------------------------+-------+---------+------------------------+ | 43f38bc5c1314670b0cf1d925736ff3a | admin | True | terry.zeng@vipshop.com | +----------------------------------+-------+---------+------------------------+ 5. 指定用户新的 tenant 角色 [root@hh-yun-compute-130025 ~]# keystone user-role-add --user admin --role admin --tenant admin 参考 为 cookbook tenant 授权 demo 为管理员 [root@hh-yun-compute-130025 ~]# keystone user-create --name demo --tenant cookbook --pass test123 --email demo@localhost --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | demo@localhost | | enabled | True | | id | a57b848ff4244b98be66ef8f133fc9ce | | name | demo | | tenantId | c74de0a2760343ac93f27095023be1cd | | username | demo | +----------+----------------------------------+ [root@hh-yun-compute-130025 ~]# keystone user-role-add --user demo --role admin --tenant cookbook service 定义 1 云环境中每个服务都运行在一个特定的 url 下, 成为 endpoint 地址 2 客户端连接 openstack 环境时候, 允许 openstack 身份验证服务, 这个服务将返回 用户可以访问的 endpoint url 要启用上述功能, 我们需要定义 endpoint, 1 云环境下, 我们可以定义多个区域, 不同区域可以跑在不同的数据中心中 2 在 openstack 身份认证服务下不同区域由不同的 ip 及 urls 进行指定 3 当我们只有一个独立环境时候, 我们配置为 RegionOne 下面是openstack i 版需要定义的服务 endpoint 1. 定义 nova keystone service-create --name nova --type compute --description 'OpenStack Compute Service' 2. 定义 nova_ec2 (旧版本叫 ec2) keystone service-create --name nova_ec2 --type ec2 --description 'EC2 Service' 3. 定义 glance 服务 keystone service-create --name glance --type image --description 'OpenStack Image Service' 4. 定义 cinder 服务 keystone service-create --name cinder --type volume --description 'Cinder Service' 5. 定义 cinder_v2 keystone service-create --name cinder_v2 --type volume2 --description 'Cinder Service v2' 6. 定义 keystone keystone service-create --name keystone --type identity --description 'OpenStack Identity Service' 7. 定义 neutron keystone service-create --name neutron --type network --description 'Neutron Networking Service' 定义 endpoint Openstack 身份服务可以配置三种服务请求方法 1 public Url (针对最终用户) 2 administration Url (具有管理权限的用户, 可以与 public url 使用不同的地址) 3 internal Url (使用在一个专用网络上, 与公网隔离) 当前品云使这种方式, 同时调用 eth1 作为组件间通讯方法 当服务定义后, 我们可以为服务添加 endpoint urls, 参考命令语法 [root@hh-yun-compute-130025 ~]# keystone endpoint-create usage: keystone endpoint-create [--region <endpoint-region>] --service <service> --publicurl <public-url> [--adminurl <admin-url>] [--internalurl <internal-url>] 定义 nova endpoint # PUBLIC="http://240.10.130.30:8774/v2/\$(tenant_id)s" # keystone endpoint-create --region RegionOne --service nova --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+--------------------------------------------+ | Property | Value | +-------------+--------------------------------------------+ | adminurl | http://240.10.130.30:8774/v2/$(tenant_id)s | | id | fe31d81f395f46e39dd2e3ba9276c4ba | | internalurl | http://240.10.130.30:8774/v2/$(tenant_id)s | | publicurl | http://240.10.130.30:8774/v2/$(tenant_id)s | | region | RegionOne | | service_id | 38df11244f3e42698f3c123cc89e9a82 | +-------------+--------------------------------------------+ 定义 nova_ec2 endpoint # PUBLIC="http://240.10.130.30:8773/services/Cloud" # ADMIN="http://240.10.130.30:8773/services/Admin" # INTERNAL=$PUBLIC # keystone endpoint-create --region RegionOne --service_id nova_ec2 --publicurl $PUBLIC --adminurl $ADMIN --internalurl $INTERNAL +-------------+------------------------------------------+ | Property | Value | +-------------+------------------------------------------+ | adminurl | http://240.10.130.30:8773/services/Admin | | id | a835a2aeba444692b215136e641a9e5c | | internalurl | http://240.10.130.30:8773/services/Cloud | | publicurl | http://240.10.130.30:8773/services/Cloud | | region | RegionOne | | service_id | 18cbe76bbcab479595d90d7a50b7dcdf | +-------------+------------------------------------------+ 定义 glance endpoint # PUBLIC="http://240.10.130.25:9292/v1" # keystone endpoint-create --region RegionOne --service_id glance --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://240.10.130.25:9292/v1 | | id | b3773df6ad2643fa84c6cae71a7a71cc | | internalurl | http://240.10.130.25:9292/v1 | | publicurl | http://240.10.130.25:9292/v1 | | region | RegionOne | | service_id | d23d46ad40bd4fc89c9c88118acedf75 | +-------------+----------------------------------+ 定义 cinder endpoint # PUBLIC="http://240.10.130.25:8776/v1/%(tenant_id)s" # keystone endpoint-create --region RegionOne --service_id cinder --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+--------------------------------------------+ | Property | Value | +-------------+--------------------------------------------+ | adminurl | http://240.10.130.25:8776/v1/%(tenant_id)s | | id | 044bc4aeb52e4ddd9b60984b82f1a619 | | internalurl | http://240.10.130.25:8776/v1/%(tenant_id)s | | publicurl | http://240.10.130.25:8776/v1/%(tenant_id)s | | region | RegionOne | | service_id | eb92fe7081394648ae9cc25eec0713d7 | +-------------+--------------------------------------------+ 定义 cinder_v2 endpoint # PUBLIC="http://240.10.130.25:8776/v2/%(tenant_id)s" # keystone endpoint-create --region RegionOne --service_id cinder_v2 --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+--------------------------------------------+ | Property | Value | +-------------+--------------------------------------------+ | adminurl | http://240.10.130.25:8776/v2/%(tenant_id)s | | id | a4f434470e364ff89030d2919eb39c86 | | internalurl | http://240.10.130.25:8776/v2/%(tenant_id)s | | publicurl | http://240.10.130.25:8776/v2/%(tenant_id)s | | region | RegionOne | | service_id | 63376b37779846eba1f4a96aa142ba94 | +-------------+--------------------------------------------+ 定义keystone endpoint # PUBLIC="http://240.10.130.25:5000/v2.0" # ADMIN="http://240.10.130.25:35357/v2.0" # INTERNAL=$PUBLIC # keystone endpoint-create --region RegionOne --service_id keystone --publicurl $PUBLIC --adminurl $ADMIN --internalurl $INTERNAL +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://240.10.130.25:35357/v2.0 | | id | 047b73ba968d41d98ea707ca51f1db33 | | internalurl | http://240.10.130.25:5000/v2.0 | | publicurl | http://240.10.130.25:5000/v2.0 | | region | RegionOne | | service_id | 96dba0ee5a154727843cd975f4ce5e29 | +-------------+----------------------------------+ 定义 neutron endpoint # PUBLIC="http://240.10.130.29:9696/" # keystone endpoint-create --region RegionOne --service_id neutron --publicurl $PUBLIC --adminurl $PUBLIC --internalurl $PUBLIC +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://240.10.130.29:9696/ | | id | 52f34a0e1f0446c3b0683a330b1a1ce4 | | internalurl | http://240.10.130.29:9696/ | | publicurl | http://240.10.130.29:9696/ | | region | RegionOne | | service_id | 7123d8111fa14e06a59b757c3a78901f | +-------------+----------------------------------+ 创建 service tenant 需要创建 service tenant, 用于允许上述服务在 openstack 中运行 并创建对应服务的用户密码并对应 service tenant ### 注意, 品云使用 services 作为 tenant 区别不大 ### 用户创建方法与普通创建方法一样, 并分配至 service tenant 中 创建 service tenant # keystone tenant-create --name service --description "Service Tenant" --enabled true 创建用户 # keystone user-create --name nova --pass nova --tenant service --email nova@localhost --enabled true # keystone user-create --name glance --pass glance --tenant service --email glance@localhost --enabled true # keystone user-create --name keystone --pass keystone --tenant service --email keystone@localhost --enabled true # keystone user-create --name cinder --pass cinder --tenant service --email cinder@localhost --enabled true # keystone user-create --name neutron --pass neutron --tenant service --email neutron@localhost --enabled true 修改用户角色 # keystone user-role-add --user nova --role admin --tenant service # keystone user-role-add --user glance --role admin --tenant service # keystone user-role-add --user keystone --role admin --tenant service # keystone user-role-add --user cinder --role admin --tenant service # keystone user-role-add --user neutron --role admin --tenant service

优秀的个人博客,低调大师

openstack 管理二十九 - rpm 方式部署 openstack [glance]

作用 1 glance 主要用于管理云主机镜像 2 glance 需要进行 keystone 验证 3 在第一次云主机创建时候, 把镜像从 glance server 传输至 compute 组件中 安装 yum install -y openstack-glance.noarch openstack-glance-doc.noarch python-glance.noarch python-glanceclient.noarch python-glanceclient-doc.noarch openstack-utils glance 连接 db 数据库连接配置 # openstack-config --set /etc/glance/glance-api.conf DEFAULT sql_connection mysql://glance:glance@240.10.130.25/glance # openstack-config --set /etc/glance/glance-api.conf DEFAULT sql_idle_timeout 3600 # openstack-config --set /etc/glance/glance-registry.conf DEFAULT sql_connection mysql://glance:glance@240.10.130.25/glance # openstack-config --set /etc/glance/glance-registry.conf DEFAULT sql_idle_timeout 3600 glance 连接 keystone 配置 /etc/glance/glance-api.conf # openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_host 240.10.130.25 # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_port 35357 # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_protocol http # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name services # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance # openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password glance 配置 /etc/glance/glance-registry.conf # openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_host 240.10.130.25 # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_port 35357 # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_protocol http # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name services # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance # openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password glance # openstack-config --set /etc/glance/glance-registry.conf paste_deploy config_file /etc/glance/glance-api-paste.ini # openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone 配置 /etc/glance/glance-api-paste.ini # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken admin_tenant_name service # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken admin_user glance # openstack-config --set /etc/glance/glance-api-paste.ini filter:authtoken admin_password glance 配置 /etc/glance/glance-registry-paste.ini # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken paste.filter_factory keystoneclient.middleware.auth_token:filter_factory # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken admin_tenant_name service # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken admin_user glance # openstack-config --set /etc/glance/glance-registry-paste.ini filter:authtoken admin_password glance 启动 glance # service openstack-glance-registry restart # service openstack-glance-api restart 初始化 glance 数据 # glance-manage version_control 0 # glance-manage db_sync 成功后, 自动在 mysql 数据库下创建 glance.* 表 mysql> use glance; Database changed mysql> show tables; +------------------+ | Tables_in_glance | +------------------+ | image_locations | | image_members | | image_properties | | image_tags | | images | | migrate_version | | task_info | | tasks | +------------------+ 8 rows in set (0.00 sec) glance 客户端安装 # yum install -y python-glanceclient.noarch python-glanceclient-doc.noarch 管理 glance [root@hh-yun-compute-130025 ~(keystone_cookbook)]# cat keystonerc_cookbook export OS_USERNAME=admin export OS_TENANT_NAME=cookbook export OS_PASSWORD=test123 export OS_NO_CACHE=1 export OS_AUTH_URL=http://240.10.130.25:35357/v2.0/ export PS1='[\u@\h \W(keystone_cookbook)]\$ ' 镜像管理 获得 centos5.8_x86_64_2.9.4.qcow2, 并上传 [root@hh-yun-compute-130025 ~(keystone_cookbook)]# glance image-list +----+------+-------------+------------------+------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +----+------+-------------+------------------+------+--------+ +----+------+-------------+------------------+------+--------+ # glance image-create --name='centos5.8' --disk-format=qcow2 --container-format=bare --is-public=True --file=./centos5.8_x86_64_2.9.4.qcow2 +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 1b957548077dc554915e82424d4c089a | | container_format | bare | | created_at | 2014-10-01T10:00:17 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | 438d5c5a-f595-45e5-8236-801b9da8f9ab | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | centos5.8 | | owner | c74de0a2760343ac93f27095023be1cd | | protected | False | | size | 460841984 | | status | active | | updated_at | 2014-10-01T10:00:19 | | virtual_size | None | +------------------+--------------------------------------+ [root@hh-yun-compute-130025 ~(keystone_cookbook)]# glance image-list +--------------------------------------+-----------+-------------+------------------+-----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+-----------+-------------+------------------+-----------+--------+ | 438d5c5a-f595-45e5-8236-801b9da8f9ab | centos5.8 | qcow2 | bare | 460841984 | active | +--------------------------------------+-----------+-------------+------------------+-----------+--------+ 利用下面命令能够把某些不公开的镜像分享至指定的 tenant 中 # glance [--can-share] member-create image-id tenant-id

优秀的个人博客,低调大师

openstack 管理二十六 - rpm 方式部署 openstack [mariadb]

目的 1. 配置 openstack 可用的 mariadb 2. mariadb 用于存储 openstack 中的所有信息 3. 暂不以高可用为目的 安装 yum install -y mariadb* 配置 必须要设定默认字符集为 utf8, 否则无法自动创建表 注 因测试环境, 暂无对 innodb 进行优化 /etc/my.cnf [mysql] default_character_set=utf8 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-name-resolve max_connections = 1000 character_set_server = utf8 user=mysql symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid 启动 service mysqld restart 验证 mysql 命令能够直接登入 mysql> 终端则可 创建用户 创建 keystone 用户 create database keystone character set utf8; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' identified by 'test123'; GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' identified by 'test123'; flush privileges; 创建 glance 用户 create database glance character set utf8; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' identified by 'glance'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' identified by 'glance'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'127.0.0.1' identified by 'glance'; flush privileges; 创建 cinder 用户 grant all on cinder.* to 'cinder'@'localhost' identified by 'cinder'; grant all on cinder.* to 'cinder'@'240.10.130.25' identified by 'cinder'; flush privileges; create databae cinder character set utf8; 创建 neutron 用户 create database neutron_ml2 character set utf8; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'%' identified by 'openstack'; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'localhost' identified by 'openstack'; GRANT ALL PRIVILEGES ON neutron_ml2.* TO 'neutron'@'127.0.0.1' identified by 'openstack'; flush privileges; 创建 nova 用户 CREATE DATABASE nova character set utf8; GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'openstack'; GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'openstack'; FLUSH PRIVILEGES;

优秀的个人博客,低调大师

openstack 管理二十七 - rpm 方式部署 openstack [rabbitmq]

目的 1. 配置 openstack 可用的 rabbitmq 2. rabbitmq 用于存储 openstack 消息队列 3. rabbitmq 作为数据存储中心 4. openstack i 版中, rabbitmq 为 cinder, nova, neutron 组件进行数据存储, 5. openstack h 版使用的是 qpid 进程, 经常出现进程队列堵塞现象, 导致无法创建新虚拟机 安装 yum install rabbitmq-server 启动 service rabbitmq-server start 配置 安装 rabbitmq 后, 默认创建 guest/guest 用户与密码, 可以利用下面方法修改密码 # rabbitmqctl change_password guest openstack Changing password for user "guest" ......done. 修改密码后, 为 cinder 添加虚拟主机 # rabbitmqctl add_vhost cinder Creating vhost "cinder" ......done. 为其他服务创建虚拟用户 # rabbitmqctl add_user cinder openstack Creating user "cinder" ......done. # rabbitmqctl add_user nova openstack Creating user "nova" ......done. # rabbitmqctl add_user neutron openstack Creating user "neutron" ......done. 为上述用户添加对资源的读写权限 # rabbitmqctl set_permissions cinder ".*" ".*" ".*" # rabbitmqctl set_permissions nova ".*" ".*" ".*" # rabbitmqctl set_permissions neutron ".*" ".*" ".*" 校验 可用下面命令进行信息校验 # rabbitmqctl report

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册
修改密码
忘记密码