I was doing regular scale-up operation by adding two instances with higher CPU than existing two nodes. After adding I was planning to step-by-step remove the old nodes with lower performance. Everything was going smooth, I have added two nodes, did setting for each bucket to have a one replica and pushed rebalance. It took a quite long, I’m not even sure, since it was DEV environment, I just went home. Next day early morning I saw it was finished and balanced. So now I have started removing the old nodes. First I have ordered to old_node_1 to REMOVE and then pushed REBALANCE. It took about 2 hours and it went down. So now I have asked to second old node to be REMOVE and pushed REBALANCE. So another long 2 hour rebalancing process has started I thought. While waiting for that I have decided to remove the old_node_1 which is already out of the cluster. Here the BIG MISTAKE happened. I have logged in to the new_node_2 and stoped the service sudo service couchbase-server stop
ELK with Metricbeat for Collecting Couchbase Logs
Search In Rotated Sorted Array
Another good example of modifiying classical algorithm in order to reach the goal. In this example we have twisted task where binary-search algorithm should be modified with additional edge case checks. leetcode
ComponentScan vs scanBasePackages
There are saying that “if you understand component scan, you understand spring framework”. It is quite true since main advantage of spring framework is lies on dependency injection. To do the dependency injection the packages must be scanned for necessary beans. Obviously when the project is big (mostly multiple projects are used together) there are many beans are necessary for scan. There are two methods for bean scanning in spring:
Couchbase health check failed
I have been facing the “Couchbase health check failed” error, which I have never seen so far:
3Sum Closest
Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution. from leetcode
Longest Palindromic Substring
This is one of the medium level problem regarding to palindromes, where we have to find longest substring palindrome of the given string.leetcode
K-th Largest Element of Array
I have decided to describe this problem, because it is somehow has a good message for algorithm learners. Especially people who complains why should we learn the algorithms if we can just use the existing codes (or libraries) without diving into details. We need to learn algorithms to design our own by customizing them for our purpose. The purpose is usually solve more non-traditional problems which are not common. I have found this example particularly interesting.
Algorithms, BFS - Breadth First Search
Breadth-first search systematically explores the edges of G graph to discover every vertex that is reachable from starting node S. The main purpose of BFS is to calculate the distance from S to each reachable vertex. If we are given two arbitrary nodes and asked for the distance between them, then the BFS is the standard solution. The algorithm works for both directed and un-directed graphs.
Algorithms, Graphs and Trees
Graphs are used to represent enourmous number of real-life applications. Basically graphs contain vertices(nodes) and edges(lines that are connecting nodes). Edges may have a direction, or may exist without directions. Following figure is a simple example of undirected graph with 5 vertices.