I’ll say at once that there is nothing new that you wouldn’t find in the product documentation I’m not going to tell, I’ll tell you about some of the nuances and how to put the whole economy together.
mkdir -p /usr/opt/jetbrains/hub cd /usr/opt/jetbrains/hub wget http://download.jetbrains.com/hub/1.0/hub-ring-bundle-1.0.529.zip
unzip hub-ring-bundle-1.0.529.zip
/usr/opt/jetbrains/hub/bin/hub.sh run
server { listen 80; listen [::]:80; server_name hub.yourdomain.local; server_tokens off; location / { proxy_set_header X-Forwarded-Host $http_host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; proxy_pass http://localhost:2222/; } }
service nginx reload
/usr/opt/jetbrains/hub/bin/hub.sh configure --listen-port 2222 --base-url http://hub.yourdomain.local
IMPORTANT!
After configuring and configuring Youtrack and Upsource, and rebooting the server if the Hub has not yet started, then Youtrack and Upsource
will not be able to start and will fall with the error that the hub service does not exist. Therefore, they should be launched only after the successful launch of the Hub.
cat >/etc/init.d/hub <<EOF #! /bin/sh ### BEGIN INIT INFO # Provides: hub # Required-Start: \$local_fs \$remote_fs \$network \$syslog \$named # Required-Stop: \$local_fs \$remote_fs \$network \$syslog \$named # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: initscript for hub # Description: initscript for hub ### END INIT INFO PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=hub SCRIPT=/usr/opt/jetbrains/\$NAME/bin/\$NAME.sh do_start() { \$SCRIPT start soft } case "\$1" in start) do_start ;; stop|restart|status|run|rerun|help) \$SCRIPT \$1 \$2 ;; *) echo "Usage: sudo /etc/init.d/hub {start|stop|restart|status|run|rerun}" >&2 exit 1 ;; esac exit 0 EOF chmod +x /etc/init.d/hub update-rc.d hub defaults
update-rc.d youtrack disable
Because they and so will not start themselves correctly.@reboot
event for cron @reboot
that is waiting for the launch of api Hub mkdir -p /root/crons cat >/root/crons/jetbrains<<EOF #!/bin/bash status=404 while [ \$status -eq 404 ]; do echo "wait hub..." sleep 60 status=\`curl -s -o /dev/null -w "%{http_code}" http://hub.yourdomain.local/hub\` echo "hub status \$status" done service youtrack start service upsource start exit 0 EOF chmod +x /root/crons/jetbrains echo "@reboot /root/crons/jetbrains" > /tmp/cron_ crontab /tmp/cron_
Source: https://habr.com/ru/post/266871/
All Articles