Boinc for Linux,在服务器上一边科研,一边挖矿

准备工作:

先要注册:grcpool 并开启项目一个挖矿项目,教程如下:

https://www.toutiao.com/i6589514965932048910/

1,注册Amazon云。因为Amazon有个免费,或者用谷歌云,有一年免费的。

网址:aws.amazon.com,注册的时候,需要你添加信用卡,注册成功他会扣除1美元。好像等到下个月会反还。

2,注册成功后,会以下的界面。点击启动虚拟机。

image

然后你需要选择Amazon Lightsail 的VPS。

image

然后我们创建一个实例,先选一个5美元的试试。有个活动是可以免费用一个月。

image

image

image

实例命名可以自己取一个。然后创建。穿件完成后,出现下面的界面。

进入控制台:

ben:Desktop a212$ ssh -i "1022.pem" ubuntu@ec2-18-223-184-105.us-east-2.compute.amazonaws.com

我所测试的版本,操作系统采用Ubuntu OS 16.04 64位

参加了两个项目:

SETI@home(一个是研究天体生命)

屏幕快照 2018-10-24 下午5.44.12.png

Rosetta@Home(一个是蛋白质结构)

屏幕快照 2018-10-24 下午5.42.48.png

1)下载boinc

下载链接:http://boinc.berkeley.edu/download_all.php

也可以命令行安装:

ubuntu:

sudo apt-get install boinc

Cent OS:

yum install boinc-client boinc-manager

2)运行boinc

安装程序执行后,该目录有两个程序和我们有关:

boinc,这是boinc的核心程序,所有运算、数据下载、上传都有它执行。

boinccmd,这是boinc的命令行工具,linux下的命令行工具,用于对boinc核心程序的运行状态进行控制和监控

当正常安装后,首先执行boinc核心程序,然后通过boinccmd对核心程序进行控制操作。

ubuntu@ip-172-31-20-14:/$ sudo su

root@ip-172-31-20-14:/# ls

bin  home      lib64    opt  sbin tmp   vmlinuz.old

boot initrd.img   lost+found proc snap usr

dev  initrd.img.old media    root srv  var

etc  lib       mnt     run  sys  vmlinuz

root@ip-172-31-20-14:/# cd root/

root@ip-172-31-20-14:~# ls

account_anthgrid.com_dbnupperbound.xml

all_projects_list.xml

client_state_prev.xml

client_state.xml

create_account.xml

daily_xfer_history.xml

gui_rpc_auth.cfg

lockfile

master_anthgrid.com_dbnupperbound.xml

nohup.out

notices

projects

sched_reply_anthgrid.com_dbnupperbound.xml

sched_request_anthgrid.com_dbnupperbound.xml

snap

statistics_anthgrid.com_dbnupperbound.xml

time_stats_log

root@ip-172-31-20-14:~# boinc

24-Oct-2018 08:49:38 [---] cc_config.xml not found - using defaults

24-Oct-2018 08:49:38 [---] Starting BOINC client version 7.6.31 for x86_64-pc-linux-gnu

24-Oct-2018 08:49:38 [---] log flags: file_xfer, sched_ops, task

24-Oct-2018 08:49:38 [---] Libraries: libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3

24-Oct-2018 08:49:38 [---] Data directory: /root

execv: No such file or directory

24-Oct-2018 08:49:38 [---] GPU detection failed. error code 512

24-Oct-2018 08:49:38 [---] No usable GPUs found

24-Oct-2018 08:49:38 [---] Host name: ip-172-31-20-14

24-Oct-2018 08:49:38 [---] Processor: 1 GenuineIntel Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz [Family 6 Model 63 Stepping 2]

24-Oct-2018 08:49:38 [---] Processor features: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single kaiser fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt

24-Oct-2018 08:49:38 [---] OS: Linux: 4.4.0-1069-aws

24-Oct-2018 08:49:38 [---] Memory: 990.72 MB physical, 0 bytes virtual

24-Oct-2018 08:49:38 [---] Disk: 7.69 GB total, 2.71 GB free

24-Oct-2018 08:49:38 [---] Local time is UTC +0 hours

24-Oct-2018 08:49:38 [dbnupperbound] URL http://anthgrid.com/dbnupperbound/; Computer ID 996; resource share 100

24-Oct-2018 08:49:38 [---] No general preferences found - using defaults

24-Oct-2018 08:49:38 [---] Preferences:

24-Oct-2018 08:49:38 [---]  max memory usage when active: 495.36MB

24-Oct-2018 08:49:38 [---]  max memory usage when idle: 891.65MB

24-Oct-2018 08:49:38 [---]  max disk usage: 2.61GB

24-Oct-2018 08:49:38 [---]  don't use GPU while active

24-Oct-2018 08:49:38 [---]  suspend work if non-BOINC CPU load exceeds 25%

24-Oct-2018 08:49:38 [---]  (to change preferences, visit a project web site or select Preferences in the Manager)

dir_open: Could not open directory 'slots' from '/root'.

启动另外一个终端:

ps aux | grep boinc
root     14979  0.0  0.8 206428  9100 pts/0    Sl+  04:10   0:00 boinc
root     15630  0.0  0.0  12944   972 pts/1    S+   04:18   0:00 grep --color=auto boinc
root@ip-172-31-20-14:~# ls
all_projects_list.xml  daily_xfer_history.xml  nohup.out  time_stats_log
client_state_prev.xml  gui_rpc_auth.cfg        notices
client_state.xml       lockfile                snap
root@ip-172-31-20-14:~# boinccmd

usage: boinccmd [--host hostname] [--passwd passwd] [--unix_domain] command

default hostname: localhost
default password: contents of gui_rpc_auth.cfg
Commands:
 --client_version                   show client version
 --create_account URL email passwd name
 --file_transfer URL filename op    file transfer operation
   op = retry | abort
 --get_cc_status
 --get_daily_xfer_history           show network traffic history
 --get_disk_usage                   show disk usage
 --get_file_transfers               show file transfers
 --get_host_info
 --get_message_count                show largest message seqno
 --get_messages [ seqno ]           show messages > seqno
 --get_notices [ seqno ]            show notices > seqno
 --get_project_config URL
 --get_project_status               show status of all attached projects
 --get_proxy_settings
 --get_simple_gui_info              show status of projects and active tasks
 --get_state                        show entire state
 --get_tasks                        show tasks
 --get_old_tasks                    show reported tasks from last 24 hours
 --join_acct_mgr URL name passwd    attach account manager
 --lookup_account URL email passwd
 --network_available                retry deferred network communication
 --project URL op                   project operation
   op = reset | detach | update | suspend | resume | nomorework | allowmorework | detach_when_done | dont_detach_when_done
 --project_attach URL auth          attach to project
 --quit                             tell client to exit
 --quit_acct_mgr                    quit current account manager
 --read_cc_config
 --read_global_prefs_override
 --run_benchmarks
 --set_gpu_mode mode duration       set GPU run mode for given duration
   mode = always | auto | never
 --set_host_info product_name
 --set_network_mode mode duration   set network mode for given duration
   mode = always | auto | never
 --set_proxy_settings
 --set_run_mode mode duration       set run mode for given duration
   mode = always | auto | never
 --task url task_name op            task operation
   op = suspend | resume | abort

使用--project_attach是最容易的操作方式,你只要直到所参加运算的项目的URL地址还有自己的账户密钥,就可以开始了。帐号秘钥在登录seti官方网站后,可察看到。每个项目都有自己的URL地址,例如:seti的是http://setiathome.berkeley.edu/,其他项目的URL地址,看参考boinc目录下的all_projects_list.xml文件。

你自己的帐户密钥,可登录setiathome后察看到。 https://boinc.berkeley.edu/

屏幕快照 2018-10-24 下午5.57.04.png

屏幕快照 2018-10-24 下午5.54.52.png

root@ip-172-31-20-14:~# boinccmd --project_attach http://setiathome.berkeley.edu/ 5fea4bddd10401f4758262b9544df7d3


检查:

24-Oct-2018 08:50:04 [http://setiathome.berkeley.edu/] Master file download succeeded
24-Oct-2018 08:50:09 [http://setiathome.berkeley.edu/] Sending scheduler request: Project initialization.
24-Oct-2018 08:50:09 [http://setiathome.berkeley.edu/] Requesting new tasks for CPU
24-Oct-2018 08:50:12 [SETI@home] Scheduler request completed: got 1 new tasks
24-Oct-2018 08:50:14 [SETI@home] Started download of astropulse_7.04_x86_64-pc-linux-gnu__sse2
24-Oct-2018 08:50:14 [SETI@home] Started download of astropulse_7.04_AUTHORS
24-Oct-2018 08:50:18 [SETI@home] Finished download of astropulse_7.04_AUTHORS
24-Oct-2018 08:50:18 [SETI@home] Started download of astropulse_7.04_COPYING
24-Oct-2018 08:50:20 [SETI@home] Finished download of astropulse_7.04_COPYING
24-Oct-2018 08:50:20 [SETI@home] Started download of astropulse_7.04_COPYRIGHT
24-Oct-2018 08:50:22 [SETI@home] Finished download of astropulse_7.04_x86_64-pc-linux-gnu__sse2
24-Oct-2018 08:50:22 [SETI@home] Started download of astropulse_7.04_README_x86_64-pc-linux-gnu__sse2
24-Oct-2018 08:50:24 [SETI@home] Finished download of astropulse_7.04_README_x86_64-pc-linux-gnu__sse2
24-Oct-2018 08:50:24 [SETI@home] Started download of ap_23oc18ab_B0_P0_00326_20181024_18912.wu
24-Oct-2018 08:50:25 [SETI@home] Finished download of astropulse_7.04_COPYRIGHT
24-Oct-2018 08:50:25 [SETI@home] Started download of arecibo_181.png
24-Oct-2018 08:50:25 [SETI@home] Started download of sah_40.png
24-Oct-2018 08:50:25 [SETI@home] Started download of sah_banner_290.png
24-Oct-2018 08:50:25 [SETI@home] Started download of sah_ss_290.png
24-Oct-2018 08:50:26 [SETI@home] Finished download of arecibo_181.png
24-Oct-2018 08:50:26 [SETI@home] Finished download of sah_40.png
24-Oct-2018 08:50:26 [SETI@home] Finished download of sah_banner_290.png
24-Oct-2018 08:50:26 [SETI@home] Finished download of sah_ss_290.png
24-Oct-2018 08:50:33 [SETI@home] Finished download of ap_23oc18ab_B0_P0_00326_20181024_18912.wu
24-Oct-2018 08:50:33 [SETI@home] Starting task ap_23oc18ab_B0_P0_00326_20181024_18912.wu_0
24-Oct-2018 08:50:53 [---] Running CPU benchmarks
24-Oct-2018 08:50:54 [---] Suspending computation - CPU benchmarks in progress
24-Oct-2018 08:51:25 [---] Benchmark results:
24-Oct-2018 08:51:25 [---]    Number of CPUs: 1
24-Oct-2018 08:51:25 [---]    3520 floating point MIPS (Whetstone) per CPU
24-Oct-2018 08:51:25 [---]    17940 integer MIPS (Dhrystone) per CPU
24-Oct-2018 08:51:26 [---] Resuming computation
24-Oct-2018 08:52:39 [---] Suspending computation - CPU is busy
24-Oct-2018 08:52:49 [---] Resuming computation


在另一个终端:

root@ip-172-31-20-14:~# boinccmd --get_state
======== Projects ========
1) -----------
   name: SETI@home
   master URL: http://setiathome.berkeley.edu/
   user_name: rectinajh
   team_name: 
   resource share: 100.000000
   user_total_credit: 0.000000
   user_expavg_credit: 0.000000
   host_total_credit: 0.000000
   host_expavg_credit: 0.000000
   nrpc_failures: 0
   master_fetch_failures: 0
   master fetch pending: no
   scheduler RPC pending: no
   trickle upload pending: no
   attached via Account Manager: no
   ended: no
   suspended via GUI: no
   don't request more work: no
   disk usage: 0.000000
   last RPC: Wed Oct 24 08:50:12 2018

   project files downloaded: 1540371026.040673
GUI URL:
   name: Message boards
   description: Correspond with other users on the SETI@home message boards
   URL: http://setiathome.berkeley.edu/forum_index.php
GUI URL:
   name: Help
   description: Ask questions and report problems
   URL: http://setiathome.berkeley.edu/forum_help_desk.php
GUI URL:
   name: Account
   description: View your account information
   URL: http://setiathome.berkeley.edu/home.php
GUI URL:
   name: Preferences
   description: View and modify your computing preferences
   URL: http://setiathome.berkeley.edu/prefs.php?subset=global
GUI URL:
   name: Tasks
   description: View your recent tasks
   URL: http://setiathome.berkeley.edu/results.php?userid=10751099
GUI URL:
   name: Computers
   description: View a list of the computers on which you are running SETI@Home
   URL: http://setiathome.berkeley.edu/hosts_user.php?userid=10751099
GUI URL:
   name: Donate
   description: Donate to SETI@home
   URL: http://setiathome.berkeley.edu/sah_donate.php
   jobs succeeded: 0
   jobs failed: 0
   elapsed time: 67.159623
   cross-project ID: 645ad55d9a0bae4c2f8ea9a9b8a9b887
2) -----------
   name: dbnupperbound
   master URL: http://anthgrid.com/dbnupperbound/
   user_name: rectinajh
   team_name: 
   resource share: 100.000000
   user_total_credit: 0.000000
   user_expavg_credit: 0.000000
   host_total_credit: 0.000000
   host_expavg_credit: 0.000000
   nrpc_failures: 0
   master_fetch_failures: 0
   master fetch pending: no
   scheduler RPC pending: no
   trickle upload pending: no
   attached via Account Manager: no
   ended: no
   suspended via GUI: no
   don't request more work: no
   disk usage: 0.000000
   last RPC: Wed Oct 24 08:49:41 2018

   project files downloaded: 0.000000
GUI URL:
   name: Message boards
   description: Correspond with other users on the dbnupperbound message boards
   URL: http://anthgrid.com/dbnupperbound/forum_index.php
GUI URL:
   name: Your account
   description: View your account information
   URL: http://anthgrid.com/dbnupperbound/home.php
GUI URL:
   name: Your tasks
   description: View the last week or so of computational work
   URL: http://anthgrid.com/dbnupperbound/results.php?userid=412
   jobs succeeded: 0
   jobs failed: 0
   elapsed time: 0.000000
   cross-project ID: 42761b88c2816c34bf8f3afb158f2b8b

======== Applications ========
1) -----------
   name: astropulse_v7
   Project: SETI@home

======== Application versions ========
1) -----------
   application: astropulse_v7
   version: 7.04
   project: SETI@home

======== Workunits ========
1) -----------
   name: ap_23oc18ab_B0_P0_00326_20181024_18912.wu
   FP estimate: 1.821052e+15
   FP bound: 1.821052e+16
   memory bound: 160.00 MB
   disk bound: 60.00 MB

======== Tasks ========
1) -----------
   name: ap_23oc18ab_B0_P0_00326_20181024_18912.wu_0
   WU name: ap_23oc18ab_B0_P0_00326_20181024_18912.wu
   project URL: http://setiathome.berkeley.edu/
   report deadline: Sun Nov 18 08:50:12 2018
   ready to report: no
   got server ack: no
   final CPU time: 0.000000
   state: downloaded
   scheduler state: scheduled
   exit_status: 0
   signal: 0
   suspended via GUI: no
   active_task_state: EXECUTING
   app version num: 704
   checkpoint CPU time: 61.340000
   current CPU time: 65.188000
   fraction done: 0.002537
   swap size: 21 MB
   working set size: 13 MB
   estimated CPU time remaining: 26403.482002

======== Time stats ========
  now: 1540371132.901046
  on_frac: 0.999133
  connected_frac: -1.000000
  cpu_and_network_available_frac: 0.999919
  active_frac: 0.999919
  gpu_active_frac: 0.999919
  client_start_time: Wed Oct 24 08:49:38 2018

  previous_uptime: 16025.803792
  session_active_duration: 120.283722
  session_gpu_active_duration: 120.283722
  total_start_time: Wed Oct 24 04:10:08 2018

  total_duration: 16170.828098
  total_active_duration: 16100.710196
  total_gpu_active_duration: 16100.710196

可以用nohup命令,让程序后台启动启动,就可以在后台挖矿了。

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏云计算认知升级

在腾讯云上使用 Harbor 部署私有Registry

对于一些比较私密的镜像,涉及到安全问题,就不能推送到 Docker Hub,这就需要配置一个私有的 Registry,来存放我们的 Docker Images ...

5850
来自专栏咖啡的代码人生

(BAE)jetty8+struts2导致 welcome-file-list 失效

最近在使用BAE的过程中,有个问题始终解决不了,在配置struts2框架环境的时候, 如果拦截配置的是<url-pattern>/*</url-patter...

3829
来自专栏CodingToDie

天才第一步 Docker 纸尿裤

Docker Docker 是一个开源的应用容器引擎,基于 Go 语言 并遵从Apache2.0协议开源。 Docker 可以让开发者打包他们的应用以及依赖包到...

3053
来自专栏杨建荣的学习笔记

使用shell定制awr脚本(r3笔记第32天)

大家在做性能问题诊断的时候,awr是不可或缺的工具,使用?/rdbms/admin/awrrpt.sql可能大家使用的多了,可能有时候感觉输入参数还是有些太繁琐...

2754
来自专栏FreeBuf

使用Docker构建Web渗透测试工具容器

? Docker是世界领先的软件集装化平台,针对不同的渗透测试类型,我们完全可以使用Docker创建相应的环境。有了Docker容器,你可以把测试环境放到U盘...

2729
来自专栏bboysoul

自己动手做一个最小的docker镜像

其实有人学了很久还是把docker当虚拟机来使用,但是docker其实和虚拟机是完全不一样的,如何理解这一区别呢,我觉得自己动手做一个docker的hello ...

811
来自专栏乐沙弥的世界

CRS-1006 , CRS-0215 故障一例

    安装好sles 10 sp3 + Oracle 10g RAC之后,在配置监听器时,总是提示主机bo2dbp上的监听服务已经在运行,忽略错误之后手动在b...

583
来自专栏搜云库

Docker Image 解决镜像无法删除的问题

Error response from daemon: conflict: unable to delete 4ac2d12f10cd (must be for...

39210
来自专栏康怀帅的专栏

在开发环境使用 Docker

本文是对官方文档的总结与备注。 官方文档:https://docs.docker.com/develop/ 根据官方文档的层次,分为 容器 (Container...

6814
来自专栏圣杰的专栏

.NET Core+MySql+Nginx 容器化部署

1. 引言 上两节我们通过简单的demo学习了docker的基本操作。这一节我们来一个进阶学习,完成ASP.NET Core + MySql + Nginx的容...

4238

扫码关注云+社区