首页 文章 精选 留言 我的

精选列表

搜索[GitHub后端],共10010篇文章
优秀的个人博客,低调大师

后端开发必备JavaScript函数

0 全局对象 decodeURIComponent() 定义和用法 decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。 语法 decodeURIComponent(URIstring) 返回值 URIstring 的副本,其中的十六进制转义序列将被它们表示的字符替换。 1 Array 对象 Array 对象用于在单个的变量中存储多个值。 join() 方法 2 String对象 indexOf() 定义和用法 indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置。 语法stringObject.indexOf(searchvalue,fromindex) 说明 该方法将从头到尾地检索字符串 stringObject,看它是否含有子串 searchvalue。开始检索的位置在字符串的 fromindex 处或字符串的开头(没有指定 fromindex 时)。如果找到一个 searchvalue,则返回 searchvalue 的第一次出现的位置。stringObject 中的字符位置是从 0 开始的。 提示和注释 注释:indexOf() 方法对大小写敏感! 注释:如果要检索的字符串值没有出现,则该方法返回 -1。 实例 在本例中,我们将在 "Hello world!" 字符串内进行不同的检索: <script type="text/javascript"> var str="Hello world!" document.write(str.indexOf("Hello") + "<br />") document.write(str.indexOf("World") + "<br />") document.write(str.indexOf("world")) </script> 以上代码的输出: 0 -1 6

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

Ceph作为OpenStack后端存储

Total PGs = (Total_number_of_OSD * 100) /max_replication_count) 1、Create pool for OpenStack 1 2 3 4 5 pg=256 cephosdpoolcreatevolumes$pg #disk_pool cephosdpoolcreateimages$pg #image_pool cephosdpoolcreatevms$pg #host_pool cephosdpoolcreatebackups$pg #backup_pool 2、setup ceph client authentication 1 2 3 cephauthget-or-createclient.cindermon 'allowr' osd 'allowclass-readobject_prefixrbd_children,allowrwxpool=volumes,allowrwxpool=vms,allowrxpool=images' cephauthget-or-createclient.glancemon 'allowr' osd 'allowclass-readobject_prefixrbd_children,allowrwxpool=images' cephauthget-or-createclient.cinder-backupmon 'allowr' osd 'allowclass-readobject_prefixrbd_children,allowrwxpool=backups' 3、Add the keyringsfor client.cinder, client.glance, and client.cinder-backup to the appropriatenodes and change their ownership 1 2 3 4 cephauthget-or-createclient.glance| ssh {your-glance-api-server} sudo tee /etc/ceph/ceph .client.glance.keyring ssh {your-glance-api-server} sudo chownglance:glance /etc/ceph/ceph .client.glance.keyring cephauthget-or-createclient.cinder| ssh {your-volume-server} sudo tee /etc/ceph/ceph .client.cinder.keyring ssh {your-cinder-volume-server} sudo chowncinder:cinder /etc/ceph/ceph .client.cinder.keyring 4、Nodes running nova-compute need the keyring file for thenova-compute process 1 cephauthget-or-createclient.cinder| ssh {your-nova-compute-server} sudo tee /etc/ceph/ceph .client.cinder.keyring 5、Create a temporary copy of the secret key on the nodes runningnova-compute: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 cephauthget-keyclient.cinder>client.cinder.key cephauthget-keyclient.cinder| ssh {your-compute-node} tee client.cinder.key uuidgen 4f859b95-406e-49f6-9ff8-d6e04f7ba1ef cat >secret.xml<<EOF <secretephemeral= 'no' private= 'no' > <uuid>4f859b95-406e-49f6-9ff8-d6e04f7ba1ef< /uuid > <usage type = 'ceph' > <name>client.cindersecret< /name > < /usage > < /secret > EOF sudo virshsecret-define-- file secret.xml sudo virshsecret- set -value--secrete05983be-9251-44cb-9738-198bf9ec2d7e--base64$( cat client.cinder.key)&& rm client.cinder.keysecret.xml 6、Configuring Glance 1 2 3 4 5 6 7 8 vi /etc/glance/glance-api .conf [DEFAULT] ... default_store=rbd rbd_store_user=glance rbd_store_pool=images show_image_direct_url=True ... 7、Configuring Cinder 1 2 3 4 5 6 7 8 9 10 11 vi /etc/cinder/cinder .conf [DEFAULT] ... volume_driver=cinder.volume.drivers.rbd.RBDDriver rbd_pool=volumes rbd_ceph_conf= /etc/ceph/ceph .conf rbd_flatten_volume_from_snapshot= false rbd_max_clone_depth=5 glance_api_version=2 rbd_user=cinder rbd_secret_uuid=e05983be-9251-44cb-9738-198bf9ec2d7e 8、Configuring Cinder Backup 1 2 3 4 5 6 7 8 9 10 11 vi /etc/cinder/cinder .conf [DEFAULT] ... backup_driver=cinder.backup.drivers.ceph backup_ceph_conf= /etc/ceph/ceph .conf backup_ceph_user=cinder-backup backup_ceph_chunk_size=134217728 backup_ceph_pool=backups backup_ceph_stripe_unit=0 backup_ceph_stripe_count=0 restore_discard_excess_bytes= true 9、Configuring Nova 1 2 3 4 5 6 7 8 9 10 11 12 vi /etc/nova/nova .conf [DEFAULT] ... libvirt_images_type=rbd libvirt_images_rbd_pool=vms libvirt_images_rbd_ceph_conf= /etc/ceph/ceph .conf rbd_user=cinder rbd_secret_uuid=e05983be-9251-44cb-9738-198bf9ec2d7e libvirt_inject_password= false libvirt_inject_key= false libvirt_inject_partition=-2 libvirt_live_migration_flag= "VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST" 10、Restart OpenStack 1 2 3 serviceopenstack-glance-apirestart serviceopenstack-nova-computerestart serviceopenstack-cinder-volumerestart 10、Test 本文转自Jacken_yang 51CTO博客,原文链接:http://blog.51cto.com/linuxnote/1789924,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

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文件系统,支持十年生命周期更新。

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