Baskar Sikkayan

Ranch Hand
+ Follow
since Oct 06, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Baskar Sikkayan

I am trying to setup a 3 node MongoDB cluster.

1) Started mongodb in all 3 nodes with the below config file.

 

    net:
          bindIp: 0.0.0.0
          port: 10901
       setParameter:
          enableLocalhostAuthBypass: false
       systemLog:
          destination: file
          path: "<LOG_PATH>"
          logAppend: true
   
   processManagement:
      fork: true
   storage:
      dbPath: "<DB_PATH>/data"
      journal:
         enabled: true
   security:
      keyFile : "<KEY_FILE_PATH>"
       sharding:
         clusterRole: "configsvr"
       replication:
         replSetName: "configReplSet"


2) Created Admin user in one of the config node and able to login with the admin user.

   mongo --port 10901 -u "admin" -p "adminpwd" --authenticationDatabase "admin" --host <IP>

now the console says,  user:PRIMARY>

3) Created replica set using the below command.

   rs.initiate(
     {
       _id: "configReplSet",
       configsvr: true,
       members: [
         { _id : 0, host : "<IP1>:10901" },
         { _id : 1, host : "<IP2>:10901" },
         { _id : 2, host : "<IP3>:10901" }
       ]
     }
   )

4) Executed rs.status() and got the proper output.

   
5) Started Mongo shards with the below config in all 3 instances.

   net:
      bindIp: 0.0.0.0
      port: 10903
   setParameter:
      enableLocalhostAuthBypass: false
   systemLog:
      destination: file
      path: "<LOG_PATH>"
      logAppend: true
   processManagement:
      fork: true
   storage:
      dbPath: "<DB_PATH>/shard_data/"
      journal:
         enabled: true
   security:
      keyFile : "<KEY_FILE>"
   sharding:
     clusterRole: "shardsvr"
   replication:
     replSetName: "shardReplSet"


6) Created Admin user in one of the shard node also and able to login with the admin user.

   mongo --port 10903 -u "admin" -p "adminpwd" --authenticationDatabase "admin" --host <IP>


7) Created shard replica set using the below command.

   rs.initiate(
     {
       _id: "shardReplSet",
       members: [
         { _id : 0, host : "<IP1>:10903" },
         { _id : 1, host : "<IP2>:10903" },
         { _id : 2, host : "<IP3>:10903" }
       ]
     }
   )


8) Started the router with the below config

   # where to write logging data.
   systemLog:
     destination: file
     logAppend: true
     path: <LOG_PATH_FOR_MONGOS>
   
   # network interfaces
   net:
     port: 10902
   
   security:
     keyFile: <KEY_FILE>
   
   processManagement:
     fork: true
   
   sharding:
     configDB: configReplSet/<IP1>:10901,<IP2>:10901,<IP3>:10901

6) Connected to mongos using mongo

   mongo --port 10902 -u "admin" -p "adminpwd" --authenticationDatabase "admin" --host <IP>

Now, I see the below in my command.

   MongoDB server version: 3.4.2
   mongos>

7) Now added each shard in the mongos interface.

  Since, I have configured replica set,

sh.addShard("shardReplSet/<IP1>:10903, <IP2>:10903, <IP3>:10903")



**Issues :-**

1) Unable to connect to mongodb from the remote machine

2) I am running config on port 10901, shard on port 10903 and router on port 10902. Running, config, shard and router on each node. Is this ok?

DB path for config and shard are different. Have to create admin user on each service(config, shard, router). Is this correct?

Created replica set for config and shard server, but not for router? Is this ok?



4) Unable to connect to these instances from a remote mongo chef tool. I use the router port to connect to these instances? Is this correct? If so, Do I need to run router on each node?


Thanks
2 years ago
I have a user defined annotation class as follows.



I use this annotation in the following way.




Not sure, how to create a bean of ProcessorBean and inject Producer.




I tried the above one and it is throwing dependency error.

Thanks
3 years ago
I am trying to set up ldap authentication through java config. The code auth.getObject inside the method init returns null and unable to set the authentication manager and also no exception is seen. Is there anything wrong in the config? How can i get the authentication manager object?


4 years ago
I have both WebSecurityConfigurerAdapter( for DB auth ) and GlobalAuthenticationConfigurerAdapter (for ldap auth) in my application and using WebSecurityConfigurerAdapter for website auth and GlobalAuthenticationConfigurerAdapter for jms authentication.

I am not sure how to expose both the authentication manager so that I can inject both the authentication manager through auto-wiring, wherever needed.




I tried,



But it returns only the AuthenticationManager from the websecurityconfigurerDaapter.

Help will be greatly appreciated.


Thanks
4 years ago
We use Spring boot with Spring security in our Application.
Using Spring db authentication for web authentication and planning to use ldap for JMS authentication.




The web authentication works without any issues.

For LDAP Authentication, we use the below code.





I am not sure how to expose the AuthnticationManager for the ldap so that it can be injected in some other class as below.

Public class JmsConfig {



4 years ago
Hi,

We use spring data elastic search.
We use multimatch query to search against multiple fields.




We use PHRASE_PREFIX for phrase match.

Now, we would like to add boosting for exact match on nickName( boosting only if exact match ).

For example, when i search for Baskar, if there is a exact match on nickName, it should be ordered first in the result. If there is no exact match, then firstName should be given boosting. I tried boosting like below.





Boosting doesnt seem to be working. Also not sure, how to add boosting only on exact match on a field.


Thanks,
Baskar.S
4 years ago
Hi,

We use spring boot in our application along with angular js and html.
We use velocity only for email template but not fore view resolver.



Even we dont use velocity view resolver, we get the following error duo to the auto configuration.

ERROR org.apache.velocity - ResourceManager : unable to find resource
'LoadList' in any resource loader. ERROR org.apache.velocity -
ResourceManager : unable to find resource 'index' in any resource
loader.



I tried to disable Velocity configuration,



Also added the following in the application.property file,

spring.velocity.check-template-location=false


But still getting the above error.
Is there anyway to disable velocity view resolver alone.


Thanks,
Baskar.S
4 years ago

I tired the same way. Still it is not working with the class select-full.





Hi,

It works fine even with ng-model="groupForm.email" with the css class **class="form-control input-sm"**. Its not working only when i set the css class to class="select-full".


Thanks,
Baskar.S
Hi,
I have problem in setting the selected dropdown value from the server.



I set the previously selected value from the server by setting the id for groupForm.email.

With this select, It works fine. But when I change the class from class="form-control input-sm" to class="select-full", it is not setting the previously selected value. But i can get the selected value.
I use angularjs and bootstrap in my application. I am not sure how to set the selected value from server.

Below is my html code.



In js, I populate the dropdown values as follows when page loads,



After selecting the values, i get the selected values as follows.

groupForm.users in js gives me all the selected users id in a comma separated value.

But I am not sure how to load the previously selected values from the server on edit.

On edit, the value should be loaded from the server as follows.




4 years ago
Hi,

Thanks for the solution.

I am just curious to know, What will happen if i stop my update process for 2 days for some reason?

So, all data will be deleted and i wont see any data until next update happens.


Thanks,
Baskar.S
4 years ago
Hi,
We use elastic search highlighter and get the below code from the highlighter.



We display the result in html as follows.






I have included sanitize.js and have ngSanitize in the angular module. Still i see the raw data in the page not the rendered data.

Html tags are not rendered and seeing the tags in the browser.

Am i missing anything here?

Thanks,
Baskar.S
4 years ago
We use Elastic Search in our project and we follow the push approach.
We have a scheduler that runs at every 30 mins and reads data from the tables and push the same to Elastic Search using Spring Data Elastic Search.



We do read the whole table and insert into elastic search every 30 mins to keep the index data in sync with tables. The table is being owned by some other team.

Doubt :- Rows were deleted from the table. Now, when i do select *, i will not be getting the deleted records. but, those records still there in the elastic search and these records will become stale data in the search. How can i delete all the records in the elastic search before inserting as part of the schedule without affecting the search in the front screen.

Is there anyway I can use transaction here, so that i will do delete all, save and finally commit.

Thanks,
Baskar.S
4 years ago
I have the following JSON message. This is a single complete message. There are so many messages like this in a single file. This json message was generated from a unformated json message using jq.


I would like to do some filtering on this. For example, when i search for first_name, mike1, I should get the header and the matching request inside request. Also the matching result inside the Response message. So, the output is expected as follows for the search string mike1.



Basically, i want to filter out unmatched request inside the requests array and unmatched result inside the result array.


Currently, I use the following script to get the formatted json message from the unformatted json message log file.

sed -n "/<SEARCH_STRING>/ s/.*Service - //p" $1/test.log* | jq . > ~/result.log

Thanks,
Baskar.S
4 years ago