Figure 7: Elasticsearch Visual Map
That’s it, our Elasticsearch cluster is now up and running. Let’s see how our cluster behaves!
Cluster Management
Depending on your Rancher setup, kopf is deployed on one of your Rancher nodes. You can access the application using [your kopf rancher host]. Here’s an example (Figure 8):
Figure 8: kopf node identification
As you can see, everything seems to be fine, as kopf shows a green top bar. Indeed, our cluster is running without any data stored, so there’s no need for resiliency at this point.
Let’s see how it goes if we manually create an index called ‘ranchercatalog’, with three shards and two replicas. Using curl, your query would be something like this:
curl -XPUT \'http://[your kopf rancher host]/es/ranchercatalog/\' -d \'{ "settings" : { "index" : { "number_of_shards" : 3, "number_of_replicas" : 2 } } }\'Elasticsearch should reply {“acknowledged”:true}%
Shards are related to data storage, and replicas to resiliency. This means our index will have its data stored using three shards but needs two more replicas of these shards.
Now that our index has been successfully created, let’s talk a look at kopf.
Figure 9: kopf Status View
As you can see in Figure 9, the top bar is now yellow, which indicates there may be something wrong with our Elasticsearch cluster.
We can also see in the middle left of the page a warning sign (red triangle in Fig. 9) saying “six unassigned shards.” Remember when we created the ranchercatalog index, we specified:
Three shards
Two replicas
By default, the Elasticsearch Rancher catalog item deploys only 1 data node, so we need two more data nodes. Adding nodes can be easily done using the Rancher scale option. The results are shown in Figure 10.
Figure 10: Adding Nodes using Rancher Scale Option
To scale your data nodes, let’s go again to Applications, then to Stack. Click on your stack, and then on elasticsearch-datanodes. You should have something like what is shown in Figure 10. Click 2 times on the + of the scale option and let Rancher do the work. You should see data nodes popping up one after another until you finally have something like what you see in Figure 11.
Figure 11: Node View to Verify Additions
Let’s check if this is enough to bring back the beautiful green bar to kopf. Figure 12 provides the proof.
Figure 12: Corrected Nodes Verification
参考资料:
官网:
使用入门:
ELK部署示例::/docs.rancher.com/rancher/quick-start-guide/
Rancher模型参考(Application、Catalog、Infrastructure、Admin、API、Help)
做容器管理平台的,模型非常值得借鉴: