zato集群部署
2015-08-26 10:32
127 查看
注:
SQL ODB和Cluster’s config需要首先依次创建,其他三个次序随意
对不熟悉的命令,使用server create *** -h 查看帮助文档
修改完后配置文件,要重启(zato stop ***, zato start ***)
(PostgreSQL only) Create a separate schema for Zato
Make Zato user the owner of the database created or grant it permissions to issue DDL statements
Issue the zato create odb command
删除的话,把create换成delete
Revoke any DDL rights given to the Zato user
ca-web-admin
web-admin
建立新用户
lb
zato create load_balancer ~/load-balancer ~/crypto/out-pub/lb-agent-pub-2015-08-21_03-25-08.pem ~/crypto/out-priv/lb-agent-priv-2015-08-21_03-25-08.pem ~/crypto/out-cert/lb-agent-cert-2015-08-21_03-25-08.pem ~/crypto/ca-material/ca-cert.pem
create server
Start it using the zato start command
注:每个集群由多个共享同一个SQL和Redis数据库的服务器构成。因此在普通的机子上创建server时,只需要安装zato,再创建server。其中的ODB和redis所在机器的ip和port要根据具体情况写。
把server加入到负载平衡中:位置:Clusters -> (pick one from the table) -> Servers -> Add to LB/Remove from LB/Delete
这是因为默认配置有问题。打开Clusters -> (pick one from the table) -> Load-balancer,把host和端口改为实际的(查看server中的配置文件:~/server_130/config/repo/server.conf)
2. curl localhost:11223/my_service1 -d '{"cust_id":123, "cust_type":"E"}'可以,但是curl 192.168.174.130:11223/my_service1 -d '{"cust_id":123, "cust_type":"E"}'不可以。
原因:默认配置为127.0.0.1,修改两个地方
2.1 配置文件:~/load-balancer/config/repo中的zato.conf和lb-agent.conf,把其中的127.0.0.1修改为实际的ip
2.2 修改集群的名字:Clusters -> (pick one from the table) -> Edit,把localhost改为实际的ip
SQL ODB和Cluster’s config需要首先依次创建,其他三个次序随意
对不熟悉的命令,使用server create *** -h 查看帮助文档
修改完后配置文件,要重启(zato stop ***, zato start ***)
1. SQL ODB
Create a user for Zato servers$ sudo su - postgres # OS X users may skip it $ createuser --no-superuser --no-createdb --no-createrole zato1 $ createdb --owner=zato1 zato1 $ psql --dbname zato1 --command="ALTER ROLE zato1 WITH PASSWORD 'l'"
(PostgreSQL only) Create a separate schema for Zato
postgres@ubuntu:/home/dimite$ psql psql (9.3.9) Type "help" for help. postgres=# CREATE SCHEMA zato_schema; CREATE SCHEMA
Make Zato user the owner of the database created or grant it permissions to issue DDL statements
Issue the zato create odb command
zato create odb postgresql --odb_host localhost --odb_port 5432 --odb_user zato1 --odb_db_name zato1 --postgresql_schema zato_schema
删除的话,把create换成delete
Revoke any DDL rights given to the Zato user
2. Cluster’s config
zato create cluster --odb_host localhost --odb_port 5432 --odb_user zato1 --odb_db_name zato1 --postgresql_schema zato_schema postgresql localhost 11223 20151 localhost 6379 PROD3 techacc1
3. Web admin
cazato@ubuntu:~$ zato ca create ca crypto OK zato@ubuntu:~$ cd crypto/ zato@ubuntu:~/crypto$ ls ca-material out-cert out-csr out-priv out-pub
ca-web-admin
zato@ubuntu:~$ zato ca create web_admin ~/crypto OK
web-admin
zato create web_admin --odb_host localhost --odb_port 5432 --odb_user zato1 --odb_db_name zato1 --postgresql_schema zato_schema ./web-admin postgresql ~/crypto/out-pub/web-admin-pub-2015-08-21_03-03-28.pem ~/crypto/out-priv/web-admin-priv-2015-08-21_03-03-28.pem ~/crypto/out-cert/web-admin-cert-2015-08-21_03-03-28.pem ~/crypto/ca-material/ca-cert.pem techacc1
建立新用户
zato create user ~/web-admin
4. Load-balancer
ca-lbzato@ubuntu:~$ zato ca create lb_agent ~/crypto/ zato_lb_agent1 OK
lb
zato create load_balancer ~/load-balancer ~/crypto/out-pub/lb-agent-pub-2015-08-21_03-25-08.pem ~/crypto/out-priv/lb-agent-priv-2015-08-21_03-25-08.pem ~/crypto/out-cert/lb-agent-cert-2015-08-21_03-25-08.pem ~/crypto/ca-material/ca-cert.pem
5. Servers
ca serverzato@ubuntu:~$ zato ca create server ~/crypto/ PROD3 server_132 OK
create server
zato create server --odb_host localhost --odb_port 5432 --odb_user zato1 --odb_db_name zato1 --postgresql_schema zato_schema ~/server_132 postgresql localhost 6379 ~/crypto/out-pub/PROD3-server_132-pub-2015-08-21_03-42-20.pem ~/crypto/out-priv/PROD3-server_132-priv-2015-08-21_03-42-20.pem ~/crypto/out-cert/PROD3-server_132-cert-2015-08-21_03-42-20.pem ~/crypto/ca-material/ca-cert.pem PROD3 server_132
Start it using the zato start command
zato@ubuntu:~$ zato start web-admin OK
注:每个集群由多个共享同一个SQL和Redis数据库的服务器构成。因此在普通的机子上创建server时,只需要安装zato,再创建server。其中的ODB和redis所在机器的ip和port要根据具体情况写。
把server加入到负载平衡中:位置:Clusters -> (pick one from the table) -> Servers -> Add to LB/Remove from LB/Delete
6. 存在问题
1. server添加到集群后,LB state为Down状态。这是因为默认配置有问题。打开Clusters -> (pick one from the table) -> Load-balancer,把host和端口改为实际的(查看server中的配置文件:~/server_130/config/repo/server.conf)
2. curl localhost:11223/my_service1 -d '{"cust_id":123, "cust_type":"E"}'可以,但是curl 192.168.174.130:11223/my_service1 -d '{"cust_id":123, "cust_type":"E"}'不可以。
原因:默认配置为127.0.0.1,修改两个地方
2.1 配置文件:~/load-balancer/config/repo中的zato.conf和lb-agent.conf,把其中的127.0.0.1修改为实际的ip
2.2 修改集群的名字:Clusters -> (pick one from the table) -> Edit,把localhost改为实际的ip
相关文章推荐
- POJ 1035 代码+具体的目光
- iOS GPUImage的简单说明
- 滚动侦测scrollspy
- SQLSTATE[42000]: Syntax error or access violation: 1055 'kf_local.g.group_name' isn't in GROUP BY
- SQLite这么娇小可爱,不多了解点都不行啊
- reveal
- HTTP协议解析
- size_t与ssize_t
- Leetcode: Summary Ranges
- Swift 属性值监测
- tomcat web.xml配置详解
- linux挂载windows共享文件夹的方法
- Java——IO流
- getsockname()(cp:http://wiki.gimoo.net/view/11495.html)
- Android 集成支付宝SDK实现快捷支付--详解
- Unity物体上下反复漂浮效果
- QT的信号与槽机制介绍
- 收集到较为直观和详细的执行计划和相关统计信息
- hiredis学习整理
- 【技术】高度不适应(内层对象高度发生变化时,外层对象的高度不能自动调节)