Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any tutorial to introduce how to deploy Che in a farm to keep every user has their own Che instance #1475

Closed
Madixin opened this issue Jun 9, 2016 · 4 comments

Comments

@Madixin
Copy link

Madixin commented Jun 9, 2016

Is there any tutorial to introduce how to deploy Che in a farm to keep every user has their own Che instance.

@james10174
Copy link

james10174 commented Jun 10, 2016

@42690727 I have not seen one. I don't know how automated you need this farm but you could open multiple che servers specifying a different port for each like che.sh -p:8081 for example. To provide a farm maybe you could create something to open che.sh -p:port with http server configuration. You also need to edit the tomcat/conf/server.xml port number to a different one each time. I created a linux script that might help that you could run in che root directory. Really doesn't manage manage port removals and adds. Could create database of that. This would copy saved data to each instance in storage folder but you could add to script to edit che.user.workspaces.storage and che.conf.storage each time too.

#!/bin/bash
set -x
inc=$(cat value.dat)
inc=$(expr $inc + 1)
echo $inc > value.dat
#increase by one each time
newPort1=$(expr 8080 + $inc)
#increase by one each time
newPort2=$(expr 8005 + $inc)
#this only runs once
cp -n tomcat/conf/server.xml tomcat/conf/serverHold.xml
sed -i -- 's/<Server port="8005" shutdown="SHUTDOWN">/<Server port="'"$newPort2"'" \
shutdown="SHUTDOWN">/g' tomcat/conf/server.xml 
bin/che.sh -p:$newPort1 -r:$(curl -s https://4.ifcfg.me/) run

@Madixin
Copy link
Author

Madixin commented Jun 10, 2016

how to keep every user has their own Che instance and can not use others?

@james10174
Copy link

james10174 commented Jun 10, 2016

@42690727 Authentication is not built into Eclipse Che. Might want to checkout codenvy.com if you want to do something like that. Again depending on what kind of security you need you could just provide separate storage folders for each che server. However someone with the port number for someone else could get in. Authentication is not currently part of eclipse che but you could provide it yourself. Not sure how codenvy does it but they allow authentication with eclipse che backend. Take a look at http://www.avajava.com/tutorials/lessons/how-do-i-use-basic-authentication-with-tomcat.html for simple tomcat authentication to get started. Modify tomcat/conf/server.xml as needed for authentication.

#!/bin/bash
set -x
inc=$(cat value.dat)
inc=$(expr $inc + 1)
echo $inc > value.dat
#increase by one each time
newPort1=$(expr 8080 + $inc)
#increase by one each time
newPort2=$(expr 8005 + $inc)
mkdir storage$newPort1
mkdir workspaces$newPort1
#this only runs once
cp -n conf/che.properties conf/che.propertiesHold
cp conf/che.propertiesHold conf/che.properties
sed -i -- 's@che.user.workspaces.storage=${che.home}/workspaces@che.user.workspaces.storage=${che.home}/workspaces'"$newPort1"'@g' conf/che.properties
sed -i -- 's@che.conf.storage=${che.home}/storage@che.conf.storage=${che.home}/storage'"$newPort1"'@g' conf/che.properties
#this only runs once
cp -n tomcat/conf/server.xml tomcat/conf/serverHold.xml
cp tomcat/conf/serverHold.xml tomcat/conf/server.xml
sed -i -- 's/<Server port="8005" shutdown="SHUTDOWN">/<Server port="'"$newPort2"'" \
shutdown="SHUTDOWN">/g' tomcat/conf/server.xml
bin/che.sh -p:$newPort1 -r:$(curl -s https://4.ifcfg.me/) run

@Madixin
Copy link
Author

Madixin commented Jun 11, 2016

@james10174 thanks,i will try it

@Madixin Madixin closed this as completed Jun 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants