今天要调试运行一个程序,需要grunt,发现运行grunt提示:
1 | /usr/bin/env: node: No such file or directory |
研究+bing后发现,
grunt 需要依靠npm安装,但是npm需要nodejs版本和ubuntu默认源的版本不匹配,
所以需要按照下面的步骤来安装
1 | http://www.tuicool.com/articles/YNJfAjU |
简化说来,就是更新确保nodejs的版本合符grunt的要求。
今天要调试运行一个程序,需要grunt,发现运行grunt提示:
1 | /usr/bin/env: node: No such file or directory |
研究+bing后发现,
grunt 需要依靠npm安装,但是npm需要nodejs版本和ubuntu默认源的版本不匹配,
所以需要按照下面的步骤来安装
1 | http://www.tuicool.com/articles/YNJfAjU |
简化说来,就是更新确保nodejs的版本合符grunt的要求。
在前一篇我们讨论的kubernetes fedora Ansible环境建立篇中,在fedora 20环境中如果运行
1 | cat ~/apache.json |
1 | kubectl create -f apache.json |
会发现minion的log中包含了Cannot start container: permission denied信息,其实这个是selinux一个相关的bug
https://ask.fedoraproject.org/en/question/50871/cant-run-docker-without-privileged-on-fedora-20/
解决方法:
方法1: 采用其他支持selinux的docker image
方法2:在minion节点setenforce 0,然后重新运行kubectl命令即可
本文采用了方法2,结果如下:
master节点检查
1 | $ kubectl get pod fedoraapache |
minion节点检查
1 | $ curl http://localhost |
1 | $ sudo systemctl start kubelet |
Kubernetes社区和Redhat bugzilla说明了是因为package的缘故,旧的依赖是docker.socket,需要更新为新的依赖docker.service (黑体部分)
1 | $ cat /usr/lib/systemd/system/kubelet.service |
实际上这样修改是无法直接work的,你会发现
1 | ansible-playbook -i inventory setup.yml |
还是错误,docker.socket的问题,查了半天实在无法理解,那里来的docker.socket
最后不得已,重启机器,发现再次执行没有问题了。好诡异的fedora系统!
最近访问IMM,发现浏览器中启动remote control,老是退出,提示
1 | Your security settings have blocked an untrusted application from running |
这个问题实际上不是firefox中的security设置问题,而是java的security设置导致。
参见这个帖子
1 | https://support.mozilla.org/zh-CN/questions/983382 |
使用Configure Java,security tab下,将对应的URL加入exception site list中即可。
如果你的操作系统是Ubuntu 14.**,那么文章的下面内容将会对你安装kubernetes提供帮助:
本文的环境搭建针对的是local cluster 方式,
参见 https://github.com/HackToday/kubernetes/blob/master/docs/getting-started-guides/locally.md
ubuntu安装的docker.io默认是需要root权限使用的,为了系统安装的默认用户使用方面,下面的步骤将帮助你不再每次sudo执行docker命令,[1]
执行下面的命令:
1 | sudo gpasswd -a ${USER} docker |
然后:
1 | logout and relogin |
验证,
docker ps 可以正常执行
安装etcd比较简单,就是从
https://github.com/coreos/etcd/releases
下载包,然后解压即可
确保对应的etcd在当前用户的$PATH设置里
这个需要注意一点,如果第1步,没有让用户docker group中,就需要使用sudo命令,但是因为sudo命令的环境变量是使用secure_path会覆盖你写在.bashrc中的设置,所以会出现etcd无法找到的问题,解决方法最好采用1,或者修改secyre_path,其他等等…
参考文献:
如果使用openstack的key-pair add后,产生的私钥是pem文件,这个是无法直接通过putty访问的。
需要经过类似的一个key转化的步骤,具体参加这篇blog
http://blog.sina.com.cn/s/blog_575b2c50010198oy.html
然后就可以使用putty访问了, 本文针对的是windows下的用户,如果不用cygwin的方式。
如果参照安装文档,
1 | https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/getting-started-guides/vagrant.md |
实体物理机安装应该不会有问题,但是奈何资源有限,拿起来我的VirutalBox建了一个虚拟机,Ubuntu 14.04
执行安装脚本,发现了诸多问题
问题1:
1 | ==> default: Waiting for machine to boot. This may take a few minutes... |
参见 http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying 解决方法
问题2:
问题1会引入另外一个问题,就是图形界面的virtualbox会提示你系统不支持硬件加速,无法创建虚拟机。这是因为virtualbox不支持nested virtualization
结合问题1,2,觉得使用single node 安装方法试试。
篇外音,升级virtualbox到4.3.20后,fix了4.3.10开启3D加速系统闪退的问题。
今天使用bundle exec strainer运行cookbook测试,发现报错,
问题1:
1 | uninitialized constant RSpec::Matchers::BuiltIn::RaiseError::MatchAliases (NameError) |
查出原来是旧版本的兼容性问题,
http://stackoverflow.com/questions/24459289/rspec-expectations-2-99-0-lib-rspec-matchers-built-in-raise-error-rb5-uninitia
修改Gemfile中的版本依赖如下:
gem ‘chefspec’, ‘~> 4.0’
问题2:
旧的Rspec测试都是基于老的Rspec2,在Rspec 3对应的已经不再支持,所以运行会出现下面的问题,
1 | You must pass an argument rather than a block to use the provided matcher (equal true), or the matcher must implement `supports_block_expectations |
具体问题参考这个帖子:
http://www.wenda.io/questions/4095574/rspec-3-vs-rspec-2-matchers.html
http://stackoverflow.com/questions/26118031/rspec-3-vs-rspec-2-matchers
具体新的Rspec格式要求参见文档如下:
http://www.rubydoc.info/github/rspec/rspec-expectations/RSpec/Matchers
https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
问题3:
1 | RSpec 3.0 deprecates the :should way of writing specs for expecting things to happen. |
也是新的版本的问题,导致旧的语法格式有warnings,
Fix 方法1)
这个帖子介绍的很详细,包含fix方法,
http://makandracards.com/makandra/25409-how-to-remove-rspec-old-syntax-deprecation-warnings
1 | Inside spec/spec_helpber.rb, set rspec-expectations’ and/or rspec-mocks’ syntax as following: |
官方说明:
https://www.relishapp.com/rspec/rspec-expectations/docs/syntax-configuration
Fix 方法2)
还有一种fix方式是修改,转换旧的格式语法,有一个资料介绍一个自动转换工具:
http://yujinakayama.me/transpec/
暂时没有使用上面的方法,有空的话,可以尝试一下。
https://access.redhat.com/solutions/21964
Redhat 4,5,6之间的upgrade,官方不给与支持,推荐使用fresh install,然后把对应软件的配置和数据迁移到新的server上
Start from Redhat 7,
Redhat 对一些特定的case给与了支持,但是支持的力度有限 https://access.redhat.com/node/637583/
在Redhat Summit上
http://rhsummit.files.wordpress.com/2014/04/cantrell_w_1650_migrating_and_upgrading_rhel.pdf
Redhat官方的升级资料有个可恶的问题就是,给出的升级包没有下载的连接,不知道是不是需要什么subscription number 才能看到?
所以就索性按照Damian Zaremba写的关于 centos 6.5升级到7的步骤执行: http://damianzaremba.co.uk/
1 | 1. yum update |
悲剧的是重启后,发现系统根本起不来,不能load image.
因为原来系统做过快照,所以恢复一次,重试还是出现同样的问题,以亲身经历验证这个依靠centos的包升级不靠谱。
除非Redhat官方大发慈悲,公布相应的下载包,要不我也是对其升级方案持有悲观态度。
如果你最近使用Redhat7的话,会发现Redhat 7安装后的网卡名称非常怪异,不要惊慌,其实,这是Redhat公司开发的操作系统新版本的特性,
同事搜到的这篇文章介绍的很详细,至少没在Redhat官方网站上看到这么详细的介绍,值得看一下:
参考文章:
http://www.ehowstuff.com/new-naming-scheme-for-the-network-interface-on-rhel-7centos-7/