If you are building behind a Proxy:
if you are working behind a proxy server, there are two options to setup your environment so that the build tools/scripts work correctly. This has been tested on OpenSUSE.
Option 1: Set Environment Variables
export http_proxy=http://[Proxy Address]:[Proxy Port];
export https_proxy=http://[Proxy Address]:[Proxy Port]
export JAVA_TOOL_OPTIONS="-Dhttp.proxyHost=http://[Proxy Address] -Dhttp.proxyPort=[Proxy Port] -Dhttps.proxyHost=http://[Proxy Address] -Dhttps.proxyPort=[Proxy Port]”
Option 2: Setup a Transparent Proxy
1. Set proxy for terminal:
if you already set it before you can ignore this step.
2. Download redsocks for OpenSuse:
install it: sudo rpm –Uvh redsocks-0.4.99_2e3f648-8.1.x86_64.rpm
3. Set iptables rules:
iptables -t nat -N REDSOCKS || truels
iptables -t nat -F REDSOCKS
iptables -t nat -I OUTPUT -p tcp -j REDSOCKS
iptables -t nat -A REDSOCKS -d 0.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 10.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 127.0.0.0/8 -j RETURN
iptables -t nat -A REDSOCKS -d 169.254.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 172.16.0.0/12 -j RETURN
iptables -t nat -A REDSOCKS -d 192.168.0.0/16 -j RETURN
iptables -t nat -A REDSOCKS -d 126.96.36.199/4 -j RETURN
iptables -t nat -A REDSOCKS -d 240.0.0.0/4 -j RETURN
iptables -t nat -A REDSOCKS -p tcp -j DNAT --to-destination 127.0.0.1:6666
iptables -t nat -A REDSOCKS -p udp -j DNAT --to-destination 127.0.0.1:8888
iptables -t nat -A OUTPUT -p tcp -j REDSOCKS
iptables -t nat -A PREROUTING -p tcp -j REDSOCKS
4. Change /etc/redsocks/redsocks.conf for redsock as follows: then restart redsocks service by "systemctl restart redsocks"
log_debug = off;
log_info = on;
log = "syslog:daemon";
daemon = on;
user = redsocks;
group = redsocks;
redirector = iptables;
local_ip = 127.0.0.1;
local_port = 6666;
//'ip' and 'port' are IP and tcp-port of proxy-server
ip = your_Proxy_server_IP;
port = 1080;
type = socks5;
local_ip = 127.0.0.1;
local_port = 8888;
// `ip' and `port' of socks5 proxy server.
ip = your_proxy_server_ip;
port = 1080;
dest_ip = 188.8.131.52;
dest_port = 53;
udp_timeout = 30;
udp_timeout_stream = 180;
local_ip = 127.0.0.1;
local_port = 5300;
5. save iptable rules for next time reboot machine:
iptables-save > proxy.rules
next time reboot machine reload the rules:
iptables-restore < proxy.rules
Or we can use SuSEfirewall2 to save proxy rules.
Build the RPM
Once you have the source, you will want to build the RPM.
# If you have not the source yet, the repository can be cloned and and settings defined like the comments below:
# 1) git clone https://review.coprhd.org/scm/ch/coprhd-controller.git
# 2) git config --global user.name "Your Name"
# 3) git config --global user.email email@example.com
make clobber BUILD_TYPE=oss rpm
When working with the CoprHD build, it is important to always supply the oss build flag. There are number of different ways to do this:
- If using make (as shown above), specify BUILD_TYPE=oss
- If using the gradle wrapper, use "./gradlew-oss" (e.g. ./gradlew-oss eclipse to generate Eclipse project files)
- If calling gradle that's already installed on your system (CoprHD currently uses gradle 1.11), invoke it with "gradle -PbuildType=oss"
If your CoprHD build operation fails with unresolved artifact dependencies and references to hosts within the emc.com domain, you most likely forgot to specify the oss build type.
Install the RPM
When the RPM build completes, it should print out the location of the freshly built RPM.
rpm -Uvh /path/to/storageos/rpm # e.g. rpm -Uvh build/RPMS/x86_64/storageos-184.108.40.206.6e5189e-1.x86_64.rpm
CoprHD should start immediately when the RPM is installed, but it takes some time to initialize the database and be ready for requests.
You may find it useful to monitor the startup of the apisvc in order to know when everything is ready for requests. It won't complete its initialization and start accepting requests until after the coordinator and database services are ready.
tail -f /opt/storageos/logs/apisvc.log
Watch the log scroll by. When you see output similar to the following, CoprHD is ready.
INFO AbstractConnector.java (line 333) Started SslSelectChannelConnector@0.0.0.0:8443
INFO ServiceBeaconImpl.java (line 147) Registering Service in path: /service/storageapisvc/1/api-standalone
INFO ServiceBeaconImpl.java (line 153) Service info registered
When you first install CoprHD, the apisvc.log won't exist. And it will continue that way for a couple of minutes after installation because the apisvc gives the coordinatorsvc and dbsvcs some time to initialize before it starts.
Launch the UI
Before launching the UI, please ensure all services and nginx server is active/running
- /etc/storageos/storageos status (If any of the services are not active/running please try restarting)
- systemctl status nginx (Normally Nginx server takes 5-10 mins to start post the ViPR services successful start)
If any of the ViPR services or nginx server are not active and running, further debugging is required - UI may not be successfully launched
Once CoprHD is up and running, you can log in to the UI.
- Point your modern web browser to https://vip.you.assigned.in.ovfenv.properties
- When prompted for credentials, login with root/ChangeMe
Once authenticated, you're ready to begin exploring CoprHD!
Ports & Protocols
As indicated above, the CoprHD UI should be accessed through the VIP on the default https port, 443.
The CoprHD REST API should be accessed over https on port 4443.