[关闭]
@saltyang 2016-05-24T09:53:04.000000Z 字数 2178 阅读 770

Deploy new production env with image in aliyun

deploy new-production aliyun


Prepare Env And Config file

  1. prepare 5 ecs machines which include 1 server, 1 worker, 1 redis, 2 cassandra.
    • create ecs instance used image template
  2. prepare 2 EIP , bind one with server instance and anthoer with worker instance.
  3. config rabbitmq user and vhost, allow this user can access the new vhost (it need add in redis image)
    • rabbitmqctl add_user username passwd
    • rabbitmqctl set_user_tags user_admin administrator
    • rabbitmq add_vhost vhost_name
    • rabbitmqctl set_permissions -p vhost_name user_admin '.*' '.*' '.*'
  4. config cassandra seed and node:
    • delete the data folder under /opt/cassandra/: rm -rf /opt/cassandra/data
    • change the listen_address/rpc_address(local machine ip) and seed (cassandra seed ip address)
    • service restart cassandra
    • check the cluster status with "nodetool status"
  5. create a database which name and user is different from database in production with aliyun RDS console. it only allow the new user access to new database, prohibit the new user to access database in production.
  6. add server and worker ip address to RDS white list

Deploy Testing Env

  1. modify config file with productin json file
    • Ip address: server, worker, redis, cassandra, nginx servername
    • database user and name
  2. deploy mbkserver, mbkworker and mbkportal
    • python deployV2.py mbkserver -c deploy -l aliyun
    • python deployV2.py mbkworker -c deploy -l aliyun
    • python deployV2.py mbkportal -c deploy -l aliyun
  3. dump the data of database in production env to new database
  4. migrate the database schema if this version has changed database schema

    • python manage.py migrate
  5. create a security group which is used to insulate the test env with production env

Deploy Poduction Env

  1. modify config file
    • Ip address: server, worker, redis, cassandra, nginx servername
    • database user and name
  2. deploy mbkserver, mbkworker and mbkportal
    • python deployV2.py mbkserver -c deploy -l aliyun
    • python deployV2.py mbkworker -c deploy -l aliyun
    • python deployV2.py mbkportal -c deploy -l aliyun
  3. delete the old server ecs from SLB
  4. dump the data of database in production env to new database
  5. migrate the database schema if this version has changed database schema
    • python manage.py migrate
  6. change the server ip to "www.webackup.cn" in some config:
    • ngnix.cof(server/worker), mbkclient.cof, config.js
  7. remove new production ecs from security group which is created for Testing Env
  8. add new server ecs to SLB,unbundling server EIP and binding this EIP to redis ecs
  9. run E2E test case
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注