@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
- Deploy Testing Env
- Deploy Poduction Env
Prepare Env And Config file
- prepare 5 ecs machines which include 1 server, 1 worker, 1 redis, 2 cassandra.
- create ecs instance used image template
- prepare 2 EIP , bind one with server instance and anthoer with worker instance.
- 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 '.*' '.*' '.*'
- 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"
- 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.
- add server and worker ip address to RDS white list
Deploy Testing Env
- modify config file with productin json file
- Ip address: server, worker, redis, cassandra, nginx servername
- database user and name
- 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
- dump the data of database in production env to new database
migrate the database schema if this version has changed database schema
create a security group which is used to insulate the test env with production env
Deploy Poduction Env
- modify config file
- Ip address: server, worker, redis, cassandra, nginx servername
- database user and name
- 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
- delete the old server ecs from SLB
- dump the data of database in production env to new database
- migrate the database schema if this version has changed database schema
- change the server ip to "www.webackup.cn" in some config:
- ngnix.cof(server/worker), mbkclient.cof, config.js
- remove new production ecs from security group which is created for Testing Env
- add new server ecs to SLB,unbundling server EIP and binding this EIP to redis ecs
- run E2E test case