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命令,让程序后台启动启动,就可以在后台挖矿了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,456评论 5 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,370评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,337评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,583评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,596评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,572评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,936评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,595评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,850评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,601评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,685评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,371评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,951评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,934评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,167评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,636评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,411评论 2 342

推荐阅读更多精彩内容