上次只是用R的opencpu
套件小試一下
這次就直接在server上建立opencpu server
讓local的R可以去call server服務
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| su -c 'rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm' sudo yum update sudo yum install gcc-c++ R R-java libapreq2-devel R-devel libcurl-devel protobuf-devel openssl-devel libxml2-devel libicu-devel libssh2-devel
sudo rm -rf /usr/lib64/R
curl -v -j -k -L https://mran.microsoft.com/install/mro/3.3.1/microsoft-r-open-3.3.1.tar.gz -o microsoft-r-open-3.3.1.tar.gz tar zxvf microsoft-r-open-3.3.1.tar.gz sudo yum install -y microsoft-r-open/rpm/* sudo chmod -R 777 /usr/lib64/microsoft-r/3.3/lib64/R
sudo cp -r /usr/lib64/microsoft-r/3.3/lib64/R /usr/lib64
sudo yum install git
git clone https://github.com/jeroenooms/opencpu-server.git
chmod +rx ~/ chmod +x opencpu-server/rpm/*.sh opencpu-server/rpm/buildscript.sh
|
最後使用下面指令開port就可以順利在網頁上登入http://<your_ip_address>/ocpu/test
1 2
| sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT sudo service iptables save
|