rov_server_config.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import os
  2. slb_id = 'lb-bp1werfophtsjzfr76njm'
  3. # 修改负载均衡权限
  4. slb_client_params = {
  5. 'access_key_id': 'LTAIuPbTPL3LDDKN',
  6. 'access_key_secret': 'ORcNedKwWuwVtcq4IRFtUDZgS0b1le',
  7. 'region_id': 'cn-hangzhou'
  8. }
  9. # 购买机器权限
  10. create_client_params = {
  11. 'access_key_id': 'LTAI4GBWbFvvXoXsSVBe1o9f',
  12. 'access_key_secret': 'kRAikWitb4kDxaAyBqNrmLmllMEDO3',
  13. 'region_id': 'cn-hangzhou'
  14. }
  15. # 机器配置
  16. instance_config = {
  17. # 使用的镜像信息
  18. 'image_id': 'm-bp1e5jx8eqhq22l91xw7',
  19. # 设置实例规格
  20. 'instance_type': 'ecs.ic5.xlarge',
  21. # 选择的交换机
  22. 'vswitch_id': 'vsw-bp19lpjwtc6j0p0m9mdc2',
  23. # 当前VPC类型的安全组
  24. 'security_group_id': 'sg-bp1irhrkr4vfj272hk4y',
  25. # 硬盘的大小,单位:G
  26. 'disk_size': '200',
  27. # 服务器命名
  28. 'instance_name': 'ESS-rov-server-[1,2]',
  29. # 服务器所在区域
  30. 'zone_id': 'cn-hangzhou-h',
  31. # 磁盘类型:云盘
  32. 'disk_category': 'cloud_efficiency',
  33. # 密钥
  34. 'key_pair_name': 'stuuudy',
  35. # tag
  36. 'tags': [{"Key": "ecs", "Value": "rov-server.prod"}]
  37. }
  38. # 服务启动脚本
  39. start_sh_dir = os.path.dirname(os.path.realpath(__file__))
  40. start_sh_filename = 'rov_server_start.sh'
  41. with open(file=os.path.join(start_sh_dir, start_sh_filename), mode='r', encoding='utf-8') as rf:
  42. file_content = rf.read()
  43. start_sh = {
  44. 'target_dir': '/home/piaoquan_server_sh',
  45. 'name': start_sh_filename,
  46. 'content': file_content,
  47. }