Hi all,

We were able to cluster the store and publisher using the
CarbonTomcatSessionReplicationValve
<https://docs.wso2.com/display/CLUSTER420/Enabling+HTTP+Session+Replication>
[1].
But couldn't do the same with carbon itself since the session is not
serializable to send over the carbon cluster.

[1]
https://docs.wso2.com/display/CLUSTER420/Enabling+HTTP+Session+Replication

Thanks & Regards

On Fri, May 12, 2017 at 11:08 AM, Chamara Philips <chcphilips....@gmail.com>
wrote:

> Hi all,
>
> The immediate error logs when trying to login to the carbon console with
> the Redis session manager in place as explained above is as follows.
>
> 2017-05-12 10:40:16,916]  INFO - StartupFinalizerServiceComponent WSO2
> Carbon started in 78 sec
> [2017-05-12 10:40:17,213]  INFO - CarbonUIServiceComponent Mgt Console URL
>  : https://172.17.0.1:9443/carbon/
> [2017-05-12 10:40:17,213]  INFO - CarbonUIServiceComponent API Publisher
> Default Context : https://172.17.0.1:9443/publisher
> [2017-05-12 10:40:17,213]  INFO - CarbonUIServiceComponent API Store
> Default Context : https://172.17.0.1:9443/store
> [2017-05-12 10:40:52,616] ERROR - RedisSessionManager org.wso2.carbon.ui.
> MenuAdminClient
> [2017-05-12 10:40:55,685]  INFO - CarbonAuthenticationUtil
> 'admin@carbon.super [-1234]' logged in at [2017-05-12 10:40:55,685+0530]
> [2017-05-12 10:41:09,524] ERROR - RedisSessionManager
> org.wso2.carbon.registry.core.session.UserRegistry
> [2017-05-12 10:41:09,588] ERROR - RedisSessionManager org.wso2.carbon.ui.
> MenuAdminClient
>
> The attached log appears sometime after the server is working.
>
> Thanks & Regards
>
> On Fri, May 12, 2017 at 6:05 AM, Chamara Philips <chcphilips....@gmail.com
> > wrote:
>
>> Thanks a lot KasunG and Thusitha.
>>
>> As you said, I tried to register the RedisSessionManager under the
>> management element in the repository/conf/tomcat/context.xml. Then the
>> manager seems to be applied only to the webapps.
>>
>> Then as Thusitha has mentioned, I registered the RedisSessionManager
>> under the management element in 
>> repository/conf/tomcat/carbon/META-INF/context.xml.
>> Note that I didn't register the Valve in that, since the valve in
>> repository/conf/tomcat/context.xml seems to be applied globally. With
>> this configuration, the session manager started working for carbon console.
>> There were logs in the redis-cli, with the session id. Also the user
>> authenticated log is there in the WSO2Server console. But the user didn't
>> login to the carbon console. The final logs are attached below.
>>
>> What may be the root cause for this?
>>
>> Thanks & Regards
>>
>> On Thu, May 11, 2017 at 8:31 AM, KasunG Gajasinghe <kas...@wso2.com>
>> wrote:
>>
>>>
>>> You need to register the RedisSessionManager under the manager element
>>> [1].
>>>
>>> If you are extending the CarbonTomcat valve, the valve registration
>>> needs to happen by registering a instance as an OSGi service. In that case,
>>> you don't have to add it to catalina-server.xml/context.xml. But, you
>>> can extend tomcat BaseValve and register it via catalina-server.xml with
>>> exact same result.
>>>
>>> [1] https://tomcat.apache.org/tomcat-7.0-doc/config/manager.html
>>>
>>> On Mon, May 8, 2017 at 8:32 PM, Chamara Philips <
>>> chcphilips....@gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> We were able to cluster the store and publisher without using
>>>> StickySessions in load balancers. We have used 
>>>> CarbonTomcatSessionReplicationValve
>>>> as mentioned in this article
>>>> <https://docs.wso2.com/display/CLUSTER44x/Enabling+HTTP+Session+Replication>.
>>>> We would like to know the concerns using this approach to jaggeryapps.
>>>> (publisher, store)
>>>>
>>>> Still, couldn't resolve the problem with the approach using the Redis
>>>> server [2]
>>>> <https://discuss.pivotal.io/hc/en-us/articles/206085337-How-to-setup-Redis-Session-Manager-on-tcServer-Tomcat>.
>>>> I tried to implement the Valve extending the CarbonTomcatValve.
>>>>
>>>> Can't we register the Valves extended by CarbonTomcatValve in the
>>>> context.xml. I got the following erro
>>>> <https://gist.github.com/ChamaraPhilipsuom/b9ba527a5607dd83f20c8be06c3336b8>r
>>>> when I tried to do that.
>>>>
>>>> ERROR {org.apache.tomcat.util.digester.Digester} -  Begin event threw
>>>> exception {org.apache.tomcat.util.digester.Digester}
>>>> java.lang.ClassNotFoundException: com.orangefunction.tomcat.redi
>>>> ssessions.RedisSessionHandlerValve cannot be found by
>>>> org.wso2.carbon.tomcat_4.4.11
>>>>
>>>> What may be the root cause for this?
>>>>
>>>> When I extended the RedisSessionHandlerValve from BaseValve the server
>>>> starts successfully. (Note I have registered the Valve and Manager using
>>>> context.xml ) For all the webapps, RedisSessionManagers are successfully
>>>> set in  RedisSessionHandlerValve.  But when I try to log in from carbon
>>>> console, the RedisSessionManager is not set in the RedisSessionHandlerValve
>>>> as expected. I am a bit unclear about the lifecycle of Managers and Valves
>>>> in the CarbonTomcat. How can we start the life cycle of the
>>>> RedisSessionManager for the carbon console?
>>>>
>>>> [1] https://docs.wso2.com/display/CLUSTER44x/Enabling+HTTP+Sessi
>>>> on+Replication
>>>> [2] https://discuss.pivotal.io/hc/en-us/articles/206085337-H
>>>> ow-to-setup-Redis-Session-Manager-on-tcServer-Tomcat
>>>> [3] https://gist.github.com/ChamaraPhilipsuom/b9ba527a5607dd
>>>> 83f20c8be06c3336b8
>>>>
>>>> Thanks & Regards
>>>>
>>>> On Fri, May 5, 2017 at 5:08 PM, Chamara Philips <
>>>> chcphilips....@gmail.com> wrote:
>>>>
>>>>> Hi Kasun,
>>>>>
>>>>> What about login to the carbon management console? It throws the same
>>>>> error.
>>>>>
>>>>> Thanks & Regards
>>>>>
>>>>> On Fri, May 5, 2017 at 4:56 PM, KasunG Gajasinghe <kas...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>> I don't think jaggeryapps were tested for session replication.
>>>>>> Usually what we do is enabling sticky sessions in the reverse proxy that
>>>>>> fronts the APIM store nodes.
>>>>>>
>>>>>> On Fri, May 5, 2017 at 4:47 PM, Chamara Philips <
>>>>>> chcphilips....@gmail.com> wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I tried to replicate sessions for API manager store cluster. I tried
>>>>>>> it with Redis[1]
>>>>>>> <https://discuss.pivotal.io/hc/en-us/articles/206085337-How-to-setup-Redis-Session-Manager-on-tcServer-Tomcat>and
>>>>>>> Hazelcast [2]
>>>>>>> <https://hazelcast.com/use-cases/web-session-clustering/tomcat-web-session-replication/>
>>>>>>> .
>>>>>>>
>>>>>>> In the first approach, I am using a valve, which I configured in the
>>>>>>> context.xml. The valve successfully got registered. But when I tried to
>>>>>>> login to the store it threw this error[3]
>>>>>>> <https://gist.github.com/ChamaraPhilipsuom/a02e09824544b0cb59bd9d0b8bdb10a0>
>>>>>>> .
>>>>>>>
>>>>>>> This happens because the "manager" [4]
>>>>>>> <https://github.com/rmohr/tomcat-redis-session-manager/blob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionHandlerValve.java#L28>
>>>>>>> is null. But here in the RedisSessionManager [5]
>>>>>>> <https://github.com/rmohr/tomcat-redis-session-manager/blob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redissessions/RedisSessionManager.java#L279>
>>>>>>>  it
>>>>>>> should be assigned in the startInternal. What may be the cause for 
>>>>>>> this? Do
>>>>>>> valves get created after the initialization of SessionManager?
>>>>>>>
>>>>>>> Is there any known implementation for one of above two approaches?
>>>>>>> (or any other implementation.)
>>>>>>>
>>>>>>> [1] https://discuss.pivotal.io/hc/en-us/articles/206085337-H
>>>>>>> ow-to-setup-Redis-Session-Manager-on-tcServer-Tomcat
>>>>>>> [2] https://hazelcast.com/use-cases/web-session-clustering/t
>>>>>>> omcat-web-session-replication/
>>>>>>> [3] https://gist.github.com/ChamaraPhilipsuom/a02e09824544b0
>>>>>>> cb59bd9d0b8bdb10a0
>>>>>>> [4] https://github.com/rmohr/tomcat-redis-session-manager/bl
>>>>>>> ob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redi
>>>>>>> ssessions/RedisSessionHandlerValve.java#L28
>>>>>>> [5] https://github.com/rmohr/tomcat-redis-session-manager/bl
>>>>>>> ob/2.0-tomcat-7/src/main/java/com/orangefunction/tomcat/redi
>>>>>>> ssessions/RedisSessionManager.java#L279
>>>>>>>
>>>>>>> Thanks & Regards
>>>>>>> --
>>>>>>> --
>>>>>>> Hareendra Chamara (BSc.Eng(Hons))
>>>>>>> Sysco acceleration,
>>>>>>> SyscoLabs(Pvt) Ltd
>>>>>>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874
>>>>>>> <6594252874>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
>>>>>> email: kasung AT spamfree wso2.com
>>>>>> linked-in: http://lk.linkedin.com/in/gajasinghe
>>>>>> blog: http://kasunbg.org
>>>>>> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> --
>>>>> Hareendra Chamara (BSc.Eng(Hons))
>>>>> Sysco acceleration,
>>>>> SyscoLabs(Pvt) Ltd
>>>>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874
>>>>> <6594252874>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> --
>>>> Hareendra Chamara (BSc.Eng(Hons))
>>>> Sysco acceleration,
>>>> SyscoLabs(Pvt) Ltd
>>>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874
>>>> <6594252874>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
>>> email: kasung AT spamfree wso2.com
>>> linked-in: http://lk.linkedin.com/in/gajasinghe
>>> blog: http://kasunbg.org
>>> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>>>
>>>
>>
>>
>>
>> --
>> --
>> Hareendra Chamara (BSc.Eng(Hons))
>> Sysco acceleration,
>> SyscoLabs(Pvt) Ltd
>> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
>>
>
>
>
> --
> --
> Hareendra Chamara Philips (BSc.Eng(Hons))
> Sysco acceleration,
> SyscoLabs(Pvt) Ltd
> Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
>



-- 
-- 
Hareendra Chamara Philips (BSc.Eng(Hons))
Sysco acceleration,
SyscoLabs(Pvt) Ltd
Mobile : +94 (0) 767 184161 <94767184161> | +65 (9) 425 2874 <6594252874>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to